Esempio n. 1
0
  /**
   * Rotates the camera for a random duration
   *
   * @return true if succesfully rotated, false if not.
   */
  public static boolean doRotateCamera() {

    General.println(
        "Current time: "
            + System.currentTimeMillis()
            + ". Next CAM_ROTATE at: "
            + (System.currentTimeMillis() - getUtil().TIME_TRACKER.ROTATE_CAMERA.next())
            + ". (next(): "
            + getUtil().TIME_TRACKER.ROTATE_CAMERA.next()
            + ")");
    if (getUtil().TIME_TRACKER.ROTATE_CAMERA.next() > 0L
        && System.currentTimeMillis() < getUtil().TIME_TRACKER.ROTATE_CAMERA.next()) return false;

    LANChaosKiller.statusText = "Antiban - Rotate Camera";

    General.println("Rotating Camera");

    long startTime = System.currentTimeMillis();
    long duration = General.random(500, 2000);

    while (System.currentTimeMillis() < (startTime + duration)) {

      Camera.setCameraRotation(General.random(10, 360));
    }

    getUtil().TIME_TRACKER.ROTATE_CAMERA.reset();

    return true;
  }
Esempio n. 2
0
 /**
  * Attempts to trade the customer
  *
  * @return True if traded succesfully
  */
 public boolean tradeCustomer() {
   RSNPC[] customers = getCustomers();
   for (RSNPC customer : customers) {
     if (PathFinding.canReach(customer, true)) {
       if (!customer.isOnScreen()) {
         Walking.walkTo(customer);
         Camera.turnToTile(customer);
       } else {
         RSModel model = customer.getModel();
         if (model != null) {
           if (DynamicClicking.clickRSModel(model, "Trade")) {
             return waitStoreOpen(General.random(2000, 3000));
           } else {
             Camera.turnToTile(customer);
           }
         }
       }
     }
   }
   return false;
 }