Eval
From UBot Studio
(Difference between revisions)
Line 14: | Line 14: | ||
type text(<about me textarea>, $eval($add(4, 4)), "Standard") | type text(<about me textarea>, $eval($add(4, 4)), "Standard") | ||
</pre> | </pre> | ||
+ | |||
Typing 4+4 into the eval function brings up a new function called the add function. | Typing 4+4 into the eval function brings up a new function called the add function. | ||
+ | |||
<pre> | <pre> | ||
$eval($add(4, 4)) | $eval($add(4, 4)) | ||
</pre> | </pre> | ||
+ | |||
The subtract function appears when 4-5 is typed into the eval function. | The subtract function appears when 4-5 is typed into the eval function. | ||
+ | |||
<pre> | <pre> | ||
Line 31: | Line 35: | ||
Running the script will fill the field with the correct answer for 4-4. | Running the script will fill the field with the correct answer for 4-4. | ||
+ | |||
[[File:eval.png]] | [[File:eval.png]] |
Revision as of 13:04, 21 May 2013
This function returns the results of executing a piece of javascript or simple mathematical equations. $Eval is a Math Function.
With anything except for math equations, you will need a full website opened in the main browser in order to run the eval function.
Expression: the math or javascript expression being evaluated.
Example
navigate("http://www.ubotstudio.com/playground/simple-form", "Wait") type text(<about me textarea>, $eval($add(4, 4)), "Standard")
Typing 4+4 into the eval function brings up a new function called the add function.
$eval($add(4, 4))
The subtract function appears when 4-5 is typed into the eval function.
$eval($subtract(4, 4))
Going back to our original script:
Running the script will fill the field with the correct answer for 4-4.