Exemplo n.º 1
0
 private ConstructionState getState() throws InterruptedException {
   return ((theTabs.Equipment.isUsingWeapon(Constants.AIR_SUPPORTED_STAFF)
               ? theTabs.Inventory.countStackOf("Earth rune") > 0
               : theTabs.Inventory.countStackOf("Air rune") > 0))
           && theTabs.Inventory.count("Law rune") > 0
           && theTabs.Inventory.count(hammerCondition) > 0
           && theTabs.Inventory.count(Constants.OAK_PLANK) >= 8
       ? ConstructionState.BUILD
       : ConstructionState.BANK;
 }
Exemplo n.º 2
0
 private void bank() throws InterruptedException {
   if (!Constants.EDGEVILLE_LOCATION.isInZone(getLocation())) {
     if (theTabs.Equipment.isWearing(Constants.AMULET_OF_GLORY)) {
       if (!theTabs.Equipment.isSelected()) {
         theTabs.Equipment.key();
       }
       EquipmentReflectionItemSlot gloryAmulet = null;
       for (EquipmentReflectionItemSlot slot : theTabs.Equipment.SLOTS2) {
         if (slot != null && Constants.AMULET_OF_GLORY.valid(slot.getItem())) {
           gloryAmulet = slot;
           break;
         }
       }
       if (gloryAmulet != null) {
         status = "Teleporting to Edgeville";
         gloryAmulet.mouseClickRightOn();
         theMenuFinder.doMenuContains("Edgeville");
         for (Timer t = new Timer(10000);
             t.isNotUp() && Utilities.isPlayerInsidePOH();
             sleep(200, 300)) ;
         // sleep(750, 800);
         /*
          * if
          * (!theTabs.Equipment.isWearing(Constants.AMULET_OF_GLORY)
          * && theTabs.Equipment.isWearing(" of glory")) { for
          * (EquipmentReflectionItemSlot slot :
          * theTabs.Equipment.SLOTS2) { if (slot != null &&
          * Constants.AMULET_OF_GLORY_NO_CHARGES
          * .valid(slot.getItem())) { gloryAmulet = slot; break; } }
          * if (gloryAmulet != null) {
          * gloryAmulet.mouseClickLeftOn(); } }
          */
       }
     } else {
       PhysicalObject portal = Utilities.findPhysicalObject(Constants.PORTAL_IDS);
       if (portal != null) {
         RulerScriptUtils.clickWorldObject(this, null, portal, null, null, null, null);
         for (Timer t = new Timer(4000);
             !Utilities.isPlayerInsidePOH() && t.isNotUp();
             sleep(200, 300)) ;
       }
     }
   }
   status = "Opening bank interface";
   BankInterface.open();
   int emptySlots = theTabs.Inventory.countEmptySlots();
   if (emptySlots < 24) {
     status = "Depositng junk items";
     HashMap<Integer, String> depositedItems = new HashMap<Integer, String>();
     for (InventoryReflectionItemSlot item : theTabs.Inventory.SLOTS) {
       if (item != null && item.isItemInSlot()) {
         String itemName = null;
         if ((itemName = item.getItemName()) != null
             && !Constants.CRUCIAL_ITEMS.validItem(itemName)
             && !depositedItems.containsKey(item.getId())) {
           depositedItems.put(item.getId(), itemName);
           BankInterface.depositBankObject(null, itemName, -1);
         }
       }
     }
   }
   if (theTabs.Equipment.isUsingWeapon(Constants.AIR_SUPPORTED_STAFF)
       && theTabs.Inventory.countStackOf("Earth rune") <= 0) {
     BankInterface.withdrawBankObject(null, "Earth rune", -1);
   } else if (theTabs.Equipment.isUsingWeapon(Constants.EARTH_SUPPORTED_STAFF)
       && theTabs.Inventory.countStackOf("Air rune") <= 0) {
     BankInterface.withdrawBankObject(null, "Air rune", -1);
   }
   if (theTabs.Inventory.countStackOf("Law rune") <= 0) {
     BankInterface.withdrawBankObject(null, "Law rune", -1);
   }
   if (!theTabs.Equipment.isWearing(Constants.AMULET_OF_GLORY)) {
     if (emptySlots == 0) {
       BankInterface.depositBankObject(Constants.OAK_PLANK, "Oak plank", 1);
     }
     status = "Withdrawing charged glory amulet";
     BankInterface.withdrawBankObject(Constants.AMULET_OF_GLORY, "Amulet of glory (", 1);
     for (Timer t = new Timer(4000);
         t.isNotUp() && theTabs.Inventory.count(Constants.AMULET_OF_GLORY) <= 0;
         sleep(200, 300)) ;
     if (theTabs.Inventory.count(Constants.AMULET_OF_GLORY) > 0) {
       status = "Equipping glory amulet";
       theTabs.Inventory.doAction(Constants.AMULET_OF_GLORY, "Wear", 1, false);
       for (Timer t = new Timer(5000);
           t.isNotUp() && theTabs.Inventory.count(Constants.AMULET_OF_GLORY_NO_CHARGES) <= 0;
           sleep(200, 300)) ;
       if (theTabs.Inventory.count(Constants.AMULET_OF_GLORY_NO_CHARGES) > 0) {
         BankInterface.depositBankObject(Constants.AMULET_OF_GLORY_NO_CHARGES, null, -1);
       }
     }
   }
   if (theTabs.Inventory.count(hammerCondition) <= 0) {
     status = "Withdrawing new hammer";
     BankInterface.withdrawBankObject(hammerCondition, "ammer", 1);
   }
   status = "Withdrawing oak planks";
   BankInterface.withdrawBankObject(Constants.OAK_PLANK, "Oak plank", -1);
   status = "Exiting bank interface";
   BankInterface.exitBank();
   botState = ConstructionState.BUILD;
 }