brave 29 Share Posted June 5, 2021 Hello, what is the best workaround for not doing anything when the bot is busy hopping worlds? I tried the example below, but it does not always work if (Client.getGameState() == GameState.HOPPING) { log("Hopping worlds"); return 3000; } Orrr should I use something else like, sleepUntil? Link to comment Share on other sites More sharing options...
Bonfire 331 Share Posted June 5, 2021 After performing an action (such as clicking on another world to hop to it), you could sleep until the GameState is no longer HOPPING. Something like this (untested, but you get the general concept): ... Code to hop here ... MethodProvider.sleepUntil(() -> Client.getGameState() != GameState.HOPPING, [SLEEPING TIME HERE]); Note that you may need to sleep for a moment after clicking on the world to hop, as it may take a second for the hop to "begin". Link to comment Share on other sites More sharing options...
brave 29 Author Share Posted June 5, 2021 8 minutes ago, Bonfire said: After performing an action (such as clicking on another world to hop to it), you could sleep until the GameState is no longer HOPPING. Something like this (untested, but you get the general concept): ... Code to hop here ... MethodProvider.sleepUntil(() -> Client.getGameState() != GameState.HOPPING, [SLEEPING TIME HERE]); Note that you may need to sleep for a moment after clicking on the world to hop, as it may take a second for the hop to "begin". Thank you Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.