Code View

From UBot Playground
Jump to: navigation, search

Code View is a feature found in the Professional Edition and Developer Edition of UBot Studio.

The feature allows you to type out your commands and functions instead of dragging and dropping.

This allows for faster scripting and easier editing of code withing your script.

To switch to code view, simply click the Code View Button on top of the scripting window.


Once clicked, each node in your scripting window changes to text versions of uscript.

For example, the navigate command node in Code View is written as the following:

navigate("", "Wait")

To switch back to Node View, simply click the Node View button at the top of the scripting window.


Handling Scripting Errors Within the Script[edit]

The Code View features comes ready to handle any typos in your script that might prevent the rest of your script from working appropriately.

For example, this script has a typo in the type text command. Can you spot the error?

navigate("", "Wait")
type text(<username field>, "aspiedargie123", "Standard")
type text(<password field>, "jonaex533%", "Standard")
type text(<first name field>, "May", "Standard")
type text(<last name field>, Darth", "Standard")

The issue is a subtle one. The value "Darth" for the last name field is missing a quotation mark.

The Code View window will spot and highlight the issue within the script. It will provide the line number where the issue is located.


Clicking the Node View button before the error is fixed will result in this message:


The error must be fixed before switching back to Node View.

Finally, when ready to run the script, simply switch to Node View and run the script from there.