CASE
Syntax: #CA index {command1} {commandn}
Allows you to select a command from a list to be executed. The index parameter determines the command to execute from the list given by command1..commandn. If index is greater then the number of commands, it wraps around. For example, if there are four commands and you ask for the fifth, the first is returned. This allows you to use the predefined variable %random to select a random command.
If the index is negative, results are undefined.
CASE examples
#CASE 2 {first command} {second command} {third command}
sends the string second command to the MUD
#CASE @joincmd {join} {rescue}
if the variable @joincmd is 1 (or 3,5,7...) the string join is returned, otherwise the string rescue is returned.
#CASE %random {Hello} {Hi there} {Hiya} {Hi}
returns a random string from the given list to the MUD. |