How to make a perfect script (Planning stage of Development)
Everyone wants to make a perfectly running script, in the minimal amount of time. That will run endless without anything stopping it. But theres always PROBLEMS when you begin making your Mr Perfecto scripts.
There are many stages of making a script, but the most important one, that we will take a look at today is:
- Planning
Planning/Options
Planning is easily on the most important stage of script development, in this stage you will need to plan out all the steps in which the script will undertake. If you can create a mind map of what you want your script to exactly be doing, without a doubt you will be able to script and create that script with minimal errors, and if you do have errors. You will easily be able to know where the problem lies and can work to fix it from there. If a script is poorly layed out, it takes hours to get it cleaned and fixed up so it all works correctly! so why not just do it right the first time and save yourself the trouble later!
In this example im aiming to make the script do the following:
- Check if Glory/Duel Ring is currently wielded
- Teleport to Karamja
- Pick bananas off the trees
- Teleport to Castle Wars via Duel Ring
- Bank
- Repeat
It may sound simple this way, but you need to think further ahead, with all the other little details that need to be payed attention too!
When creating your script, you have to think beyond what you want your script to achieve, and think of the smaller details of what will you do if this or that function fails? A major part of planning your script includes planning your FAILSAFES! in the picture above, I have minimal failsafes covering my functions. For example teleporting to Karamja, What if the script misclicked the teleport to Karajma button, or it did click but took longer then normal to load the new location? You need to have something built in the script to cover these fails. With failsafes, to be completely safe I advise using a failsafe, within another failsafe in case the failsafe decides its not going to work out, you need something too boot your account off to save it from attempting things multiple times, deeming you as a stupid bot. Bellow I have structured a semi failsafed outline of my script.
How the script should be displayed on a Mind map:
Here in this mind map we have a more structured, failsafed mindmap, Its not completely failsafed but it has the just to it to help you understand WHY YOU NEED TO have these systems in place in order to have your script running for a long time!
So why is Planning so important?
- It gives you a set of things to work off, so you dont miss things
- When scripts get large, having a great structure helps eliminate any bugs!
- Cleaner script, as you know the functions/procedures you need!
- Fail proofing your script, you can work backwards when your complete, to see if you met the standards of your plan!