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

    Recommended Posts

    Posted

    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());

    }

    Posted (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 by red20
    Posted
    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!!!

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