One of the biggest tips I can give is to limit the amount of things you do in a loop to 1. Do 1 interaction and let the loop finish and the next loop check what the next things is to do
Don't chain multiple interactions in a row.
For example for withdrawing something from the bank.
BAD
onLoop(){
openbank();
depositInventory()
withdrawItem();
closeBank()
}
GOOD
onLoop(){
if(bank.isOpen()){
if(inventory.isEmpty()){
withdrawitem();
}else{
depositInventory();
}
}else{
openBank();
}
}
1. Don't use any loops (for, while, etc) - all looping should be in the main osbot loop in the main class
Loops are powerfull, I use them all the time and you will need them. You just need to know when to break a loop.
Just don't use loops to execute anything, because that will cause issues.
2. Use if/then, not case statements
I usually prefer to put them in an enum and loop over the enum instead of using a switch
3. Keep all conditions in the main loop
Not sure what you mean by this, but you should only be using the onLoop to execute code that interacts with the game.
4. If your use-case is RAM and CPU sensitive, use path walk, not webwalk
True, but only if it's possible. If you have a clue scroll solver, you don't want to make 5000 paths ^^
5. Do not use recursion. Java is not designed for recursion. If you must use recursion clojure should work in theory
Ya fuck that. in most of the cases recursion isn't very readable anyway.
I don't see a point in using that ^^
6. The beginning of any action should be evaluated and started from the main osbot loop
You should only use the onLoop to execute code that interacts with the game and always use an IF to check if it was executed.