brave 29 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?
Bonfire 334 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".
brave 29 Author 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
Recommended Posts
Archived
This topic is now archived and is closed to further replies.