Rsbot Scripting: Tutorial Four – Fill in The Blanks
Fill in the last couple variables and your first script will be almost complete!
BTOdell’s Tutorial Index
- <<<Getting Started<<<
- <<Starting your Script<<
- <Script Backbone< (Previous)
- *Fill in the Blanks*
- >Making your Script User Friendly> (Next)
Now that you have the “engine” or “backbone” of your script built, it is time for you to add some finishing touches to make it all work.
Firstly, write the following code out:
Since onStart() is a boolean; it must return true or false. In this case, returning false will stop the script. The confusing argument will not be used, but is required to be there.
Secondly, when the script we need to save your players location for walking, and get the nearest rock so we can mine it later. To do this; add the following code:
This code will save your player’s location, then getting the nearest object named “Rock”. Now the only variable that hasn’t been accounted for is the bankTile which must be calculated by yourself using RSBot’s player location debugging.
Another method to add would be the onFinish() void; although rather a pointless method for basic scripts, it can still be used to give your user a friendly thank you when they finish using your script.
This script will now work. I am not saying your script will be flawlessly; you will have to add more fail safes, explore different methods and expand your knowledge on how to use Java in the most efficient fashion.