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
  • Player woodcutting animation and wait till the animation is done


    Kirito

    Recommended Posts

    Checking animation is not reliable as there are sometimes frames where the player will be performing an action but not animating.

     

    More reliable checks for when you won't be chopping would be waiting until the tree doesn't exist or being in a dialogue (waiting for either).

    Link to comment
    Share on other sites

    Checking animation is not reliable as there are sometimes frames where the player will be performing an action but not animating.

     

    More reliable checks for when you won't be chopping would be waiting until the tree doesn't exist or being in a dialogue (waiting for either).

    :) for now that part is working as i wanted it :D, but the problem now is it clicks a tree then notices that there is a log in the inventory and while it is copping it drops the log while it has to wait till the inventory is completly full :/

    Link to comment
    Share on other sites

    Instead of checking if inventory is not empty you should check if inventory is full.

     

    if (!getInventory().isFull()) {
    log("Status: Dropping all logs");
    getInventory().dropAll("Logs");
    }

     

    The if statement there should not have that not(!). It should be.

    if (getInventory().isFull())
    Link to comment
    Share on other sites

     

    Instead of checking if inventory is not empty you should check if inventory is full.

     

     

    The if statement there should not have that not(!). It should be.

    if (getInventory().isFull())

    hmm ok i changed it but now if there is a log in the inventory it dosn't do anything except for just standing there lol

     

     

     

    @Override
    public int onLoop() {
    switch (getState()) {
    case CHOP:
    GameObject tree = getGameObjects().closest("Tree");
    if (tree != null && getLocalPlayer().isStandingStill()) {
    log("Status: Chopping that tree");
    tree.interact("Chop Down");
    return Calculations.random(500, 600);
    }
    case DROP:
    if (getInventory().isFull()){
    log("Status: Dropping all logs");
    getInventory().dropAll("Logs");
    return Calculations.random(500, 600);
    }
    break;
    case WAIT:
    log("Status: Sleeping till we are done chopping!");
    sleep(Calculations.random(500, 600));
    break;
    }
    return Calculations.random(500, 600);
    }
    }
    Link to comment
    Share on other sites

    Thats cause you also need to change your state conditions

     

    private State getState() {
    GameObject tree = getGameObjects().closest("Tree");
    if (!getInventory().isEmpty())
    return State.DROP;
    if (tree != null)
    return State.CHOP;
    return State.WAIT;
    }

     

    the

    if (!getInventory().isEmpty())
    return State.DROP;

    should be

    if (getInventory().isFull())
    return State.DROP;

    You should look at the open source woodcutting scripts and analyze them. Probably the best way to learn.

    Try looking at Diddy's Powerchop

    https://dreambot.org/forums/index.php/topic/3077-powerchop/

    http://pastebin.com/WZEp2kvD

    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.