Jump to content

need help again..


Recommended Posts

Posted (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 by PlagueDoctor
Posted (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 by Lewis

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
  • Recently Browsing   0 members

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