In this tutorial we are going to go over UI Elements, the wait finish command, in sub window command, If command and the thread command.
UI Elements- Drag the UI text box command into your script window. Give it a label and a variable. A UI text box will appear at the top of your screen.
Anything you put into that text box will be your variable. Drag over the field that you wish to fill and apply the UI variable that you just created.
So whatever you type in the box at the top will appear in the field you chose to fill.
You can load files from your computer or create a file and save it. Just drag over the UI open file into your script. After you give it a label and apply the variable, any file you load into the UI open file will go into the field you wish to fill. This is good if you want to upload a video to a website.
UI list box- You can create a list of words to choose from. When the parameter window pops up, type the words you want a list of into the values box separated by commas. Your list will appear at the top of the window. Drag the field you wish to fill into the script window and apply the variable you created for the UI list box. Now, whatever word you choose in the list, will be filled into the field.
For a block of text, use the UI block text element.
I will explain the UI Stat Monitor later in this tutorial.
Wait Finish Command allows a page to load before moving on with the rest of the script. If you forget to add in a wait finish, it will continue to go on with the script before everything can load. This can create problems with what you are trying to accomplish. So always try and remember that anytime you are going to click a button to go to another page, add a wait finish command. The navigate command has a built in wait command.
The time out option works so that if a page takes longer than 30 seconds to load, it will just continue on with the script.
The Delay command delays the script for however long you want. This works if you want to look over the page, or wait to see if anything pops up before continuing on with your script.
There are also stop script and pause script commands. These are good if you are having troubles with your bot. You can add the stop or pause command into your script so it will stop it at a certain point and not run through the whole bot and you can diagnose problems.
The Loop command- is a very useful tool. It will repeat whatever action you tell it to as many times as you want.
When you drag the loop into the script window, it will ask you how many cycles you want it to loop for. You can put a variable, a constant, tell it to do one loop cycle for one thing in a list, or just have it loop for a certain number of times in a row.
For example, maybe you want to create 10 different user names with 5 different first and last names.
So drag all of your commands that you created in the loop. In order to get the user names, names, passwords, etc to change you have to use the create account command. Drag the create account command into your script window. Put it at the very top and choose the gender you want the user names to be. This tool randomizes all of the account constants and what they are going to output.
Make sure when you create a loop, that you don’t forget to add a wait finish command after it clicks submit and before it cycles into the next loop.
Another type of loop is the while loop. This continues to run the loop as long as some condition is met.
Create a variable, give it a label and set the content to 1.
For this example we are also going to see how the UI stat monitor works. So drag the UI stat monitor into your script window and have it watch the variable that you just created. The UI stat monitor will watch your loop command and display which loop it is on at the top of your page.
Drag the while loop into your script. Right click on the qualifier place holder and choose evaluate. We are going to tell it to continue looping as long as the variable is below 5. So this will make 5 the second value.
In order for your loop to continue on to the next loop, instead of staying in an endless cycle of 1, you have to add in an INC command. Drag the inc to the bottom of your script. This increases the variable count by 1.
The search page qualifier allows you to have UBot search for a certain word on a page. As long as this word is available on the page, it will continue to loop. Or you can tell it to continue doing the loop until a certain word is found on the page. Once it finds that word, the loop with stop.
There is the If command. This lets UBot make a decision. It lets it consider a piece of data that we give it and then it makes a decision based on that data. So if a certain condition is met then preform this task, if it is not met then perform another.
Go to www.ubotstudio.com/playground. We can tell UBot to search the page for the “Simple Form” link, if it finds this, then we want it to click the link. If it can’t find it, we want it to fill in the about me section on the simple form page.
For this example, I am going to show what you can do when you click a link and it navigates to a different page. Since you are on a different page after clicking the link, the same conditions won’t be met, so you have to tell UBot to do something else.
To do this right click on the simple form link and choose search page. You can highlight what you want it to look for. Drag over the simple form link into the “then” node, this will tell it to click the simple form link.
After we click the simple form link, we are going to be on a different page. Since we are on a different page now, the same conditions won’t be met. So we have to tell it to do something else.
Drag the about me section into the ‘else’ node. Fill it in with whatever you want. When you run it a second time, it will fill in the about me section.
Thread command- anything that goes inside of this, will happen independently from the rest of the script. It follows it’s own rules, it’s like a script that is running at the same time as the main script.
Sometimes a dialogue window will pop up and stop the script from continuing to run. The solution to this problem is using the thread command. Put the click chosen button for the button that causes the window to pop up, in it’s own thread. Then drag a delay command into the script window. This delay gives the pop up enough time to pop up before moving on. Use click dialogue button on the left hand side and drag it under the delay command. Enter the command that you have to click on the pop up (ex: OK) This will click the button in a separate thread, and because it does this, it is free to move on with the script.
In sub window command- it does everything you put inside it, in another pop up window. Anything you put in your script will happen in a pop up window. When it finishes with the commands that are included in the sub window, it will close the window.
The divider- is just something that you can put into your script to make it look cleaner and nicer. If you want, you can divide things into groups, but the flow has to remain the same.
In the next tutorial, we will cover the different ways you can work with lists.















































