Skip to content

Instantly share code, notes, and snippets.

@phl0w
Created June 18, 2012 13:09
Show Gist options
  • Select an option

  • Save phl0w/2948287 to your computer and use it in GitHub Desktop.

Select an option

Save phl0w/2948287 to your computer and use it in GitHub Desktop.
private class Banking extends Strategy implements Task {
@Override
public boolean validate() {
return (Inventory.getCount(primary) == 0 || Inventory
.getCount(secondary) == 0)
&& guiInitialized
&& !Bank.isOpen();
}
@Override
public void run() {
Bank.open();
Mouse.hop(
Widgets.get(Bank.WIDGET_BANK,
Bank.WIDGET_BUTTON_DEPOSIT_INVENTORY)
.getAbsoluteX(),
Widgets.get(Bank.WIDGET_BANK,
Bank.WIDGET_BUTTON_DEPOSIT_INVENTORY)
.getAbsoluteY());
Mouse.click(true);
if (primary == 15309 && secondary == 15313) { // Overloads
Bank.withdraw(primary, 4);
Bank.withdraw(secondary, 4);
Bank.withdraw(15317, 4);
Bank.withdraw(15321, 4);
Bank.withdraw(15325, 4);
Bank.withdraw(269, 4);
}
Bank.withdraw(primary, primary == 169 ? 0 : 14);
if (secondary != 12539) {
Bank.withdraw(secondary, 14);
}
Time.sleep(800, 1000);
Mouse.hop(
Widgets.get(Bank.WIDGET_BANK, Bank.WIDGET_BUTTON_CLOSE_BANK)
.getAbsoluteX(),
Widgets.get(Bank.WIDGET_BANK, Bank.WIDGET_BUTTON_CLOSE_BANK)
.getAbsoluteY());
Mouse.click(true);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment