Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package scripts.abyssCrafter;
- import org.tribot.api.General;
- import org.tribot.api.Timing;
- import org.tribot.api.interfaces.Positionable;
- import org.tribot.api2007.Camera;
- import org.tribot.api2007.Objects;
- import org.tribot.api2007.Player;
- import org.tribot.api2007.types.RSObject;
- public class Clicker {
- public static boolean interactObject(String name, int dist) {
- RSObject[] obj = Objects.findNearest(dist, name);
- if (!Player.isMoving() && obj.length > 0) {
- if (obj[0].hover() && Timing.waitUptext(name, General.random(700, 1100))) {
- if (obj[0] != null && obj[0].click()) {
- General.sleep(1100, 1600);
- return true;
- }
- }
- else {
- fixCam();
- }
- }
- return false;
- }
- public static boolean interactObject(RSObject obj, String option) {
- if (!Player.isMoving() && obj != null) {
- if (obj.hover() && Timing.waitUptext(obj.getDefinition().getName(),
- General.random(700, 1100))) {
- if (obj != null && obj.click(option)) {
- General.sleep(1100, 1600);
- return true;
- }
- }
- else {
- fixCam();
- }
- }
- return false;
- }
- public static boolean interactObject(RSObject obj) {
- if (!Player.isMoving() && obj != null) {
- if (obj.hover() && Timing.waitUptext(obj.getDefinition().getName(),
- General.random(700, 1100))) {
- if (obj != null && obj.click()) {
- General.sleep(1100, 1600);
- return true;
- }
- }
- else {
- fixCam();
- }
- }
- return false;
- }
- public static boolean interactObject(Positionable tile) {
- RSObject[] obj = Objects.getAt(tile);
- if (!Player.isMoving() && obj.length > 0) {
- if (obj[0].hover() && Timing.waitUptext(obj[0].getDefinition().getName(),
- General.random(700, 1100))) {
- if (obj[0] != null && obj[0].click()) {
- General.sleep(1100, 1600);
- return true;
- }
- }
- else {
- fixCam();
- }
- }
- return false;
- }
- private static void fixCam() {
- Camera.setCameraRotation(Camera.getCameraRotation() + General.random(-5, 5));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment