EXPRESSIONS

reference

Also known as: TRIG-EXPRESSIONS · TRIGEDIT-EXPRESSIONS · INCREMENTS · MATHEMATICAL · NUMBERS · TRIGEDIT-NUMBERS · != · <> · LOGIC · && · /= · || · \ · RNUMBERS · + · OPERATORS · OPERATIONS · == · EQUAL · ADDITION · SUBTRACTION

A false expression is any expression that evaluates to 0, or an empty string. A true expression is any expression that evaluates to anything other than a false expression. The following list are the recognized operators. They are listed in order of priority higher. Expressions are evaluated from left to right. Parenthesis can be used to create priority. |Expr| Name | Common Examples ------------------------------------------------------------------------------- | || | logical or | if %actor.level% == 30 || %actor.name% == Mo | | | (if actor level equals 30 or name equals Mo) | && | logical and | if %actor.is_pc% && %actor.sex% == male | | | (if actor is a player and is male) | == | equal to | if %actor.hitp% == 1 | | | (if actor hitpoints is equal to 1) | != | not equal to | if %actor.age% != 1 | | | (if actor age is not equal to 1) | < | less than | if %actor.dex% < 16 | | | (if actor dexterity is less than 16) | > | greater than | if %actor.align% > 349 | | | (if actor alignment is greater than 349) | <= | less than or equal | if %actor.exp% <= 2 | | | (if actor experience is less than or equal to 1) | >= | greater than or equal | if %actor.mana% >= 1 | | | (if actor mana is greater than or equal to 1) | /= | contains substring | if wardrobe /= %arg% (will match arg wardrob, | | | wardro, wardr, ward, etc. HELP MUDCOMMAND) | - | subtraction | 15 - 10 = 5 | + | addition | 10 + 15 = 25 | * | multiplication | 10 * 20 = 200 | / | division | 100 / 20 = 5 | ! | negation | if !%actor.is_killer% (if actor is not a killer) ------------------------------------------------------------------------------- NOTE: += and ++ are not used. Example: TSTAT 63