Loop While

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
 
(2 intermediate revisions by one user not shown)
Line 1: Line 1:
This command is a [[Flow Commands|Flow Command]]. This command runs the contained commands as long as a condition returns true. You
+
This command is a [[Flow Commands|Flow Command]]. This command runs the contained commands as long as a condition returns true.  
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 Functions|qualifier function]]
+
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 Functions|qualifier function]].
 +
 
 +
'''Condition to Wait For:''' The condition that will be determining whether to containing commands will be looped.
 +
 
  
 
== Example ==
 
== Example ==
Line 11: Line 18:
 
}
 
}
 
</pre>
 
</pre>
 +
  
 
The above script will only run if the variable #number is set to 0.
 
The above script will only run if the variable #number is set to 0.
Line 16: Line 24:
 
It will not add anymore usernames after the variable has incremented past 0.
 
It will not add anymore usernames after the variable has incremented past 0.
  
[[File:loopwhile.png]]
+
 
 +
[[File:loopwhile00.png]]

Latest revision as of 18:31, 10 November 2017

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 function.

Condition to Wait For: The condition that will be determining whether to containing commands will be looped.


[edit] 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.


Loopwhile00.png

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox