Zesstra | d59c389 | 2019-11-28 20:53:39 +0100 | [diff] [blame] | 1 | SYNOPSIS |
| 2 | int command(string str) |
| 3 | int command(string str, object ob) |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 4 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 5 | DESCRIPTION |
| 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 User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 9 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 10 | 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 User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 14 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 15 | 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 User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 18 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 19 | 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 User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 22 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 23 | HISTORY |
| 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 User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 27 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 28 | SEE ALSO |
Zesstra | d59c389 | 2019-11-28 20:53:39 +0100 | [diff] [blame] | 29 | command_stack(E), notify_fail(E), enable_commands(E), get_eval_cost(E) |