UBot Basic Training Boot Camp Tab 2 Documentation For The Native Browser

UBot Studio – Stealth

Basic Training – Tab 2

Boot Camp

For the Native UBot Browser

 

 Welcome back Newbie!

clear list command

 

 

 

Clear List Command, ubot studio stealth

Clear List Command

In Tab 2 we start with a “clear list” command, it is a great idea to use it     before an “add list to list” command. All this does is clear the data in the named list.

 

 

 

add list to list command

 

Add List to List Command, ubot studio stealth

Add List to List Command

Next we have the “add list to list” command(node). In the first combo box “Starting list” you can either type the list name or use the down arrow and you will see a list of list that already have been created. Now choose your list, if you don’t have one to start with this will be created now. You can think of it as starting a blank grocery list.

 

 

In the next field “List to add” this is where you add data. Think of it as someone gives you their list to add to your grocery list. In this case we are adding some fake data to play with.

 

 

 

list from text function

 

We are using the “$list from text” function($) which is found under the Data Functions Category in its parent Parameters Category. There is also another common function we use here is the “$list from file” and I will discuss it later. In another tutorial, feel free to try it it is not scary at all. But for now we will talk about $list from text. In the first Text field is where add some data to use in our bot. As you can see each line is specific to each user so the delimiter is a “$new line.” This how the computer knows how to handle this data we have at this point.

 

 

 

List From Text Function, ubot studio stealth

List From Text Function

Here is some of what Wikipedia has to say about delimiters.

A delimiter is a sequence of one or more characters used to specify the boundary between separate, independent regions in plain text or other data streams. An example of a delimiter is the comma character, which acts as a field delimiter in a sequence of comma-separated values.

new line function

 

In the case of this add list to list node we are using the “$new line” function  to tell the computer what to do with this data.

Also, each line the values are delimited by a comma for later.

You also must keep in mind that now all functions can be used in the list to add field. What is cool is that UBot wont let you use them so you will know when you drag them in.

 

loop command

 

 

Loop Command, ubot studio stealth

Loop Command

 

 

List Total Function, ubot studio stealth

List Total Function

Moving on to the all powerful loop command. This is the work horse of UBot and will be used in most cases. In the cycles field we use a “$list total” and this will give us a number lines in the named list %user data. So now the computer knows how many cycles or loops to run as not to run endlessly.

 

 

 

alert command

 

 

Alert Command, ubot studio stealth

Alert Command

The next command inside the loop is the “alert”, this serves many purposes, in our case it will show us the list total of %user data. I just put the alert there so you can see how many lines are in the list. This will be removed in another tab.

 

 

 

 

set command

 

We will skip the next two nodes, Navigate and Wait for Element as we covered those in the last tab. The next new node is the “set” command. It holds $next list item and “sets” the variable “#user data NLI” to… you guessed it! The next item in the list starting with the first and over writing each list item on each subsequent loop. That was a mouth full!

 

 

Inside a Set Variable, ubot studio stealth

Inside a Set Variable

 

What do I mean by “set”. Well, you can put that variable in an alert and see exactly what is in it if you like or you can open up the debugger with “Ctrl + d”. Another way is to go to the top menu bar and you will see “View”, press that button and look down the list then click Debugger. The debugger is a way to see what the computer sees at any given point in your script all in one place. Pretty neat ehh?

 

That way when you have issues you can use it to “debug” your script to solve any scripting errors.

 

Okay, back to the program!

See what I just did there?

 

 

List Item and List From Text, ubot studio stealth

List Item and List From Text

The next set of nodes we covered earlier however, we added some functions to each one. I also set them in a loop with 1 cycle so I can run them all at once. This is easier than running them separately. In each node “Type Text” I added to nested functions$list item” which returns an item from a named list at a given position. Inside that we have “$list from text” which you should know. UBot will call the inner most function and work it’s way out.

 

Now “$list item” can take a named list or a function as you can see here. In this case we are reusing the variable “$user data NLI” with a comma delimiter. You may have guessed that each list item is a list in its self. In this case 3 items name, phone and email. So, now UBot split these items with “$list form text” into “$list item” and in the “Type Text” command for the customer name field(on the form) we need to get position 0 for the name Bob.

 

I know what you’re thinking, Why zero?

Good question!

 

Computers are zero based which simply means that they start at zero most of the time, such as is the case in UBot. However, you can make it start at 1 if you really really want to bot like a human. I ma just saying that you will be creating more code and going against the grain. Any who, if you look at our list in the debugger you will notice this fact of computers that the list starts with zero. The same would be when you use tables.

 

 

Set Variable and the Debugger, ubot studio stealth

Set Variable and the Debugger

 

 

Alright, back to the rest of the Type Text commands in the loop real quick. As you may have suspected their positions are 1 and 2 for the phone and email respectively.

 

click command and spin function

 

 

Click Command and Spin Function, ubot studio stealth

Click Command and Spin Function

For the next element we have the “radio button” usually these are clicked and you can only choose(click on) one. So, I just dragged the “spin” function into the yellow field(Element to click) in place of the attribute name. Now each time the click button is called it will call the $spin and randomly select one of the pizza sizes on each loop. Pretty slick? I must tell you that this won’t work all the time but it is definitely worth the try if you want some randomness in your bot.

 

Okay, looks like we covered the new commands and functions in this tab we can hit F5 (red run button) and run the script and see what it does and make sure all is still well before we let it rip through all the list items. Last thing you want to do is click on a ton of error messages on every loop. That is a waste of time my fellow soon to be UBotter.

Congrats we’re almost, there!

Save

Posted in Basic Training.