From TinyMUX
Jump to: navigation, search

Command Evaluation

When you submit a command to be executed (whether by typing it in or by having a machine run it, the following steps are performed, in sequence. If the command matches something in a step, the matching actions are performed and the walk down the list stops.

  • The first letter of the command is checked to see if it is a single character command (", :, etc). If so, %-substitution and function evaluation may be performed (depending on the command), and the command is executed.
  • The comsystem checks for a channel alias.
  • The command is checked to see if it is the home command. If so, the player or object performing the command goes home.
  • The command is checked against the exits in its current room. If one matches, it is performed. If more than one matches, one is picked randomly from the exits for which the player passes the lock (If the player does not pass any locks, then the exit to be tried is picked randomly.
  • The first word of the command is checked to see if it is an internal command. If so, the remainder of the command is broken up into arguments, %-substitution and function evaluation may be performed on the (split up) arguments, and the command is executed.
  •  %-substitution and function evaluation is performed on the command.
  • All objects in the player's inventory, all objects in the player's location, and the location itself are searched for $-commands that match the command. All that match are performed. The player may or may not be checked, depending on how the MUX is configured.
  • The commands defined in the zone tree you or your location is in.
40px-Icon stickynote.gif Note: Commands that can cause other commands to be executed (such as @wait, @switch, @trigger, etc) never perform substitution on their arguments, they leave the evaluation to the command that is to be executed. This prevents most of the problems with getting objects to perform unintended commands by putting a ';', '}', or ',' in an argument. The @force command is an exception in that it evaluates its argument, so it should be used with caution (preferably by never using it to pass information that someone else entered, use @trigger instead).

Also, the construct '$xx *:%0' does not work (and is very dangerous programming), use '$xx *:@force me=%0' if you need this functionality.