Jump to content

Check for when webwalker interacts with an object?


XenoTools

Recommended Posts

Currently I'm having some issues with webwalker in combination with the Stronghold of Security. It will use one of the gates, however it will then just keep using the gate over and over again. This leads me to believe that the Stronghold of Secuirty is not yet supported by the webholder, or at-least solving it is not. 

 

Is it possible to figure out when the webwalker interacts with an object, pause the webwalker, do whatever you need to do with the object (In this case, solve the gate's question.. which is simple) and then resume the webwalker. 

 

As of right now I'm just spam clicking a gate and that's not acceptable.

 

Link to comment
Share on other sites

public static void webWalkEvent(final INodeRouteFinder routeFinder, final Position position, final int treshold, final MethodProvider script) {
    WebWalkEvent event = new WebWalkEvent(routeFinder, position);
    event.setBreakCondition(new Condition() {

        @Override
        public boolean evaluate() {
// Return when you want the event to break.
            return script.getMap().distance(position) <= treshold;

        }
    });

    script.execute(event);
}

use Webwalkevent.

 

treshold is when you break the webwalking once it's close. if you set it to 1 it will break the webwalker once its in a radius of 1 tile.

 

so walk to the gate, automatic break, solve question, open next gate

 

you can also check if you're in dialoge(door's dialoge)

 

got it from @Khaleesi

 

 

Edited by The Hero of Time
  • Like 1
Link to comment
Share on other sites

 

If you're using

 

getWalking()
getLocalWalker()

I think you're out of luck but if you're using the snippet, that I believe originates from @Khaleesi but posted by hero (can't tag you for some reason)

(feel free to correct me there you two)

You could do 

 

  public void webWalkEvent(final INodeRouteFinder routeFinder, final Position position, final Area area, final MethodProvider script) {
        WebWalkEvent event = new WebWalkEvent(routeFinder, position);

        event.setBreakCondition(new Condition() {
            @Override
            public boolean evaluate() {  
                return getDialogues().inDialogue();
            }
        });

        script.execute(event);
    }

which'd break walking when in dialogue, so you can handle it and it'd continue happy.png

Edited by Isolate
Link to comment
Share on other sites


 

This was exactly what I was thinking I would have to do, I was just hoping I wouldn't have to have so many waypoints. Alright, thanks guys. I'll finish this off in the morning then. CBA writing all the different waypoints out tonight. 

 

EDIT: As for the confusion on webwalkers ability to solve SS, it came from this thread: http://osbot.org/forum/topic/67374-web-walking-in-progress/

Didn't notice it wasn't the official. 

Edited by XenoTools
Link to comment
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.
Note: Your post will require moderator approval before it will be visible.

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...