Guest User

Untitled

a guest
Jun 22nd, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. public boolean withdrawItem(String itemName, int count) {
  2. if (!isOpen()) {
  3. Console.writeLine(this, "Bank is not open. Can't withdraw item: " + itemName + ".");
  4. return false;
  5. }
  6. if (!contains(itemName)) {
  7. Console.writeLine(this, "Bank don't contain item: " + itemName + ".");
  8. }
  9.  
  10. if (getOpenedTab() != BANK_TAB_ALL) {
  11. setBankTab(BANK_TAB_ALL);
  12. }
  13.  
  14. Interface item = getItem(itemName);
  15. if (item == null) {
  16. return false;
  17. }
  18. scrollTo(item);
  19. if (!isItemClickable(item)) {
  20. return false;
  21. }
  22.  
  23. if (count < -1) {
  24. throw new IllegalArgumentException("Can't withdraw less than 1");
  25. }
  26.  
  27. if (count == MENU_ALL) {
  28. return item.doAction("Withdraw-All");
  29. } else if (count == MENU_ALL_BUT_ONE) {
  30. return item.doAction("Withdraw-All but one");
  31. } else {
  32. if (item.doAction("Withdraw-" + count)) {
  33. return true;
  34. } else {
  35. item.doAction("Withdraw-X");
  36. for (int i = 0; i < 10; i++) {
  37. getMethods().sleep(700, 1400);
  38. if (botEnv.interfaces.interfaceGroupExists(752)) {
  39. getMethods().sendText("" + count, true);
  40. return true;
  41. }
  42.  
  43. }
  44. return false;
  45. }
  46. }
  47.  
  48. }
Add Comment
Please, Sign In to add comment