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
  • sleepUntil walking not working.


    Silicon

    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!

    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

    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.