September 27, 20178 yr This bug only happens when I have my own login handler implemented. I start the bot with -allow norandoms. The script functions flawlessly for some time, but after a while they all hang on logout screen. This is my onLoop method: @Override public int onLoop() { if (this.lastLoopPrint <= 0 || System.currentTimeMillis() - this.lastLoopPrint >= 10000) { this.lastLoopPrint = System.currentTimeMillis(); log("Printing in loop"); } handleState(getState()); return random(300, 800); } "Printing in loop" isn't called on the bots that have hung on logout. This means that onLoop is not being called. Why would this be happening? Is this a bot bug?
September 27, 20178 yr You might wanna show your other code as well. It's probably stuck in a loop or sleep.
September 27, 20178 yr Author 8 minutes ago, The Undefeated said: You might wanna show your other code as well. It's probably stuck in a loop or sleep. doesn't on loop take priority? I don't have any infinite sleeps... it should be printing no matter what?
September 27, 20178 yr 32 minutes ago, scape said: doesn't on loop take priority? I don't have any infinite sleeps... it should be printing no matter what? Not if there's an issue with a getState, it'll get stuck there.
September 27, 20178 yr Some functions like walking wait till they're finished being executed before letting the rest of your code run again, what's probably happening is that you get logged out during an operation like this and so your login handler never gets to start running again. Add break conditions to your code for when the client isn't logged in.
September 27, 20178 yr Author 21 minutes ago, HeyImJamie said: Not if there's an issue with a getState, it'll get stuck there. 10 minutes ago, d0zza said: Some functions like walking wait till they're finished being executed before letting the rest of your code run again, what's probably happening is that you get logged out during an operation like this and so your login handler never gets to start running again. Add break conditions to your code for when the client isn't logged in. I have a check in getState() that returns state LOGIN if not logged in at the very topic before anything is executed. How would I break out of an event such as web walking that would be taking too long?
September 27, 20178 yr 1 minute ago, scape said: I have a check in getState() that returns state LOGIN if not logged in at the very topic before anything is executed. How would I break out of an event such as web walking that would be taking too long? Your check in getState() does not matter if it is not being run, like I said above. For web walking read through this guide by Team Cape Otherwise add !getClient().isLoggedIn() as a break condition to your conditional sleeps and wherever else you feel necessary.
Create an account or sign in to comment