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
  • Try asking for help in the chatbox
  • Help with the Banking process :) Thank you


    NoLifeLogo1
     Share

    Recommended Posts

    I am having a problem with this script and I am wondering if someone could help me. 

    what is happening is. I am using the if (!getLocalPlayer().isMoving()) to trigger walking back to the trees. until the location contains the local player. What is happening by using this is every time I move to another tree it triggers the (!getLocalPlayer().isMoving()) and moves the player back to the Location I run back to from the bank. 

     

    I am trying to find a better way to trigger the If statement to start the process of running back to the trees. I am new so if there is any other advice someone could let me know it would be appreciated.

     

     

    @Override
    public int onLoop() {
    
        GameObject Tree = null;
        if (getInventory().isFull()) {
            getWalking().walk(Banking.getRandomTile());
            if (getInventory().isFull() && Banking.contains(getLocalPlayer()))
                getBank().open();
            sleep(300, 500);
            getBank().depositAll("Yew logs");
            sleep(300, 500);
            getBank().close();
    
        } else
            if (!getLocalPlayer().isMoving()) {
            getWalking().walk(Cutting.getRandomTile());
            sleepUntil(() -> Cutting.contains(getLocalPlayer()), 5000);
        } else
            {
            Tree = getGameObjects().closest("Yew");
            if (Tree != null) {
                Tree.interact("Chop down");
                sleep(800, 5000);
                sleepUntil(() -> !getLocalPlayer().isAnimating(), 50000);
            }
    
    }
    
        return 300;
    }
    

     

     

     

    Link to comment
    Share on other sites

    With all due respect, not aiming to be a jack ass, you should look in to basic java usage and order of operations brother, the logic is scuffed and understandably not working for that exact reason.

    Link to comment
    Share on other sites

    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
     Share

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