Exemplo n.º 1
0
 public static void make() {
   if (Bank.isOpen()) {
     Bank.close();
   } else {
     if (Inventory.getCount(Variables.glassID) != 0) {
       Variables.status = "Crafting";
       Item glass = Inventory.getItem(Variables.glassID);
       if (Widgets.get(1371, 0).validate()) {
         if (Widgets.get(1370, 56).getText().equals(Variables.urnType)) {
           Crafting.clickStart();
           final Timer glassTimer = new Timer(60000);
           while (glassTimer.isRunning() && Inventory.getCount(Variables.glassID) != 0) {
             Task.sleep(50);
           }
         } else {
           Widgets.get(1371, 44).getChild(20).click(true);
           Task.sleep(500, 600);
           Crafting.clickStart();
           final Timer glassTimer = new Timer(60000);
           while (glassTimer.isRunning() && Inventory.getCount(Variables.glassID) != 0) {
             Task.sleep(50);
           }
         }
       } else {
         if (glass != null) {
           if (glass.getWidgetChild() != null) {
             Variables.status = "Crafting";
             glass.getWidgetChild().click(true);
             Task.sleep(800, 900);
           }
         }
       }
     }
   }
 }
Exemplo n.º 2
0
  @Override
  public void execute() {
    // TODO Auto-generated method stub
    try {
      SceneObject well = SceneEntities.getNearest(Constants.WELL_ID);
      Timer wait = new Timer(1000);
      if (!Constants.edgevillArea.contains(Players.getLocal())) {
        Teleport.teleportTo(Teleport.EDGEVILL);
      }

      if (well != null) {
        if (well.isOnScreen()) {
          if (Bank.isOpen()) Bank.close();

          if (Widgets.get(905, 14).validate()) {
            boolean isInteracted = false;
            if (Widgets.get(905, 14).getBoundingRectangle().contains(Mouse.getLocation())) {
              Mouse.click(true);
              isInteracted = true;
            } else {
              Widgets.get(905, 14).interact("Make All");
              isInteracted = true;
            }
            Task.sleep(1000);
            if (isInteracted) {
              Utilities.showDebug(
                  "Softening clays for profit of " + Progress.profitSoftening + "gp each.");
              softeningTimer.setEndIn(2500);
            }

          } else {
            if (!softeningTimer.isRunning()) {
              if (Inventory.selectItem(Constants.CLAY_ID)) {
                if (well.interact("Use")) {
                  Utilities.showDebug("Interacting well.");
                  Mouse.move(271, 475, 5, 5);
                }
              }
              wait.setEndIn(2000);
              while (wait.isRunning() && !Widgets.get(905, 14).validate()) {
                if (Players.getLocal().isMoving()) wait.setEndIn(1000);
                Task.sleep(100);
              }
            }
          }
        } else {
          Utilities.showDebug("Found well but not on screen. Walking..");

          Walking.walk(Walking.findPath(well).getEnd());
          wait.setEndIn(3000);
          while (wait.isRunning() && !well.isOnScreen()) {
            Task.sleep(300);
          }
        }
      }
    } catch (Exception e) {
    }
    ;
  }
Exemplo n.º 3
0
 private void bank() throws Exception {
   if (Bank.open()) System.out.println("opened bank");
   else {
     sleep(Times.SHORT);
     Bank.open();
   }
   sleep(Times.SHORT);
   Bank.depositInventory();
   sleep(Times.SHORT);
   Bank.close();
   sleep(Times.BANK);
 }
Exemplo n.º 4
0
 @Override
 public void execute() {
   if (Bank.isOpen()) {
     if (containsLoot(Ids.ALL_ITEMS)) {
       Log.log("depositing", "Clearing Inventory for new trip.");
       Bank.depositInventory();
     }
     if (finished()) {
       Log.log("banking", "Completed inventory. Attempting to close.");
       Bank.close();
     } else withdrawInventory();
   } else {
     Log.log("banking", "Opening bank.");
     Bank.open();
   }
 }
Exemplo n.º 5
0
  @Override
  public void execute() {
    if (Bank.open()) {
      GcSuperheater.logger.log("Opened bank.");
      for (Item i : Inventory.getItems()) {
        if (i != null && i.getId() != Runes.NATURE && i.getId() != Runes.FIRE) {
          Bank.deposit(i.getId(), Amount.ALL);
        }
      }
      int slotsAvailable = 0;
      for (Item i : Inventory.getAllItems(false)) {
        if (i == null) {
          ++slotsAvailable;
        }
      }

      int primaryOreId = GcSuperheater.primaryOre[0];
      Item primaryOre = Bank.getItem(primaryOreId);
      int primaryOreAmount = GcSuperheater.primaryOre[1];
      int primaryOreWithdrawAmount = 0;

      int secondaryOreId = 0;
      Item secondaryOre = null;
      int secondaryOreAmount = 0;
      int secondaryOreWithdrawAmount = 0;

      if (GcSuperheater.secondaryOre != null) {
        secondaryOre = Bank.getItem(GcSuperheater.secondaryOre[0]);
        secondaryOreId = GcSuperheater.secondaryOre[0];
        secondaryOreAmount = GcSuperheater.secondaryOre[1];
        while (slotsAvailable >= (primaryOreAmount + secondaryOreAmount)) {
          ++primaryOreWithdrawAmount;
          secondaryOreWithdrawAmount += secondaryOreAmount;
          slotsAvailable -= primaryOreAmount + secondaryOreAmount;
        }
      } else {
        primaryOreWithdrawAmount = slotsAvailable;
      }

      if (primaryOre != null) {
        primaryOre = Bank.getItem(primaryOreId);
        Bank.search(primaryOre.getName());
        GcSuperheater.logger.log(
            "Withdrawing " + primaryOreWithdrawAmount + " " + primaryOre.getName() + ".");
        Bank.withdraw(primaryOreId, primaryOreWithdrawAmount);
      } else {
        GcSuperheater.logger.log("Out of primary ore, stopping.");
        GcSuperheater.problemFound = true;
      }

      if (secondaryOre != null) {
        secondaryOre = Bank.getItem(secondaryOreId);
        Bank.search(secondaryOre.getName());
        GcSuperheater.logger.log(
            "Withdrawing " + secondaryOreWithdrawAmount + " " + secondaryOre.getName() + ".");
        Bank.withdraw(secondaryOreId, secondaryOreWithdrawAmount);
      } else {
        GcSuperheater.logger.log("Out of secondary ore, stopping.");
        GcSuperheater.problemFound = true;
      }

      primaryOreWithdrawAmount = 0;
      secondaryOreWithdrawAmount = 0;

      Bank.close();
      GcSuperheater.isBanking = false;
      GcSuperheater.logger.log("Finished banking.");
    } else {
      GcSuperheater.logger.log("Unable to bank, stopping.");
      GcSuperheater.problemFound = true;
      return;
    }
  }