Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public boolean withdrawItem(String itemName, int count) {
- if (!isOpen()) {
- Console.writeLine(this, "Bank is not open. Can't withdraw item: " + itemName + ".");
- return false;
- }
- if (!contains(itemName)) {
- Console.writeLine(this, "Bank don't contain item: " + itemName + ".");
- }
- if (getOpenedTab() != BANK_TAB_ALL) {
- setBankTab(BANK_TAB_ALL);
- }
- Interface item = getItem(itemName);
- if (item == null) {
- return false;
- }
- scrollTo(item);
- if (!isItemClickable(item)) {
- return false;
- }
- if (count < -1) {
- throw new IllegalArgumentException("Can't withdraw less than 1");
- }
- if (count == MENU_ALL) {
- return item.doAction("Withdraw-All");
- } else if (count == MENU_ALL_BUT_ONE) {
- return item.doAction("Withdraw-All but one");
- } else {
- if (item.doAction("Withdraw-" + count)) {
- return true;
- } else {
- item.doAction("Withdraw-X");
- for (int i = 0; i < 10; i++) {
- getMethods().sleep(700, 1400);
- if (botEnv.interfaces.interfaceGroupExists(752)) {
- getMethods().sendText("" + count, true);
- return true;
- }
- }
- return false;
- }
- }
- }
Add Comment
Please, Sign In to add comment