combat_acc Posted November 26, 2016 Share Posted November 26, 2016 (edited) how to withraw as note if (getBank().contains("Shortbow")){ enableMode(Bank.BankMode.WITHDRAW_NOTE); if (getBank().getWithdrawMode() == Bank.BankMode.WITHDRAW_NOTE); getBank().withdrawAll("Shortbow"); sleep(random(2000, 3000)); Edited November 26, 2016 by combat_acc Quote Link to comment Share on other sites More sharing options...
Lewis Posted November 26, 2016 Share Posted November 26, 2016 (edited) if (!getBank().getWithdrawMode().equals(BankMode.WITHDRAW_NOTE)) getBank().enableMode(BankMode.WITHDRAW_NOTE); Edited November 26, 2016 by Lewis Quote Link to comment Share on other sites More sharing options...
PlagueDoctor Posted November 26, 2016 Share Posted November 26, 2016 (edited) getBank().enableMode(Bank.BankMode.WITHDRAW_NOTE); new ConditionalSleep(10000) { @[member='Override'] public boolean condition() throws InterruptedException { return getBank().getWithdrawMode() == Bank.BankMode.WITHDRAW_NOTE; } }.sleep(); getBank().withdrawAll("Shortbow"); new ConditionalSleep(10000) { @[member='Override'] public boolean condition() throws InterruptedException { return !getBank().contains("Shortbow"); } }.sleep(); Here, this should work. Rather than having a random sleep after withdrawing, try using a conditional sleep. This will make it so it only sleeps as long as it needs to. EDIT: Encapsulate the bankmode stuff into an if statement as shown in Lewis's reply. Edited November 26, 2016 by PlagueDoctor Quote Link to comment Share on other sites More sharing options...
Lewis Posted November 26, 2016 Share Posted November 26, 2016 (edited) like so: (feel free to correct me) final String BANK_BOOTH = "Banker"; NPC bankbooth = npcs.closest(BANK_BOOTH); if (!bank.isOpen()) { bankbooth.interact("Bank"); new ConditionalSleep(10000) { @[member='Override'] public boolean condition() throws InterruptedException { return bank.isOpen(); } }.sleep(); } else if (bank.isOpen()) { if (!getBank().getWithdrawMode().equals(BankMode.WITHDRAW_NOTE)) { getBank().enableMode(BankMode.WITHDRAW_NOTE); new ConditionalSleep(10000) { @[member='Override'] public boolean condition() throws InterruptedException { return getBank().getWithdrawMode().equals(BankMode.WITHDRAW_NOTE); } }.sleep(); } else if (bank.contains("Shortbow") && getBank().getWithdrawMode().equals(BankMode.WITHDRAW_NOTE)) { bank.withdraw("Shortbow", AMOUNT); new ConditionalSleep(10000) { @[member='Override'] public boolean condition() throws InterruptedException { return inventory.contains("Shortbow"); } }.sleep(); } } Edited November 26, 2016 by Lewis Quote Link to comment Share on other sites More sharing options...