IFS

commands

Also known as: ELSEIF · END · TRIGEDIT-END · TRIGEDIT-IF · TRIG-END · TRIG-IF · ENDIF · TRIG-ELSE · ELSE-IF · IF-ELSE · NESTING

Usage: if (expression) ... elseif (expression) ... else ... end if %actor.is_pc% %echo% You are a player else %echo% You are a mob. end An 'if' must occur before the other three. If expression evaluates to true (HELP EXPRESSIONS), the statements between the if statement and the next elseif, else, or end are executed. If it stopped at an elseif or else, it scans for the next end, and continues execution at that point. If the expression evaluated to false, it searches for the next elseif, else, or end. If it finds an elseif, it checks that expression. If it is true, it executes the statements between the elseif and the next elseif, else, or end, and then finds the end of the block. If it is false, it continues searching in the same pattern, until a true elseif is found, an else is found, or an end is found. There may be 0 or 1 else statements and 0 or many elseif statements in the block. For anyone having trouble with the format of if/elseif/else/end blocks Examples: TSTAT 22, 93 ***EVERY IF NEEDS AN END: 2 IF'S NEEDS 2 ENDS....*** See also:: EXPRESSIONS, NESTED-IFS