Home mm2k6 Help Files Commands Script Flow Control - While
21 | 04 | 2018
Script Flow Control - While
Article Index
Script Flow Control
IF command
All Pages


Format: /while {condition} {commands}

While executes the command as long as the condition is true.

  • {condition} A condition that evaluates to true or false. See help on if  for information on the condition.
  • {commands} The commands will be executed until the condition is false.

Caution is advised when using the while command. It creates a loops that does
not stop until the condition is evaluated as false. If you create a condition
that never evaluates to false it will stay in an infinite loop. An example of
an infinite loop is this: /while {1 = 1} {say doh!} This while will never stop
executing and the program will appear locked up. The idea behind the while is
to create a condition that uses variables. Somewhere in the commands portion
you would set a variable causing the loop to fail.