Guest User

Untitled

a guest
Jul 16th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. private boolean openDoor(int doorID) {
  2. final RSObject door = getNearestObjectByID(doorID);
  3.  
  4. if (door == null) {
  5. return false;
  6. }
  7.  
  8. final RSTile loc = door.getLocation();
  9. final RSTile counter = new RSTile(loc.getX() + 1, loc.getY());
  10.  
  11. int i = 0;
  12.  
  13. while (i < 20) {
  14. i++;
  15.  
  16. if (i % 5 == 0) {
  17. setCameraRotation(random(0, 359));
  18. }
  19.  
  20. final Point midpoint = new Point(
  21. (int) ((Calculations.tileToScreen(loc).getX() + Calculations
  22. .tileToScreen(counter).getX()) / 2),
  23. (int) ((Calculations.tileToScreen(loc).getY() + Calculations
  24. .tileToScreen(counter).getY()) / 2));
  25. moveMouse(midpoint, (int) (midpoint.getX() - Calculations
  26. .tileToScreen(loc).getX()), 5);
  27.  
  28. wait(random(300, 500));
  29. try {
  30. for (final String s : getMenuActions()) {
  31. if (s.contains("pen")) {
  32. final boolean b = atMenu("Open");
  33. wait(random(600, 1200));
  34. return b;
  35. }
  36. }
  37. } catch (final NullPointerException noMenuActions) {
  38. return false;
  39. }
  40. }
  41. return false;
  42. }
Add Comment
Please, Sign In to add comment