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
  • Bank Withdraw Method doesn't work


    badramen

    Recommended Posts

    Bank.withdraw(String, int) - to withdraw a particular quantity of item doesn't work

    It simply right clicks, withdraw-X and then carries on with the next line of code

    For example:

    Bank.withdraw("Teleport to house", 100)
    

    Pretty crucial part of the API - what am I doing wrong? It is exactly as per the docs.

    Also to be clear - Bank.withdrawAll works, and Bank.withdraw(String) works (with quantity of 1) just not withdraw with qty specified

     
    Link to comment
    Share on other sites

    1 hour ago, fallacy87 said:
    Bank.close();
    sleepUntil(()->!Bank.isOpen(),1000,1);

     

    Nope.

    How could something so simple and essential simply not work straight out of the box?

    Link to comment
    Share on other sites

    Quote

    if(Bank.isOpen()){
        log("Bank is open");
        if(Bank.close()){
             log("Closing bank");
        }
    }

    High level example. Add some log statements into your code and see what's being executed. If your log statement isn't executed, that section of code isn't being read.

    Link to comment
    Share on other sites

    1 hour ago, badramen said:

    I'm running this in the onStart script btw. Does it simply not work in that loop..?

    there are 2 methods for onStart, if it is 

        @Override
        public void onStart(String... params) {
            super.onStart(params);
        }

    then you are using the onstart with parameters and isn't firing. If you are using the one without onStart(String...params) then it is only going to fire 1 time, at the start of the script. You should read the API documentation on these to get a better understanding of what you are doing in your code. Put it in the loop and give it some conditions to detect it like Smokeyjay posted above.

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