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
  • Try asking for help in the chatbox
  • sleepUntil walking not working.


    Silicon
     Share

    Recommended Posts

    Hi!

    Just started scripting. I'm a software engineer irl so I'm not having trouble with the syntax, but i'm struggling to get sleepUntil to work as I would like it.

    I'm currently getting it to work with something like this: 

                Walking.walk(closestRock.getTile());
                sleep(1000);
                sleepUntil(() -> !me.isMoving(), 3000);

    My issue is that !me.isMoving() or the alternative Walking.GetDestinationDistance() == 0 is not immediately recognising that I am walking. So, the sleepUntil ends immediately unless I have a sleep(1000). This isn't ideal as I'd like to not have any unnecessary sleeps. 

    Also, the Walking.GetDestinationDistance() never equals 0, but rather -1 but I'm guessing that has to do with Walk vs. WalkExact. 

    Any help would be appreciated!

    Edited by Silicon
    Link to comment
    Share on other sites

    4 hours ago, Silicon said:

    Hi!

    Just started scripting. I'm a software engineer irl so I'm not having trouble with the syntax, but i'm struggling to get sleepUntil to work as I would like it.

    I'm currently getting it to work with something like this: 

                Walking.walk(closestRock.getTile());
                sleep(1000);
                sleepUntil(() -> !me.isMoving(), 3000);

    My issue is that !me.isMoving() or the alternative Walking.GetDestinationDistance() == 0 is not immediately recognising that I am walking. So, the sleepUntil ends immediately unless I have a sleep(1000). This isn't ideal as I'd like to not have any unnecessary sleeps. 

    Also, the Walking.GetDestinationDistance() never equals 0, but rather -1 but I'm guessing that has to do with Walk vs. WalkExact. 

    Any help would be appreciated!

     

    Try using the following:

    if(Walking.walk(closestRock.getTile())){
      MethodProvider.sleepUntil(() -> Walking.shouldWalk(), 10000);
    }

     

    Link to comment
    Share on other sites

    15 hours ago, Neffarion said:

     

    Try using the following:

    if(Walking.walk(closestRock.getTile())){
      MethodProvider.sleepUntil(() -> Walking.shouldWalk(), 10000);
    }

     

    Thanks, I think this is working a bit better. I tried changing it to Walking.walkOnScreen() and the issue persisted so perhaps there is something wrong with that method instead? 

    I'm making a sand crabs script and ideally it should be walkOnScreen because it would look a bit suspicious clicking rocks from the minimap without being able to see them. 

    Link to comment
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
     Share

    ×
    ×
    • 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.