Rand

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
(Created page with "This function returns a random number between the minimum and maximum values. $Rand is a Math Function. You can use the Rand anywhere you need a random val...")
 
(Example)
 
(4 intermediate revisions by one user not shown)
Line 3: Line 3:
  
 
You can use the Rand anywhere you need a random value. You can use it anywhere  
 
You can use the Rand anywhere you need a random value. You can use it anywhere  
from a qualifier in the if then else command, to the eval constant. It is simply there to
+
from a qualifier in the if then else command, to the eval constant.  
provide a random number between two values.
+
  
 +
It is simply there to provide a random number between two values.
  
== Example ==
+
'''Minimum Value:''' The minimum value of the number being returned.
  
 +
'''Maximum Value:''' The  maximum value of the number being returned.
 +
 +
 +
 +
== Example ==
 +
<pre>
 
navigate("http://www.ubotstudio.com/playground/simple-form", "Wait")
 
navigate("http://www.ubotstudio.com/playground/simple-form", "Wait")
 
loop(5) {
 
loop(5) {
 
     type text(<about me textarea>, "{$rand(100, 200)},", "Standard")
 
     type text(<about me textarea>, "{$rand(100, 200)},", "Standard")
 
}
 
}
 +
</pre>
 +
 +
 +
Running this script will fill the field with 5 numbers between 100 and 200, each separated by a comma.
  
Running this script will fill the field with 5 numbers between 100 and 200.
 
  
[[File:rand.png]]
+
[[File:rand.jpg]]

Latest revision as of 18:11, 3 October 2013

This function returns a random number between the minimum and maximum values. $Rand is a Math Function.

You can use the Rand anywhere you need a random value. You can use it anywhere from a qualifier in the if then else command, to the eval constant.

It is simply there to provide a random number between two values.

Minimum Value: The minimum value of the number being returned.

Maximum Value: The maximum value of the number being returned.


[edit] Example

navigate("http://www.ubotstudio.com/playground/simple-form", "Wait")
loop(5) {
    type text(<about me textarea>, "{$rand(100, 200)},", "Standard")
}


Running this script will fill the field with 5 numbers between 100 and 200, each separated by a comma.


Rand.jpg

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox