Tezlaz

BankClay

Aug 6th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.39 KB | None | 0 0
  1. package scripts.tasks;
  2.  
  3. import org.tribot.api.General;
  4. import org.tribot.api.Timing;
  5. import org.tribot.api2007.Banking;
  6. import org.tribot.api2007.Equipment;
  7. import org.tribot.api2007.Equipment.SLOTS;
  8. import org.tribot.api2007.Interfaces;
  9. import org.tribot.api2007.Inventory;
  10. import org.tribot.api2007.Player;
  11. import org.tribot.api2007.Walking;
  12. import org.tribot.api2007.WebWalking;
  13. import org.tribot.api2007.types.RSItem;
  14. import org.tribot.api.types.generic.Condition;
  15. import org.tribot.api.types.generic.Filter;
  16.  
  17. import scripts.data.*;
  18. import scripts.tools.*;
  19.  
  20. public class BankClay {
  21.  
  22. // Boolean to check whether player has banked items
  23. private static boolean hasBanked;
  24.  
  25. // Finds whether player is near bank or not
  26. private static boolean IsInBank() {
  27. // Checks if the player is standing within specified area
  28. return scripts.data.Vars.VARROCK_BANK_AREA.contains(Player.getPosition());
  29. }
  30.  
  31. public static void WalkToBank() {
  32. if (!Vars.VARROCK_BANK_AREA.contains(Player.getPosition())) {
  33. System.out.println(Vars.accountName + " is walking to bank...");
  34. WebWalking.setUseRun(true);
  35. WebWalking.walkTo(Vars.VARROCK_BANK);
  36. Timing.waitCondition(Conditions.inBank, General.random(60000, 70000));
  37. }
  38. }
  39.  
  40. public static boolean IsInterfaceUp() {
  41. if (Interfaces.get(12) != null) {
  42. return true;
  43. } else {
  44. return false;
  45. }
  46. }
  47.  
  48. public static void BankItems() {
  49.  
  50. System.out.println(Vars.accountName + " is attempting to bank...");
  51.  
  52. if (IsInBank() && !Banking.isBankScreenOpen()) {
  53. Banking.openBank();
  54. Timing.waitCondition(Conditions.bankOpen, General.random(1000, 2000));
  55.  
  56. if (Banking.isBankScreenOpen()) {
  57. Banking.depositAllExcept(Vars.TOOLS);
  58. Timing.waitCondition(Conditions.bankedOres, General.random(5000, 10000));
  59.  
  60. if (Gear.IsWielding(SLOTS.WEAPON, Vars.TOOLS)) {
  61. Bank.Withdraw(1, Vars.currentPickaxe, Vars.BUCKET);
  62. General.sleep(800, 1200);
  63. if (Inventory.find(Vars.TOOLS).length > 1) {
  64. Vars.currentPickaxe = Inventory.find(Vars.PICKAXES)[0].getID();
  65. Inventory.find(Vars.PICKAXES)[0].click("Wield");
  66. System.out.println(Vars.accountName + " did not have any tools. Withdrawing tools now...");
  67. }
  68. }
  69. }
  70. }
  71. Banking.close();
  72. General.sleep(1000, 1450);
  73. if (Inventory.find(Vars.currentPickaxe).length >= 1) {
  74. Inventory.find(Vars.currentPickaxe)[0].click("Wield");
  75. }
  76. }
  77. }
Add Comment
Please, Sign In to add comment