[Command Reference] [Function Reference] [Predefined Variables] [Expressions]
zMUD implements full expressions. Expressions can contain variables, and most common operators. Parenthesis can be used to override default operator precedence. When evaluating an operation, if all parameters of the operation are numeric, then a numeric operation is used, otherwise a string operation is used. The following operators are recognized (v1 and v2 represent variables, or other expressions). The list is in precedence order, with the highest precedence operators at the top.
If the pattern matching=~ operator is used, any saved pattern parameters are available in the true-command or false-command if expression is part of an IF command. However, you must use %% in front of the pattern to access the trigger pattern match variable rather than the alias parameters.
The constants: true, yes, on are defined with a value of 1, and the constants: false, no, off are defined with a value of 0.
Keep in mind that the AND, OR, XOR, and NOT operators are logical operators and not bitwise operation. For bitwise operations, use the various bitwise functions in zMUD. For example: (2 AND 4) is true using the logical operation, but %bitand(2,4) returns zero, which is false!