示例#1
1
  // Returns the nearest point of the ID
  public Point getNearestPoint(long id) {
    Point MSc = new Point(259, 220);
    ScreenModel[] find = ScreenModels.find(id);
    ArrayList<Integer> distList = new ArrayList<Integer>();
    ArrayList<Point> coordList = new ArrayList<Point>();

    if (find.length > 0) {
      for (int i = 0; i < find.length; i++) {
        distList.add(
            (int)
                Math.sqrt(
                    Math.pow(Math.abs(MSc.x - find[i].base_point.x), 2)
                        + Math.pow(Math.abs(MSc.y - find[i].base_point.y), 2)));
        coordList.add(new Point(find[i].base_point.getLocation()));
      }

      if (!distList.isEmpty() && !coordList.isEmpty()) {
        int nearest = 1000;
        int t = 0;

        for (int i = 0; i < distList.size(); i++) {
          if (distList.get(i) < nearest) {
            nearest = distList.get(i);
            t = i;
          }
        }

        return coordList.get(t);
      }
    }

    return null;
  }
示例#2
0
  private void gluttonousBehemoth() {
    long bossID = 2081911231L, foodSourceID = 1561638623L;
    Point MSC = new Point(259, 220);

    ScreenModel[] boss = ScreenModels.find(bossID);
    if (boss.length > 0) {
      ScreenModel[] food = ScreenModels.find(foodSourceID);
      if (food.length > 0) {
        int foodDist =
            Math.abs(MSC.x - food[0].base_point.x) + Math.abs(MSC.y - food[0].base_point.y);
        println("Food dist: " + foodDist);
        if (foodDist < 110) {
          Point BP = new Point(boss[0].base_point);
          Mouse.move(BP);
          if (Timing.waitUptext("behemoth", 500)) {
            Mouse.click(BP, 1);
          }
        } else {
          println("We need to move near the food source!");
          Point FP = new Point(food[0].base_point);
          Mouse.click(FP, 1);
        }
      }
    }
  }
示例#3
0
  private void detectDoors() {
    final String[] doorNames = {
      "locked corner",
      "locked crescent",
      "locked diamond",
      "locked pentagon",
      "locked rectangle",
      "locked shield",
      "locked triangle",
      "locked wedge",
      "corner",
      "crescent",
      "diamond",
      "pentagon",
      "rectangle",
      "shield",
      "triangle",
      "wedge",
      "guardian",
      "normal"
    };
    final long[] doorIDs = {
      3567313268L,
      3910435716L,
      91358147L,
      4331786L,
      91358147L,
      3787771282L,
      2405656118L,
      3875161726L,
      817797154L,
      4100701787L,
      951884599L,
      2271324898L,
      2916768302L,
      15654456837L,
      2283382981L,
      820962017L,
      2128416052L,
      1103861357L
    };
    final int[] foundDoors = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};

    // Looping through the results to know what doors have been found.
    for (int i = 0; i < doorIDs.length; i++) {
      ScreenModel[] doorSearch = ScreenModels.find(doorIDs[i]);
      if (doorSearch.length > 0) {
        if (i == 2 || i == 4) if (ScreenModels.find(doorIDs[i + 8]).length < 1) continue;
        foundDoors[i]++;
        status = "Detected " + doorNames[i] + " door";
        println("Detected " + doorNames[i] + " door");
      }
    }
  }
示例#4
0
  private boolean depositAll() {
    ScreenModel[] box = ScreenModels.find(1518040783L);
    if (box.length > 0) {
      Point P =
          new Point(
              box[0].base_point.x + randomRange(-3, 3), box[0].base_point.y + randomRange(-3, 3));
      Mouse.move(P);
      if (Timing.waitUptext("deposit box", 1000)) {
        Mouse.click(1);
        if (waitBoxScreen(5000)) {
          Point BP = new Point(298 + randomRange(0, 25), 320 + randomRange(0, 16));
          Mouse.move(BP);
          Mouse.click(1);
          return true;
        }
      } else {
        attempt++;
        if (attempt < maxAttempt) {
          if (depositAll()) {
            attempt = 0;
          }
        }
      }
    }

    return false;
  }
示例#5
0
  private void detectKeys() {
    final String[] keyNames = {
      "corner", "crescent", "diamond", "pentagon", "rectangle", "shield", "triangle", "wedge"
    };
    final long[] keyIDs = {
      4246339401L,
      2709435617L,
      885594529L,
      3729250727L,
      3299208923L,
      3738855977L,
      2009794115L,
      2048859797L
    };
    final int[] grabbedKeys = {0, 0, 0, 0, 0, 0, 0, 0};

    // Looping through the results to know what keys have been found.
    for (int i = 0; i < keyIDs.length; i++) {
      ScreenModel[] keySearch = ScreenModels.find(keyIDs[i]);
      if (keySearch.length > 0) {
        grabbedKeys[i]++;
        status = "Found " + keyNames[i] + " key";
        println("Found " + keyNames[i] + " key");
      }
    }
  }
示例#6
0
  private void icyBones() {
    long bossID = 3076383209L;

    ScreenModel[] boss = ScreenModels.find(bossID);
    if (boss.length > 0) {
      Point BP = new Point(boss[0].base_point);
      Mouse.move(BP);
      if (Timing.waitUptext("bones", 500)) {
        Mouse.click(BP, 1);
      }
    }
  }