Guest User

Untitled

a guest
Dec 18th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1.  
  2. private RSObject obstacle(final int arg0) {
  3. return objects.getNearest(new Filter<RSObject>() {
  4.  
  5. @Override
  6. public boolean accept(RSObject t) {
  7. return t.getID() == arg0;
  8. }
  9.  
  10. });
  11. }
  12.  
  13. private void interact(int arg0) {
  14. RSObject ob = obstacle(arg0);
  15. String action = getAction(arg0);
  16. if (ob != null) {
  17. if (!ob.isOnScreen()) {
  18. walking.walkTileMM(ob.getLocation());
  19. sleep(500, 600);
  20. camera.turnTo(ob);
  21. } else {
  22. if (ob.isOnScreen()) {
  23. if (action != null) {
  24. ob.interact(action);
  25. sleep(1200, 1400);
  26. }
  27. }
  28. }
  29. }
  30. }
  31.  
  32. private String getAction(int arg0) {
  33. RSObject object = obstacle(arg0);
  34. String[] actions = { "Jump", "Climb-over", "Climb-down" };
  35. if (object != null) {
  36. for (String action : actions) {
  37. if (object.hasAction(action)) {
  38. return action;
  39. }
  40. }
  41. }
  42. return null;
  43. }
  44.  
  45. interact(wallID);
Add Comment
Please, Sign In to add comment