do
do <string>
Run a line of text as a command typed by the owner mobile.
The owner executes the command exactly as if a player at its keyboard had typed it. The string may contain several commands separated by newlines; each line is run in turn, and blank lines are skipped.
Arguments
<string>— the command line to run. Build dynamic commands with interpolation, e.g."tell $actor hi". Embed a newline to run more than one command, e.g."stand\nsay ready".
Returns
null. Like the other action commands, a
successful do in the handle phase suppresses the event's default
action.
Owner
The owner must be a mobile. Called from an object or room script, do
does nothing.
Examples
after command (say) {
do "say hello world"
}
The mob runs say hello world itself, just as if it had typed the
command. The trace confirms the line is built and the script runs to
completion.
after command (poke) {
do "say I see you, $actor.\nsmile"
}
Two commands run in sequence — first a say with the actor's name
interpolated, then a smile.
See also
force— make a different creature run a command.silently— run a command with its output suppressed.echo,emit— send text directly without running a command.- Strings and interpolation · Handlers, events, and phases