ringworm 1 Posted November 27 In my woodcutting script, when it's walking to the bank or to the trees, it spam clicks the minimap. I used the example in the javadocs, but it's still happening. currBank just returns a bank area for example: public static Area normalTreeBankArea = new Area(3179, 3448, 3191, 3432); if (currBank.getRandomTile().distance() > 5 && Walking.shouldWalk()) { Walking.walk(currBank.getRandomTile()); }
red20 4 Posted November 27 (edited) If it spams for a while after every click and then stops spamming until shouldWalk() is true, try adding a small sleep: sleep(500, 1500); or sleep just until new click: Sleep.sleepUntil(() -> Walking.getDestination().distance() > 4, Calculations.random(1000, 2000)); You should probably also use 1 tile for both the check and the walking: Tile walkTile = currBank.getRandomTile(); if (walkTile.distance() > 5 && Walking.shouldWalk()) { Walking.walk(walkTile); Sleep.sleepUntil(() -> Walking.getDestination().distance() > 4, Calculations.random(1000, 2000)); } Edited November 27 by red20
ringworm 1 Author Posted November 27 1 hour ago, red20 said: If it spams for a while after every click and then stops spamming until shouldWalk() is true, try adding a small sleep: sleep(500, 1500); or sleep just until new click: Sleep.sleepUntil(() -> Walking.getDestination().distance() > 4, Calculations.random(1000, 2000)); You should probably also use 1 tile for both the check and the walking: Tile walkTile = currBank.getRandomTile(); if (walkTile.distance() > 5 && Walking.shouldWalk()) { Walking.walk(walkTile); Sleep.sleepUntil(() -> Walking.getDestination().distance() > 4, Calculations.random(1000, 2000)); } This fixed it!! Thank you!!! red20 1
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