Description of MUSHclient world function: world.Execute
||Executes a command as if you had typed it into the command window
long Execute(BSTR Command);
View list of data type meanings
The Execute function lets you execute arbitrary commands as if they were typed into the command window.
The command will be parsed exactly the same as the command window parser, depending on currently-set options (eg. speedwalking, command stacking, scripting etc.).
The only difference is that the command will:
* Not be placed in the command history (as you didn't actually type it in)
* Not unpause the output window if it is paused
There is a possibility that you might accidentally nest calls to execute, for example if an alias called itself, so MUSHclient limits nested calls to the Execute function to 20 levels of nesting.
Note that the Execute function ignores the auto-say setting. Thus you can still use Execute to do things, even if the player has turned on auto-say for a quick chat. However if you are planning to do script commands you will need to be sure that the scripting prefix has not changed.
If you are planning to execute a script using Execute you should probably find the current script prefix (using world.GetOption) rather than relying it on being the same all the time.
Note: Available in version 3.35 onwards.
world.Execute "north" ' normal command
world.Execute "#4s 3e" ' speed walk
world.Execute "/world.Debug ""colours "" " ' execute a script
world.Execute ("north"); // normal command
world.Execute ("4s 3e"); // speed walk
world.Execute ("/world.Debug ("colours ") "); // execute a script
$world->Execute ("north"); # normal command
$world->Execute ("4s 3e"); # speed walk
world.Execute ("north") # normal command
world.Execute ("4s 3e") # speed walk
world.Execute ("world.Debug ("colours ") ") # execute a script
Execute ("north") -- normal command
Execute ("4s 3e") -- speed walk
Execute ("/Debug ('colours') ") -- execute a script
eOK: Executed OK
eWorldClosed: World is closed
eCommandsNestedTooDeeply: Commands nested too deeply
View list of return code meanings
|Introduced in version
See also ...
||Sends a message to the MUD
Search for script function
Enter a word or phrase in the box below to narrow the list down to those that match.
The function name, prototype, summary, and description are searched.
Leave blank to show all functions.
Many functions return a "code" which indicates the success or otherwise
of the function.
view a list of the return codes
The "prototype" part of each function description lists exactly how the function is called (what arguments, if any, to pass to it).
view a list of the data types used in function prototypes
View all functions
Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.
Gammon Software support
Forum RSS feed ( https://gammon.com.au/rss/forum.xml )