Jump to content
Sign in to follow this  
obrandso

Crossing Wildy-ditch

Recommended Posts

What is the most efficient way to cross the wildy ditch?..

i tried with widget but couldnt get it to press the "Enter Wilderness" button.

It would press "Cross" and get the menu up, but the mouse would stand still in the middle and then close the menu and re-click the "Cross" ditch again..

Share this post


Link to post
Share on other sites

The way I did it was...

public void WalkToWild() {
        RS2Widget enterWildernessButton = getWidgets().singleFilter(getWidgets().getAll(), new WidgetActionFilter("Enter Wilderness"));
        if (enterWildernessButton != null) {
            enterWildernessButton.interact("Enter Wilderness");
        } else {
            log("Walking to the wilderness...");
            status = ("Walking to the wildernes...");
            WebWalkEvent webWalkEvent = new WebWalkEvent(wilderness);
            webWalkEvent.setBreakCondition(new Condition() {
                @Override
                public boolean evaluate() {
                    return getWidgets().getWidgetContainingText("Enter Wilderness") != null;
                }
            });
            getWalking().webWalk(wilderness); //Wilderness is my Area
        }

class WidgetActionFilter implements Filter<RS2Widget> {

    private final String action;

    WidgetActionFilter(final String action) {
        this.action = action;
    }

    @Override
    public boolean match(RS2Widget rs2Widget) {
        if (rs2Widget == null) {
            return false;
        }
        if (rs2Widget.getInteractActions() == null) {
            return false;
        }
        for (String action : rs2Widget.getInteractActions()) {
            if (this.action.equals(action)) {
                return true;
            }
        }
        return false;
    }
}

    }

 

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...