krotblock.blogg.se

How to use osbot scripts
How to use osbot scripts









how to use osbot scripts

How to use osbot scripts how to#

Below, you will find an example of how to properly use an OR statement.ĮLSE statements are considered a type of Action that will run an alternate action if a Check fails. You may use multiple OR statements within a single Method Number. It reduces the need to create multiple separate methods for Checks that would use the same Action. OR statements are a type of check that allows you to check for multiple possibilities for an Action to run. Alternatively, you make access another option menu that contains different options by selecting “Script” on the top left corner of the GUI, then going to “Edit”. If you right click anywhere on your code, you will see a menu appear that has a lot more options for you to use. If you do not check this box, you will not be able to drag and drop Checks or Actions. To edit a script, make sure you select the “Rearrange” checkbox on the bottom left corner of the GUI. If not, the script will not save properly. Remember, you may always add/edit/delete a line in case you need to. but you still have to ensure that Method Numbers go in ascending order. etc) even though it is good practice to make them. When adding a method, you don't have to worry about Method Numbers going in exact chronological order (,. All you need to do is remember that every Action needs its own unique Method Number. You may edit a line's Method Number by right clicking and selecting, "Edit Method Number ". The script will automatically try to guess the Method Number, but this is not always accurate. When editing a script, make sure you are setting the Method Number accordingly. How may I edit a script with Method Numbers? The script should automatically make the next line following the Action a new Method Number, 1. The script makes sure that the inventory is not full, and that the RS2Object (a Tree in this case) exists before trying to interact with it. Notice all three lines contain ‘’, which states that the Method number for the following example is 0. In the example there are two checks present, and a single action. A simple example may be seen below on the proper way to setup a script with Checks and Actions. You may put multiple Actions within a single Method Number, however the script will loop through ALL Checks prior to running any Actions, so you may not do something like: Check, Check, Action, Check, Action in a single Method Number, because it would actually read as: Check, Check, Check, Action, Action. If any of the Checks fail for a specific Method Number, the Action(s) for that Method Number will not be performed. Checks control the function of the Action(s). You may combine multiple Checks to a single Method Number. The Method Number is unique because it connects Checks (anything that contains ‘->’ in the description) to an Action (anything that does NOT contain ‘->’ in the description). The number inside the brackets refers to the ‘Method Number’. When you add a new Check or Action to the script, you may notice something that says ‘:’ (where ‘x’ could be any number) at the beginning of the description.











How to use osbot scripts