Jump to content

how do i terminate webwalking?


Recommended Posts

Posted

After an hour of running my script, it ran into this problem

 

578375158081131a679f926334b56d0f.gif

 

[iNFO][bot #1][03/12 03:19:30 AM]: [debug] starting walking

 

a0cdd3bb52.png

 

it's stuck in webwalking, constantly trying to reach the place.. i would like a 10 second timeout or something, that after a while it will just move away, or do something that will fix it

 

 

 

559ae43cfdf8d02404fd76fa4f49a72d.gif

 

while ::toggleroofs might fix it, there are definitely cases where it wouldn't, so how does this work in cases where it doesnt fix it?

Posted (edited)

use WebWalkEvent and you can set Break conditions. http://osbot.org/api/org/osbot/rs07/event/WebWalkEvent.html

 

Reasoning for it being like that: Uses the default WebWalkEvent which has a threshold distance. So if it comes within a certain amount of tiles (I think the threshold is 2/3 can't remember then it will return true as it arriving at the position).

Edited by Extreme Scripts
Posted (edited)


WebWalkEvent toDestination = new WebWalkEvent(INodeRouteFinder.createAdvanced(), destination); //can do Position position || try area.getRandomPosition();

toDestination.setBreakCondition(new Condition() { //if true, break the walker.

@Override

public boolean evaluate() {

return condition; //area.contains(myPos) || pos.distance() <= threshold

}

});

execute(toDestination);

Edited by Sinatra
  • Like 1
Posted
WebWalkEvent toDestination = new WebWalkEvent(INodeRouteFinder.createAdvanced(), destination); //can do Position position || try area.getRandomPosition();
toDestination.setBreakCondition(new Condition() { //if true, break the walker.
      @Override
      public boolean evaluate() {
          return condition; //area.contains(myPos) || pos.distance() <= threshold
      }
 });
execute(toDestination);

tyvm for the snippet <3 ill have a look at it later, 3;39 am now ayy lmao

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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