logic0671 0 Posted June 10, 2020 EDIT: I removed all while loops from my script that weren't completely necessary. This fixed my problem! Basically a log message continuously repeated like 5 mins after I stopped a script. Even when I straight up closed the tab it kept going until I exited-out of the entire client. Area fightAreaExit = new Area(2691, 3286, 2700, 3278, 0); while (!fightAreaExit.contains(getLocalPlayer())) { log("Line 81"); exit.interact("Climb-up"); }
Neffarion 486 Posted June 11, 2020 49 minutes ago, logic0671 said: Code added. Your mistake is using the while loop in a script. You shouldn't be using it because the script only stops after finishing the current loop on your onLoop (which never does if you use a loop inside of it) The script already loops on the onLoop function, why are you using another loop inside it?
logic0671 0 Author Posted June 11, 2020 Ok, I understand. So nobody ever uses while loops inside of DB scripts? Also, do you have a suggestion of how I can re-write it?
Neffarion 486 Posted June 11, 2020 2 hours ago, logic0671 said: Ok, I understand. So nobody ever uses while loops inside of DB scripts? Also, do you have a suggestion of how I can re-write it? Its generally good practice to not use loops unless you absolutely need them If that code is all you have in the onLoop then you can just replace the while with an if
logic0671 0 Author Posted June 11, 2020 Ok, I removed all while loops from my script that weren't completely necessary. This fixed my problem! Thank you Neffarion.
moneymilker 1 Posted June 17, 2020 I've used them in a few occasions Like While(inv is full) { Dont you start before you banked it } kinda ugly but helped my script a lot
Recommended Posts
Archived
This topic is now archived and is closed to further replies.