PasteCommand
Script function

world.PasteCommand

DOC_scripting Read about scripting

Type

Method

Summary

Pastes text into the command window, replacing the current selection

Prototype

BSTR PasteCommand(BSTR Text);

DOC_data_types View list of data type meanings


Description

This pastes the supplied text into the command window, which does not have to be empty (unlike SetCommand) at the current cursor position, replacing any selection. It returns the text that it replaced, if any.

eg.

Command window reads:

go north
^^

("go" is selected)

You execute: s = PasteCommand ("walk")

Command window now reads:

walk north

s contains "go"

You could use this to make shortcut keys that paste frequently-used words into the command window.

For example:

/Accelerator ("Alt+N", "/PasteCommand 'swordfish'")

Now, whenever you hit Alt+N the word "swordfish" is pasted into the command window, replacing the current selection, or at the cursor.



VBscript example

previous = PasteCommand ("swordfish")



Jscript example

PasteCommand ("swordfish");



PerlScript example

$world->PasteCommand ("swordfish");



Python example

PasteCommand ("swordfish")



Lua example

previous = PasteCommand ("swordfish")



Return value

The previously selected text, if any.




See Also ...

Topics

DOC_send_paste Commented softcode
DOC_send Sending to the world

Functions

FNC_Accelerator Accelerator (Add or modify an accelerator key (keystroke to command mapping))
FNC_Send Send (Sends a message to the MUD)
FNC_SendImmediate SendImmediate (Sends a message to the MUD immediately, bypassing the speedwalk queue)
FNC_SendNoEcho SendNoEcho (Sends a message to the MUD without echoing in the output window)
FNC_SendPkt SendPkt (Sends a low-level packet of data to the MUD)
FNC_SendPush SendPush (Sends a message to the MUD and saves it in the command history buffer)
FNC_SetCommand SetCommand (Sends text to the command window)

(Help topic: function=PasteCommand)

DOC_contents Documentation contents page