Guest User

Untitled

a guest
Jan 10th, 2016
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. import org.osbot.rs07.api.model.RS2Object;
  2. import org.osbot.rs07.event.Event;
  3.  
  4. public class WebWalkEvent extends Event {
  5.  
  6. @Override
  7. public int execute() throws InterruptedException {
  8. setBreakCondition(getObjects().closest("Gate").hasAction("Pay-toll(10gp)"));
  9. setBreakCondition(getObjects().closest("Wilderness Ditch") != null);
  10. return 200;
  11. }
  12. public void setBreakCondition(boolean b) throws InterruptedException {
  13. if (b = true) {
  14. handleObstacle();
  15. }
  16. }
  17.  
  18. public void handleObstacle() throws InterruptedException {
  19. RS2Object ditch = getObjects().closest("Wilderness Ditch");
  20. if (ditch != null) {
  21. if (ditch.isVisible()) {
  22. ditch.interact("Cross");
  23. }
  24. while (!getWidgets().get(382, 18).isVisible()) {
  25. sleep(1000);
  26. }
  27. getWidgets().get(382, 18).interact();
  28. }
  29. RS2Object gate = getObjects().closest("Gate");
  30. if (gate != null) {
  31. if (gate.hasAction("Pay-toll(10gp)")) {
  32. if (gate.interact("Pay-toll(10gp)")) {
  33. sleep(2000);
  34. }
  35. }
  36. }
  37.  
  38. }
  39.  
  40. }
Advertisement
Add Comment
Please, Sign In to add comment