UBot 3: The Standard Script Reference
Posted by Miriam M-B on 18 December 2010 02:56 PM

Download the PDF Script Reference for the Standard Constants HERE

Download the PDF Script Reference for the Chosen Commands HERE

Download the PDF Script Reference for the Action and Chosen Commands HERE

Download the PDF Script Reference for the Flow, Variable, Qualifier and Input Commands HERE

 

 

Below is a brief description of each function in UBot Studio.

 

Standard Commands


Qualifiers

true
returns true.

false
returns false.

both
This qualifer will return true only when all of it\'s subnodes return true. For programmers, think of this as \"and\"

either
This qualifer will return true if any of it\'s subnodes return true.

evaluate
evaluate is the most common of all the qualifiers. The evaluate qualifier allows you to compare any two values, which will return true if they match (or don’t match when using not).

not
This will return true when its subnodes do not return true.

search page
This is a qualifier that will return true if the specified text is present on the page.

Contains
This is a qualifier that will return true if the container text or list contains the specified search text.



Action Commands


Write To Browser
Whatever is written in this command will be displayed within the browser.

navigate
The nav command simply visits whatever URL you choose. The only parameters are the url and Yes and No, which correspond to whether or not the script should wait until the site finishes loading before moving onto the next command. This is set to Yes default and will be chosen most of the time.

click dialog button
The click dialog button command allows for the pressing of any (usually javascript) dialog button that appears on the screen. Sometimes these will be in the form of warnings or alerts (ie - \"You are now navigating away from Nationalcitybank.com. Please press OK to continue.\"), and other times they will be to tell you that something has been done incorrectly-Perhaps you’ve forgotten to fill in a form field on an account creation page. The command requires only one parameter - the text of the button that requires clicking. (This is not the window text, but the text of the button itself, usually something like \"OK\".) Please note that dialog boxes can halt the flow of the script, and the command that raises the dialog should be done inside a thread command.

set dialog text
This will type text into a dialog window into a field with a specified label. Please note that dialog boxes can halt the flow of the script, and the command that raises the dialog should be done inside a thread command.

close all dialogs
This command will set UBot Studio to close every dialog that opens. Be careful, as it can close UBot\'s dialogs as well.

clear cookies
This command will clear the domain cookies of a given website.

change proxy
This command lets you flip proxies. You can do this using a list from a file, or with a variable, or with specified proxies. You could, for example, search a page that contains proxies, test them, and implement them all in a single script.

send email
The send email command allows UBot scripts to connect to smtp email accounts and create and send emails. These emails could contain information relevant to the script that’s being run - for instance, you could email someone a list of scraped page information. Or you could scrape email addresses and email the client yourself!

build account
This works similarly to create account, but allows you to specify some of the values.

create account
The create account function builds all of the information necessary to create most accounts on most web pages. These values will be stored in the account constants, such as $first name, $last name, and so on.

run javascript
Runs JavaScript code.

save browser image
Saves the image of the browser.

shell
Runs an executable.

set proxy credentials
Sets credentials for the proxy which is set by \"change proxy\".



Flow Commands


pause script
This will pause the script, as though you hit the pause button. This should generally be used for debugging.

stop script
This will stop the script, as though you hit the stop button.

delay
Suspends the script for the specified number of seconds.

wait finish
Suspends the script until the webpage finishes loading. Useful after clicking a button or a link.

include
This command will allow you to use subs and scripts from other bots via the \"from included bot\" command. You can also call .ubot files from a provided url to reduce the size of a bot. Do not forget the http:// in your url.

return
Exit current sub or script and return specified data.

loop
The loop command allows anything contained within it to repeat a given number of times.

thread
This command will run it\'s contents in a seperate thread from the main script. This means that everything that happens in this command will happen independantly and simultaneously from the normal flow of the script.

if
The \"if-then-else\" command sequence is a fairly common way to determine the flow of events in scripting. In UBot it works very simply. A qualifier follows the \"if\" command, and the action specified follows the \"then\" command. If the qualifier returns true, then the commands will run. If and only if the qualifier is false, the contents of \"else\" will run.

while
This command will run all contained commands for as long as its qualifier remains true.

run script
With this command, you can run a script as though it were a sub

run sub
Once a sub has been created, it will not run until you tell it to with this command.

sub
A sub is like a self contained script within a script. It helps to create cleaner and more maintainable code. When you have a sub in your script, it will not run until you call it using the run sub command.

in sub window
Runs all contained commands inside a separate web browser in a separate window.



Chosen Commands


click chosen
This command will click a link or a button. you can also toggle check boxes with it.

change chosen attribute
After choosing an element, change chosen attribute lets you change a value within that element. This is useful for, among other things, filling in form fields, setting checkboxes to a given value, setting drop down fields, and selecting radio buttons.

select random child chosen
Select random child chosen is extremely useful for drop-down boxes. Choosing this command after choosing a drop-down list by attribute randomly chooses any value within the drop-down box. So, for example, if you want to create an account and don’t care which state will be selected, choose the state drop-down box by an attribute and use this command to choose any state within the value.

send keys file chosen
This command is used specifically for filling text into file input fields, as a means of getting around the lack of direct access to them. This command will not steal focus, and runs entirely in the background. To simulate typing on elements other than file fields, use send keys chosen field. This command no longer works if you have internet explorer 8 installed.

send keys field chosen
This command will simulate keystrokes to input fields other than file fields. This is useful in cases where the field reacts to keystrokes with javascript, and change chosen attribute does not trigger the javascript associated with the element.

change file field chosen
This will set the file in a file field.

save chosen image
Saves the image of an element.

focus chosen
This brings the chosen element into focus. Useful to use with input commands.



Variable Commands


save to file
Saves text and lists to files. With text, it will save the text verbatim to the specified file. With lists, it will save one list item per line. To read files, use constants $read file and $list from file

set
Set allows you to create a variable and choose its value.

set local
This creates a variables that is available only from within a sub or a script

parameter
Use this command at the top of a sub or a script, and when you call the sub or script, you can pass these parameters in, where they will become local variables.

inc
Increments a number variable by 1.

dec
decrements a number variable by 1.

add to list
Add to list allows you to work with multiple strings or variables at one time, which is essential for page scraping or loading information from text files. Choosing add to list with a sub parameter of \"$list from file\" will allow you to pull a text file into a UBot list (all lists are indicated by a % sign), which can then be modified or read on a line by line basis with a variety of commands.

add to local list
This will add items to a list that is only available to the current sub or script.

set list position
This sets the position of a list, which is used by $next list item

clear list
Empties the contents of a list and resets its position to 0.

add list to table as column
This inserts a list into a table at a specific location in the form of a column. If the table does not exist, it will be created.

add list to table as row
This inserts a list into a table at a specific location in the form of a row. If the table does not exist, it will be created.

Clear Table
Empties the contents of a table.



UI Elements


ui text box
This creates a text box in the ui panel for the script. Any time text changes in the text box, the specified variable will change to that text.

ui block text
This creates a large text box in the ui panel for the script. Any time text changes in the text box, the specified variable will change to that text.

ui check box
This creates a check box in the ui panel for the script. The specified variable will contain \"True\" if the box is checked, and \"false\" if it is not.

ui open file
This creates a file field in the ui panel for the script. Any time the field changes, the specified variable will change to that text.

ui save file
This creates a file field in the ui panel for the script. Any time the field changes, the specified variable will change to that text.

ui list box
This creates a list box in the ui panel for the script. The specified variable will contain the selected list item.

ui stat monitor
This creates stat tracker in the ui panel for the script. Whenever the specified variable changes in the script, the stat panel will reflect that change.

ui window
This creates a menu item under the settings menu. When the menu is clicked, a window will pop up showing all of the ui items that exist as but items within this command.



Standard Parameters


Math Constants

$eval
$eval returns the value of a mathematical function or javascript. This could be a simple math string (under $eval the parameter 1+1 would return \"2\", or it could be more complicated math or javascript involving variables. You will use variables the same way you would use variables in any piece of text.

$rand
Chooses a random number between the minimum and maximum values.

Account Constants

$first name
Returns a first name generated by create account or build account.

$last name
Returns a last name generated by create account or build account.

$email
Returns an email generated by create account or build account.

$username
Returns a username generated by create account or build account.

$password
Returns an password generated by create account or build account.

$zip code
Returns an zip code generated by create account or build account.

$birth day
Returns an birth day generated by create account or build account.

$birth month
Returns an birth month generated by create account or build account.

$birth month word
Returns an birth month\'s name (January, February, etc.) generated by create account or build account.

$birth year
Returns an birth year generated by create account or build account.

$captcha
For use with the of the captcha solving commands, this constant displays the results of said captcha command.



Variable Constants


$list total
Returns the total number of items in a list.

$list position
This returns the current numerical position of UBot in a list.

$random list item
This returns a line from a list, at random.

$next list item
This constant will return the list item at the list\'s current position, and then increment the list\'s position.

$list item
This constant will return the list item at the specified position

$read file
This loads a file for use in a parameter.You can also call a file from a url location for use within a parameter.

$list from file
Combine this constant with add to list to pull information from a file into a list. Items are separated at new lines.

$list from text
This constant breaks a string of text into a list by delimiting the values based on a delimiter of your choosing. Where $list from file creates a list that mimics the text file that you load, paragraph/line breaks and all, $list from text allows you to work directly with CSV and other delimited files.

$table cell
Calls an item from a table at a specific row and a specific column

$table total rows
Notes the number of rows within a table

$table total columns
Notes the number of columns within a table

$text from list
This constant creates a text string based on a list. It will connect the list items with the specified connector.



Browser Constants


$page scrape
Returns text or a list scraped from the current page. The two parameters will be the text on either side of the text you wish to scrape. Note that this is a constant, which means that to use it, you must select a parameter node. To set a variable with it, for example, create a set command, leaving the contents blank, which will create a placeholder. Click the placeholder and then choose $page scrape.

$scrape chosen attribute
Returns text or a list of the specified attribute from the chosen element(s). Like $page scrape, This constant must take the place of a parameter node.



Text Constants


$story title
Must be used after $find story. This returns the headline or title of the story – as in the $find story constant, this command is not always completely accurate.

$find story
The $find story constant should return the \"story content\" on a page – that is, it automatically returns the main article and only the main article on a news or blog page. This is not always 100% accurate.

$spin
This constant will return a random selecting of parts of text in spin format. An example of spin format might be: {my|our} {cat|dog|rabbit} went to {the store|the bicycle shop|cuba for some reason}. Spin format is recursive, so you can nest brackets.

$new line
$new line creates a line break.

$nothing
Returns an empty value.

$replace
Returns a piece of text modified from an original by replacing a piece of it with another. For example, if you started with the original text \"blue dog democrats\", and you replaced \"blue\" with \"wiener\", the result would be \"wiener dog democrats\"



Document Constants


$url
Returns the current url.

$title
Returns the current page title.

$meta description
Returns the current meta description.

$document text
Returns the html code of the current page

$meta keywords
Returns the current meta keywords.



System Constants


$document folder
Shows the current directory of the computer’s document folder.

$special keys: down
Allows you to enter the \"arrow down\" value into a parameter. Useful for send keys

$return value
Runs a sub or script and returns the sub or script\'s return value.

$date
Returns the current date.

$application folder
Shows the directory that the program is in.




The Pro and Dev License Commands



*UI Elements(Dev License ONLY)*



UI html Panel
This creates a blank panel in the ui area in which you can use html, css, and javascript to design your own ui.

UI Splash Page
This allows you to display a webpage within the compiled bot before the bot even starts to run.

UI Remove Branding
This will remove the \"powered by\" link in UBot Compiled Bots.

UI Foreground Color
This will change the foreground color in UBot Studio, UBot Compiled Bots, and UBot Reader.

UI Background Color
This will change the background color in UBot Studio, UBot Compiled Bots, and UBot Reader.

UI Tab Color
This will change the tab color in UBot Studio, UBot Compiled Bots, and UBot Reader.



*The Choose/Chosen Commands*


Scrape Chosen Table
Scrapes and creates a table based on a chosen table.



*The File Commands*


Rename File
Renames a file

Move File
Moves a file to a new location.

Delete File
Deletes a file.

Copy File
Copies a file to a new location.

Rename Folder
Renames a Directory (Folder)

Move Folder
Moves a folder to a new location.

Delete Folder
Deletes a folder.

Create Folder
Creates a new folder

Copy Folder
Copies a folder to a new location.



*Input Commands*


Move Mouse
This will move the mouse to specified coordinates.

Mouse Click
This will simulate a mouse click, or a mouse down or mouse up action.

Send Keys
This will simulate typing.

Press and Release Key
This will simulate pressing and holding the alt key, shift key, or control key.



*Action Commands*


Set Active Window
This will bring a desired window into focus according to that window\'s title.

Close Window
This will close the active window.

The Pro and Dev License Parameters


*Variable Constants*


Subtract lists
This function allows you to compare two lists and create a new list containing all items that are unique to the first list.

Subtract lists
This function allows you to compare two lists and create a new list containing all items that are unique to the first list.

Sort lists
Sort List allows you to sort all items contained in a list in either ascending or descending order.

Common list items
This function allows you to compare two lists and create a third list containing all items that are common to both lists.


*Text Constants*



Text to uppercase
Changes all text in a string to uppercase letters.

Text to lowercase
Changes all text in a string to lowercase letters.

Text to proper case
Capitalizes the first letter of each word in a string which is also known as Title Case.

Trim
Removes any leading or trailing blank spaces from a string.

Subtext
Returns a new string that is a substring of an original string. The substring begins at a given starting point and extends up to the given length.

Random text
Generates a random alpha-numeric string of user defined length, including upper and lowercase letters

Pad text
Adds a fixed number of characters to the left or right side of a string based on the total length of the string selected.

Text length
Returns the total length of some text.

Insert text
Inserts a substring into a string based on the specified position.

Find index
Finds the index of any subtext within a text string

Append line to text
Appends a new line to a piece of text.

Find regular expression
Find regular expression allows users to conduct specific searches on text strings using regular expressions.


*File Constants*



Get files
Files From Folder returns a list of all files in any given directory.

Special folders
Shows the current directory of the computer’s special folder.


Comments (0)
Help Desk Software by Kayako Resolve