Ejemplo n.º 1
0
 public void setCameraRelativeTo(final Locatable reference) {
   final Tile playerTile = Players.getLocal().getLocation();
   final Tile referenceTile = reference.getLocation();
   if (playerTile.getX() < referenceTile.getX()) {
     Camera.setAngle(Random.nextInt(250, 270));
   } else if (playerTile.getX() > referenceTile.getX()) {
     Camera.setAngle(Random.nextInt(80, 100));
   } else if (playerTile.getY() > referenceTile.getY()) {
     Camera.setAngle(Random.nextInt(170, 180));
   } else if (playerTile.getY() < referenceTile.getY()) {
     Camera.setAngle(Random.nextInt(350, 360));
   }
 }
Ejemplo n.º 2
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;
    }
  }
 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;
   }
 }
Ejemplo n.º 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());
    }
  }