Esempio n. 1
0
  // Checks if the player is moving
  public boolean isMoving() {
    Point MMc = new Point(627, 135);
    int pixelShift = Screen.getPixelShift(MMc.x - 40, MMc.y - 40, MMc.x + 40, MMc.y + 40, 250);
    // println("Pixelshift: " + pixelShift);
    if (pixelShift > 150) {
      return true;
    }

    return false;
  }
Esempio n. 2
0
  private Point[] getRoom() {
    Color A = new Color(0, 0, 0);
    Color B = new Color(0, 0, 0);

    // Get all pixels that aren't black from the minimap, store in a 2d boolean array
    for (int i = 0; i < map.length; i++) {
      for (int j = 0; j < map[i].length; j++) {
        double dist =
            Math.pow(MMX1 + (MMXL / 2) - (i + MMX1), 2)
                + Math.pow(MMY1 + (MMYL / 2) - (j + MMY1), 2);
        if (dist < (Math.pow(MMXL / 2, 2))) {
          B = Screen.getColourAt(new Point(i + MMX1, j + MMY1));
          if (!Screen.coloursMatch(A, B, new Tolerance(10))) {
            map[i][j] = true;
          }
        }
      }
    }

    // Flood-fill to get the current room
    ArrayList<Point> stack = new ArrayList<Point>();
    stack.add(new Point(627, 135));
    int[][] offset = {{0, -1}, {1, 0}, {0, 1}, {-1, 0}};
    int i = 0;

    while (stack.size() > i) {
      Point convert = new Point(stack.get(i).x - MMX1, stack.get(i).y - MMY1);

      for (int j = 0; j < offset.length; j++) {
        Point PT = new Point(convert.x + offset[j][0], convert.y + offset[j][1]);
        if (map[PT.x][PT.y]) {
          stack.add(new Point(PT.x + MMX1, PT.y + MMY1));
          map[PT.x][PT.y] = false;
        }
      }

      i++;
    }

    room = stack.toArray(new Point[stack.size()]);

    return room;
  }
Esempio n. 3
0
  // BANKING
  private boolean waitBoxScreen(long time) {
    long maxTime = System.currentTimeMillis() + time;
    while (System.currentTimeMillis() < maxTime) {
      ColourPoint[] counts =
          Screen.findColours(new Color(60, 50, 45), 94, 108, 439, 313, new Tolerance(20));
      if (counts.length > 2000) {
        return true;
      }
    }

    return false;
  }
Esempio n. 4
0
  private boolean waitContinue(long time) {
    long maxTime = System.currentTimeMillis() + time;

    while (System.currentTimeMillis() < maxTime) {
      ColourPoint[] pts =
          Screen.findColours(new Color(40, 75, 40), 227, 513, 293, 522, new Tolerance(40));
      if (pts.length > 200) {
        // println("Found continue");
        return true;
      }
    }

    return false;
  }
Esempio n. 5
0
  private Point[] getCyanUptextPoints() {
    ArrayList<Point> matches = new ArrayList<Point>();
    BufferedImage img = Screen.getGameImage();

    for (int x = uptextArea.x; x < uptextArea.x + uptextArea.width; x++) {
      for (int y = uptextArea.y; y < uptextArea.y + uptextArea.height; y++) {
        Color c = new Color(img.getRGB(x, y));
        if (org.tribot.api.Screen.coloursMatch(cyanColor, c, cyanTol)) {
          matches.add(new Point(x, y));
        }
      }
    }

    return matches.toArray(new Point[matches.size()]);
  }
Esempio n. 6
0
    public Point[] getPoints() {
      ArrayList<Point> matches = new ArrayList<Point>();
      BufferedImage img = Screen.getGameImage();
      Tolerance tol = new Tolerance(tolerance);

      for (int x = gamescreen.x; x < gamescreen.x + gamescreen.width; x++) {
        for (int y = gamescreen.y; y < gamescreen.y + gamescreen.height; y++) {
          Color c = new Color(img.getRGB(x, y));
          if (org.tribot.api.Screen.coloursMatch(color, c, tol)) {
            matches.add(new Point(x, y));
          }
        }
      }

      return matches.toArray(new Point[matches.size()]);
    }