joedezzy1

Untitled

Jul 30th, 2014
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.07 KB | None | 0 0
  1. package scripts.abyssCrafter;
  2.  
  3. import org.tribot.api.General;
  4. import org.tribot.api.Timing;
  5. import org.tribot.api.interfaces.Positionable;
  6. import org.tribot.api2007.Camera;
  7. import org.tribot.api2007.Objects;
  8. import org.tribot.api2007.Player;
  9. import org.tribot.api2007.types.RSObject;
  10.  
  11. public class Clicker {
  12.  
  13.     public static boolean interactObject(String name, int dist) {
  14.     RSObject[] obj = Objects.findNearest(dist, name);
  15.     if (!Player.isMoving() && obj.length > 0) {
  16.         if (obj[0].hover() && Timing.waitUptext(name, General.random(700, 1100))) {
  17.             if (obj[0] != null && obj[0].click()) {
  18.             General.sleep(1100, 1600);
  19.             return true;
  20.         }
  21.         }
  22.         else {
  23.         fixCam();
  24.         }
  25.     }
  26.     return false;
  27.     }
  28.    
  29.     public static boolean interactObject(RSObject obj, String option) {
  30.         if (!Player.isMoving() && obj != null) {
  31.         if (obj.hover() && Timing.waitUptext(obj.getDefinition().getName(),
  32.             General.random(700, 1100))) {
  33.         if (obj != null && obj.click(option)) {                    
  34.             General.sleep(1100, 1600);
  35.             return true;
  36.         }
  37.         }
  38.         else {
  39.         fixCam();
  40.         }
  41.     }
  42.     return false;
  43.     }
  44.    
  45.     public static boolean interactObject(RSObject obj) {
  46.     if (!Player.isMoving() && obj != null) {
  47.         if (obj.hover() && Timing.waitUptext(obj.getDefinition().getName(),
  48.         General.random(700, 1100))) {
  49.         if (obj != null && obj.click()) {
  50.             General.sleep(1100, 1600);
  51.             return true;
  52.         }
  53.         }
  54.         else {
  55.         fixCam();
  56.         }
  57.     }
  58.     return false;
  59.     }
  60.    
  61.     public static boolean interactObject(Positionable tile) {
  62.     RSObject[] obj = Objects.getAt(tile);
  63.     if (!Player.isMoving() && obj.length > 0) {
  64.         if (obj[0].hover() && Timing.waitUptext(obj[0].getDefinition().getName(),
  65.             General.random(700, 1100))) {
  66.             if (obj[0] != null && obj[0].click()) {
  67.             General.sleep(1100, 1600);
  68.             return true;
  69.         }
  70.         }
  71.         else {
  72.         fixCam();
  73.         }
  74.     }
  75.     return false;
  76.     }
  77.  
  78.     private static void fixCam() {
  79.     Camera.setCameraRotation(Camera.getCameraRotation() + General.random(-5, 5));
  80.     }
  81. }
Advertisement
Add Comment
Please, Sign In to add comment