Loop While

From UBot Studio
Revision as of 16:25, 12 April 2013 by LillyT (Talk | contribs)

Jump to: navigation, search

This command is a Flow Command. This command runs the contained commands as long as a condition returns true. You can create any condition necessary to your processes. For example, you could specify that as long as a certain element $exists on a page execute the commands in the loop. Or using the comparison qualifier, you could say, as long as the variable #number is less than 15 (<15), execute the commands in the loop. The command can be used with any qualifier command

Example

set(#number, 0, "Global")
loop while($comparison(#number, "=", 0)) {
    increment(#number)
    add item to list(%my numbers, $account data("Username"), "Delete", "Global")
}

The above script will only run if the variable #number is set to 0. If the variable is set to 0, the loop will run the increment command and the add item to list command, which will add a username to the list. It will not add anymore usernames after the variable has incremented past 0.

File:Loopwhile.png

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox