Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //This is the start of variable declaration.
- private String obsticleName[] = {"Gap", "Passage", "Eyes", "Rock"};
- private String obsticleAction[] = {"Squeeze-through", "Go-through", "Distract", "Mine"};
- private RSTile obsticlePath[] = {new RSTile(3038, 4855),new RSTile(3048, 4850),
- new RSTile(3059, 4842),new RSTile(3061, 4834),
- new RSTile(3059, 4824),new RSTile(3053, 4814),
- new RSTile(3044, 4812),new RSTile(3030, 4812),
- new RSTile(3019, 4819),new RSTile(3018, 4831),
- new RSTile(3020, 4842),new RSTile(3027, 4849)};
- private RSTile obsticleTile[] = {new RSTile(3039, 4854), new RSTile(3050, 4850),
- new RSTile(3059, 4840), new RSTile(3061, 4831),
- new RSTile(3058, 4822), new RSTile(3050, 4813),
- new RSTile(3042, 4811), new RSTile(3027, 4813),
- new RSTile(3018, 4822), new RSTile(3018, 4834),
- new RSTile(3021, 4843), new RSTile(3029, 4850)};
- private int l;
- //This is the end of class variable declaration
- //This is the start of my loop
- //While player is moving wait
- while (getMyPlayer().isMoving()) {
- wait(500);
- }
- // Find what location in the path we are at.
- for (l=0; l < obsticlePath.length;l++){
- if (distanceTo(obsticlePath[l]) < 8) {
- l++;
- break;
- }
- }
- //If we are at the end of the path reset it.
- if (l > 11) { l = 0; }
- //Initializes the click (obsticle tile)
- int click = l - 1;
- if(click < 0){ click = 0; }
- //If we are less then 19 tiles away from the center of the abyss (check to see if passed obsticle)
- if(distanceTo(new RSTile(3039, 4828)) < 19){
- log("WE ARE IN ABYSS");
- return random(500,1500);
- }
- //Looks to see if Obsticle is on screen
- //If it is, the mouse will hover over the tile.
- //Loop through all the menu actions and loop through the actions to take to see if any match.
- //If there is a match then perform the action.
- if(tileOnScreen(obsticleTile[click])){
- moveMouse(Calculations.tileToScreen(obsticleTile[click]));
- wait(random(500,600));
- for(int i = 0; i < getMenuActions().size(); i++){
- for(int j = 0; j < obsticleAction.length; j++){
- final Point midpoint = new Point(
- (int) (getMouseLocation().getX() + random(-3, 3)),
- (int) (getMouseLocation().getY() + random(-3, 3)));
- moveMouse(midpoint);
- if(getMenuActions().get(i).contains(obsticleAction[j])){
- atMenu(obsticleAction[j]);
- wait(random(600,900));
- return random(500,700);
- }
- }
- }
- }
- //If player is less then 7 tiles from the walking path then walk next tile.
- if (distanceTo(getDestination()) < random(5, 7) || getDestination() == null) {
- if (!walkTileMM((obsticlePath[l]))) {
- walkTo((obsticlePath[l]));
- }
- }
- return(random(1000,1200));
- //This is the end of the loop
Add Comment
Please, Sign In to add comment