Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.osbot.rs07.api.model.RS2Object;
- import org.osbot.rs07.event.Event;
- public class WebWalkEvent extends Event {
- @Override
- public int execute() throws InterruptedException {
- setBreakCondition(getObjects().closest("Gate").hasAction("Pay-toll(10gp)"));
- setBreakCondition(getObjects().closest("Wilderness Ditch") != null);
- return 200;
- }
- public void setBreakCondition(boolean b) throws InterruptedException {
- if (b = true) {
- handleObstacle();
- }
- }
- public void handleObstacle() throws InterruptedException {
- RS2Object ditch = getObjects().closest("Wilderness Ditch");
- if (ditch != null) {
- if (ditch.isVisible()) {
- ditch.interact("Cross");
- }
- while (!getWidgets().get(382, 18).isVisible()) {
- sleep(1000);
- }
- getWidgets().get(382, 18).interact();
- }
- RS2Object gate = getObjects().closest("Gate");
- if (gate != null) {
- if (gate.hasAction("Pay-toll(10gp)")) {
- if (gate.interact("Pay-toll(10gp)")) {
- sleep(2000);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment