Silicon 0 Share Posted August 13, 2021 (edited) 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 August 13, 2021 by Silicon Link to comment Share on other sites More sharing options...
Neffarion 469 Share Posted August 13, 2021 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 More sharing options...
Silicon 0 Author Share Posted August 14, 2021 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now