blob: e32ee61bdedb826973883f7a23d5061a6130fa49 [file] [log] [blame]
Zesstrad59c3892019-11-28 20:53:39 +01001SYNOPSIS
2 int command(string str)
3 int command(string str, object ob)
MG Mud User88f12472016-06-24 23:31:02 +02004
Zesstra715ec202025-07-09 22:18:31 +02005DESCRIPTION
6 Execute str as a command given directly by the user. Any
7 effects of the command will apply to the current object,
8 or to the given <ob>ject.
MG Mud User88f12472016-06-24 23:31:02 +02009
Zesstra715ec202025-07-09 22:18:31 +020010 Return value is 0 for failure. Otherwise a numeric value is
11 returned which tells the evaluation cost. Bigger number means
12 higher cost. The evaluation cost is approximately the number
13 of LPC machine code instructions executed.
MG Mud User88f12472016-06-24 23:31:02 +020014
Zesstra715ec202025-07-09 22:18:31 +020015 If command() is called on another object, it is not possible
16 to call static functions in this way, to give some protection
17 against illegal forces.
MG Mud User88f12472016-06-24 23:31:02 +020018
Zesstra715ec202025-07-09 22:18:31 +020019 Commands are stacked, meaning that after the given command <str>
20 has finished, the old settings of this_player(), query_verb()
21 etc, are restored.
MG Mud User88f12472016-06-24 23:31:02 +020022
Zesstra715ec202025-07-09 22:18:31 +020023HISTORY
24 Up to 3.2.6 in native mode, commands could be applied to the current
25 object only.
26 Since 3.2.7, commands are stacked.
MG Mud User88f12472016-06-24 23:31:02 +020027
Zesstra715ec202025-07-09 22:18:31 +020028SEE ALSO
Zesstrad59c3892019-11-28 20:53:39 +010029 command_stack(E), notify_fail(E), enable_commands(E), get_eval_cost(E)