Advertisement
Guest User

Untitled

a guest
Jul 11th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. public static void openBankNpc(String npcName) {
  2.  
  3.  
  4. Npc bankNpc = Npcs.getNearest(npcName);
  5. if (bankNpc != null) {
  6. Time.sleep(MiscApi.randnum(20) + 100);
  7. if (bankNpc.interact("Bank")) {
  8. Time.sleepUntil(() -> (Bank.isOpen()), 5000 + MiscApi.randnum(500));
  9. System.out.println("Interacting with Banker NPC");
  10. }
  11. }
  12. }
  13.  
  14. public static void openBankObject(String objectName) {
  15.  
  16. SceneObject bankObject = SceneObjects.getNearest(objectName);
  17. if (bankObject != null) {
  18. Time.sleep(MiscApi.randnum(20) + 100);
  19. if (bankObject.interact("Bank")) {
  20. Time.sleepUntil(() -> (Bank.isOpen()), 5000 + MiscApi.randnum(500));
  21. System.out.println("Interacting with Bank Object");
  22. }
  23. }
  24. }
  25.  
  26. public static void withdraw(String itemName, int quantity) {
  27.  
  28. if (Bank.isOpen() && Bank.contains(itemName) && (quantity < Bank.getCount(itemName))) {
  29. Time.sleep(MiscApi.randnum(20) + 100);
  30. if (!(quantity < Inventory.getCount(itemName))) {
  31. Bank.withdraw(itemName, quantity);
  32. }
  33. Time.sleepUntil(() -> !(quantity < Inventory.getCount(itemName)), 5000 + MiscApi.randnum(500));
  34. System.out.println("Withdrawing items");
  35. } else if (!Bank.contains(itemName) || !(quantity < Bank.getCount(itemName))) {
  36. Time.sleep(500000000);
  37. System.out.println("Perma sleep");
  38. }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement