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
  • Looking for methods


    maxime

    Recommended Posts

    Hi i am looking for Method Depositall item in inventory and Withraw & Bank to the closest bank

    and also Looking for Npc combat methods :( 

    Thanks you.

    Link to comment
    Share on other sites


    //Simple banking case that depositsAll & withdraws items If your still trying to figure it out.
    //Goes into your banking state
    if (getBank().isOpen()) { //Checks if bank is open or not, if it is it executes the code within there.
    getBank().depositAllItems();//Deposits all your items
    sleepUntil(() -> getInventory().isEmpty(), Calculations.random(950, 1300));//Sleeps until the Inventory is open or until sleep time is over
    sleep(400,800)//Sleeps
    getBank.withdraw("Name of item" or "Item id",Number you want taken out)//Withdraws the item you want withdrawn.
    break;//Breaks

    } else { // If the Bank is open is not true then this gets executed
    getBank().open();// Opens bank
    sleepUntil(() -> getBank.isopen, Calculations.random(600, 1400));//Sleeps until bank is open or until timer is up.
    }

     

    Link to comment
    Share on other sites

    //Simple banking case that depositsAll & withdraws items If your still trying to figure it out.
    //Goes into your banking state
    if (getBank().isOpen()) { //Checks if bank is open or not, if it is it executes the code within there.
                        getBank().depositAllItems();//Deposits all your items
                        sleepUntil(() -> getInventory().isEmpty(), Calculations.random(950, 1300));//Sleeps until the Inventory is open or until sleep time is over
                        sleep(400,800)//Sleeps
                        getBank.withdraw("Name of item" or "Item id",Number you want taken out)//Withdraws the item you want withdrawn.
                        break;//Breaks
    
                    } else { // If the Bank is open is not true then this gets executed
                        getBank().open();// Opens bank
                        sleepUntil(() -> getBank.isopen, Calculations.random(600, 1400));//Sleeps until bank is open or until timer is up.
                    }
    

     

    The ideal logic should be limited to 1 action per loop. If the deposit method fails you still try to withdraw items to your full inventory. Your logic might work when you try it but when your customer uses it for multiple hours, it will eventually fail and might cause the script to not function properly.

    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.