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