Jump to content

how do i terminate webwalking?


The Hero of Time

Recommended Posts

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?

Link to comment
Share on other sites

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
Link to comment
Share on other sites


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
Link to comment
Share on other sites

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
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...