Articron Posted May 1, 2013 Posted May 1, 2013 (edited) 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 May 1, 2013 by Articron
Peter Posted May 1, 2013 Posted May 1, 2013 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."); } }
Aeterna Posted May 1, 2013 Posted May 1, 2013 lol if it's "broken or missing in the api" how are you using the api to do it? this is the api...
danieljvdm Posted May 2, 2013 Posted May 2, 2013 lol if it's "broken or missing in the api" how are you using the api to do it? this is the api... Are you being serious?
danieljvdm Posted May 2, 2013 Posted May 2, 2013 By the way OP, nothing is broken or missing... the bank class involves interacting with an open bank. Selectentityoption is just one line of code that opens the bank. Doesn't really get simpler.
Aeterna Posted May 2, 2013 Posted May 2, 2013 i read it as "the api is broken and this is my work around"