logic0671 0 Share 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"); } Link to comment Share on other sites More sharing options...
RetroBot 35 Share Posted June 10, 2020 Is the log message inside of a loop? Link to comment Share on other sites More sharing options...
logic0671 0 Author Share Posted June 10, 2020 Yes. Link to comment Share on other sites More sharing options...
Neffarion 485 Share Posted June 11, 2020 Show the code of the script Link to comment Share on other sites More sharing options...
logic0671 0 Author Share Posted June 11, 2020 Code added. Link to comment Share on other sites More sharing options...
Neffarion 485 Share 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? Link to comment Share on other sites More sharing options...
logic0671 0 Author Share 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? Link to comment Share on other sites More sharing options...
Neffarion 485 Share 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 Link to comment Share on other sites More sharing options...
logic0671 0 Author Share 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. Link to comment Share on other sites More sharing options...
moneymilker 1 Share 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 Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.