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
  • Kind of fixed


    klongrich
     Share

    Recommended Posts

    this fixed it but looks horrible

    private void ExchangeCowhides(){
        if (!GrandexchangeLocation.contains(getLocalPlayer())) {
            getWalking().walk(GrandexchangeLocation.getRandomTile());
        } else {
    
            exchangComplete = false;
    
            while(!exchangComplete) {
                if (getInventory().contains("Hard leather"))
                    sellCowhides();
                else {
                    buyCowhides();
                    exchangComplete = true;
                }
            }
        }
    }
    Link to comment
    Share on other sites

    Good Job!

    But why are you looping a boolean inside the onLoop?

    You could just add 

    && exchangComplete == false

    inside the if statement, then it'll check that condition each time the onLoop loops depending on the time you set in the return statement in the onLoop.

    and yeah, always check if the walker should walk to avoid spammy map clicking.

    Other than that, Congrats on getting it to work!

    Link to comment
    Share on other sites

    Ohh It was just habit. We had a norm which was like rules to the way we write code so we could all read it quicker and we couldn't define things in constructors. Would be a simpler way though. I just ended up doing this instead. 

    private void ExchangeCowhides(){
        if (!GrandexchangeLocation.contains(getLocalPlayer())) {
            getWalking().walk(GrandexchangeLocation.getRandomTile());
        } else {
            sleepUntil(() -> !sellHardLeather(), 10000);
            buyCowhides();
        }
    }

     

    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.