Silicon 0 Posted August 13, 2021 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!
Neffarion 486 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); }
Silicon 0 Author 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.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.