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

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