예제 #1
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) {
    }
    ;
  }
예제 #2
0
  @Override
  public void run() {
    Filter attackingGhoul =
        new Filter<NPC>() {
          public boolean accept(NPC npc) {
            return npc.getName().equals("Hellhound") && npc.getInteracting() == Players.getLocal();
          }
        };

    Filter freeGhoulToAttack =
        new Filter<NPC>() {
          public boolean accept(NPC npc) {
            return !npc.isInCombat() && npc.getName().equals("Hellhound");
          }
        };

    if (NPCs.getNearest(attackingGhoul) != null) Main.Hellhound = NPCs.getNearest(attackingGhoul);
    else Main.Hellhound = NPCs.getNearest(freeGhoulToAttack);

    if (Main.Hellhound.isOnScreen()) {
      if (Main.Hellhound.getInteracting() == null
          && !underAttack()
          && Main.Hellhound.isOnScreen()
          && Main.Hellhound != null) {
        Mouse.move(Main.Hellhound.getCentralPoint().x, Main.Hellhound.getCentralPoint().y);
        Time.sleep(50);
        if (!Menu.select("Attack")) {
          Mouse.move(Main.Hellhound.getCentralPoint().x, Main.Hellhound.getCentralPoint().y);
          Time.sleep(50);
          Menu.select("Attack");
        }
      }
    } else {
      if (Calculations.distance(Players.getLocal().getLocation(), Main.Hellhound.getLocation())
          <= 5) {
        Camera.turnTo(Main.Hellhound);
      } else {
        Walking.walk(Main.Hellhound.getLocation());
      }
    }
    Time.sleep(Random.nextInt(1000, 1200));
    while (Players.getLocal().isMoving() && !Main.Hellhound.isInCombat()) {
      Time.sleep(100);
    }
  }
 void executeAntiban() {
   int dx, dy;
   int r = Random.nextInt(0, 4);
   switch (r) {
     case 0:
     case 1:
     default:
       Status = "AntiBan";
       Camera.setAngle(Random.nextInt(20, 300));
       break;
     case 2:
     case 3:
       Status = "AntiBan";
       dx = Random.nextInt(-30, 30);
       dy = Random.nextInt(-30, 30);
       Mouse.move(Mouse.getX() + dx, Mouse.getY() + dy);
       Task.sleep(20, 150);
       break;
   }
 }
예제 #4
0
  // Author: Zasz
  public static void takeitem(GroundItem item) {
    Point point = item.getCentralPoint();
    point = new Point(point.x - 3, point.y - 10);
    boolean taken = false;
    for (int i = 0; i < 7; i++) {
      Mouse.move(point.x, point.y);
      Time.sleep(50);
      // log.info(item.getGroundItem().getName());
      if (Menu.select("Take", item.getGroundItem().getName())) {
        Sleeping.waitWhileMoving();
        taken = true;
        break;
      }
      if (i > 5) {
        Camera.setAngle(Camera.getAngleTo(Random.nextInt(15, 25)));
      }
      point = new Point(point.x + i, point.y + i);
    }

    if (taken) {
      addLootTaken(item.getGroundItem(), item.getGroundItem().getStackSize());
    }
  }
예제 #5
0
  @Override
  public void execute() {

    switch (Random.nextInt(0, 200)) {
      case 0:
        Camera.setAngle(Random.nextInt(10, 80));
        break;
      case 1:
        Camera.setAngle(Random.nextInt(80, 220));
        break;
      case 2:
        Tabs.STATS.open();
        Mouse.move(644, 465);
        sleep(1000, 2000);
        Tabs.INVENTORY.open();
        break;
      case 3:
        Tabs.FRIENDS.open();
        sleep(1000, 2000);
        Tabs.INVENTORY.open();
        break;
    }
  }