Guest User

Untitled

a guest
Jul 19th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.83 KB | None | 0 0
  1. //This is the start of variable declaration.
  2. private String obsticleName[] = {"Gap", "Passage", "Eyes", "Rock"};
  3. private String obsticleAction[] = {"Squeeze-through", "Go-through", "Distract", "Mine"};
  4.  
  5. private RSTile obsticlePath[] = {new RSTile(3038, 4855),new RSTile(3048, 4850),
  6. new RSTile(3059, 4842),new RSTile(3061, 4834),
  7. new RSTile(3059, 4824),new RSTile(3053, 4814),
  8. new RSTile(3044, 4812),new RSTile(3030, 4812),
  9. new RSTile(3019, 4819),new RSTile(3018, 4831),
  10. new RSTile(3020, 4842),new RSTile(3027, 4849)};
  11.  
  12. private RSTile obsticleTile[] = {new RSTile(3039, 4854), new RSTile(3050, 4850),
  13. new RSTile(3059, 4840), new RSTile(3061, 4831),
  14. new RSTile(3058, 4822), new RSTile(3050, 4813),
  15. new RSTile(3042, 4811), new RSTile(3027, 4813),
  16. new RSTile(3018, 4822), new RSTile(3018, 4834),
  17. new RSTile(3021, 4843), new RSTile(3029, 4850)};
  18.  
  19. private int l;
  20. //This is the end of class variable declaration
  21.  
  22.  
  23.  
  24. //This is the start of my loop
  25.  
  26. //While player is moving wait
  27. while (getMyPlayer().isMoving()) {
  28. wait(500);
  29. }
  30.  
  31. // Find what location in the path we are at.
  32. for (l=0; l < obsticlePath.length;l++){
  33. if (distanceTo(obsticlePath[l]) < 8) {
  34. l++;
  35. break;
  36. }
  37.  
  38. }
  39.  
  40. //If we are at the end of the path reset it.
  41. if (l > 11) { l = 0; }
  42.  
  43. //Initializes the click (obsticle tile)
  44. int click = l - 1;
  45. if(click < 0){ click = 0; }
  46.  
  47. //If we are less then 19 tiles away from the center of the abyss (check to see if passed obsticle)
  48. if(distanceTo(new RSTile(3039, 4828)) < 19){
  49. log("WE ARE IN ABYSS");
  50. return random(500,1500);
  51. }
  52.  
  53.  
  54. //Looks to see if Obsticle is on screen
  55. //If it is, the mouse will hover over the tile.
  56. //Loop through all the menu actions and loop through the actions to take to see if any match.
  57. //If there is a match then perform the action.
  58. if(tileOnScreen(obsticleTile[click])){
  59. moveMouse(Calculations.tileToScreen(obsticleTile[click]));
  60. wait(random(500,600));
  61. for(int i = 0; i < getMenuActions().size(); i++){
  62. for(int j = 0; j < obsticleAction.length; j++){
  63. final Point midpoint = new Point(
  64. (int) (getMouseLocation().getX() + random(-3, 3)),
  65. (int) (getMouseLocation().getY() + random(-3, 3)));
  66.  
  67. moveMouse(midpoint);
  68. if(getMenuActions().get(i).contains(obsticleAction[j])){
  69. atMenu(obsticleAction[j]);
  70. wait(random(600,900));
  71. return random(500,700);
  72. }
  73. }
  74. }
  75.  
  76. }
  77.  
  78. //If player is less then 7 tiles from the walking path then walk next tile.
  79. if (distanceTo(getDestination()) < random(5, 7) || getDestination() == null) {
  80. if (!walkTileMM((obsticlePath[l]))) {
  81. walkTo((obsticlePath[l]));
  82. }
  83. }
  84.  
  85.  
  86. return(random(1000,1200));
  87. //This is the end of the loop
Add Comment
Please, Sign In to add comment