Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • getGameState not working properly


    brave

    Recommended Posts

    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

    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

    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

    Archived

    This topic is now archived and is closed to further replies.

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.