obrandso Posted March 29, 2020 Posted March 29, 2020 (edited) So i need some help since my bot just stands still and i get "error in script executor" in the logger. this is my first time scripting, so trying to learn it all. Appreciate if the help can be in my "noob level" of understanding! This is the code.... Edited March 29, 2020 by obrandso
Gunman Posted March 29, 2020 Posted March 29, 2020 @obrandso The script will forever be stuck in the first if statement if you don't have law runes.
obrandso Posted March 29, 2020 Author Posted March 29, 2020 5 hours ago, Gunman said: @obrandso The script will forever be stuck in the first if statement if you don't have law runes. Can i put in the first if statement like this.. if (!getInventory().contains("Law rune")) { getwalking.webwalk(bankArea); if (!bankArea.contains(myPOS)) { getWalking().webWalk(bankArea); } or how do i resolve this?
Gunman Posted March 29, 2020 Posted March 29, 2020 if (!getInventory().contains("Law rune")) { if (!bankArea.contains(myPOS)) { getWalking().webWalk(bankArea); } } !getInventory().contains("Law rune") <- if this returns true it will forever return true. Since it always returns true it will forever loop the code above^ Just move the banking stuff after the bank area check would probably fix this. Avoid using static sleeps when you can. Static being sleep(1000); or sleep(random (1000, 2000)); <- both are what I consider static. Another thing why is your onloop returning hopTo which is == -1? Change it to return like 500 or something.
obrandso Posted March 29, 2020 Author Posted March 29, 2020 (edited) 2 hours ago, Gunman said: if (!getInventory().contains("Law rune")) { if (!bankArea.contains(myPOS)) { getWalking().webWalk(bankArea); } } !getInventory().contains("Law rune") <- if this returns true it will forever return true. Since it always returns true it will forever loop the code above^ Just move the banking stuff after the bank area check would probably fix this. Avoid using static sleeps when you can. Static being sleep(1000); or sleep(random (1000, 2000)); <- both are what I consider static. Another thing why is your onloop returning hopTo which is == -1? Change it to return like 500 or something. So conditionalsleep better than static sleep? if i change it to this code only, it would read the code under it if it returns false right? and if true, it will keep looping the statement until i get to the bankArea? but will it work like this then? if (!getInventory().contains("Law rune")) { getWalking().webWalk(bankArea); } if (bankArea.contains(myPOS)) { getBank().open(); i wrote the code at night so i was a bit flumsy. I will change the return value... EDIT: nvm i fixed it! thanks! Edited March 29, 2020 by obrandso 1