Set

From UBot Studio
Jump to: navigation, search

Set is a Data Command.

This command allows you to store a value in a variable.

Variable Name: creates a name for the variable

New Value: the value the variable is going to hold. The command also accepts variables and functions such as $next list item, $list item, $random list item, $previous list item, and $table cell.

The command settings allow you to determine if you want the variable to be:

  • Local: Specific to the command the variable is set to. It will not affect or be affected by another variable with the same name in a different command. Local variables are used in define commands, to specify a variable for only that specific defined command.
  • Global: The variable can be used everywhere and will affect and be affected by another variable with the same name in a different command.

When variables are created, they are listed in the tool box under Parameters:

Varar.jpg


Example


navigate("http://www.google.com/", "Wait")
set(#color, "yellow", "Local")
type text(<name="q">, #color, "Standard")


The above script will create a variable with the value "yellow" and fill the google search field with the value yellow.


Set.jpg



In the script below, notice that each variable is set locally, and though they both have the same names, they do not affect each other.

One value is Red and the other is Blue.


navigate("http://www.google.com/", "Wait")
define tes2 {
    set(#one, "blue", "Local")
    type text(<name="q">, #one, "Standard")
}
define tes1 {
    set(#one, "red", "Local")
    type text(<name="q">, #one, "Standard")
}
tes1()
tes2()


Set0.jpg

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox