Jump to content

Method to open bank


Articron

Recommended Posts

Apparently opening the bank is missing/broken in the current OsBot API, so I just wanted to share you guys the method.

It's HIGHLY likely you will find simliar things in released scripts.

 

 

  final int[] BANK_IDS = { 1604, 2213 };   /**     * Opens the nearby bank     * @throws InterruptedException     */    private void openBank() throws InterruptedException {        if (!client.getBank().isOpen()) {            for (int bank : BANK_IDS) {                if (canReach(script.closestObject(bank)) && closestObject(bank) != null) {                    selectEntityOption(closestObject(bank), "Bank", "Bank booth");                } else {                    //wandelenNaarBank();                    log("Can't find the bank!");                }            }        } else            log("Bank is already open");    }  
Edited by Articron
Link to comment
Share on other sites

void openBank() {        RS2Object bank = closestObject(BANK_ID);        if (bank != null && bank.getPosition().distance(client.getMyPlayer().getPosition()) <= 8) {             client.moveCameraToEntity(bank);            selectEntityOption(bank, true, "Bank");            sleep(random(1000, 1500));             if(client.getBank().isOpen()) {                state = State.BANKING;            }         } else {            log("Cannot find bank or is not close enough.");        }    }
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...