September 26, 20187 yr I'm trying store a boolean whether webwalk can find a route. I'm doing this right now: boolean a = getWalking().webWalk(some area); But it gets stuck for a while, maybe 1 minute before the script continues, even though the console already said that no route is found the moment the line is read. Is there some way to fix this, or some other way to see if there is a route? EDIT: That would be: getMap().realDistance(some position/entity) == -1 Edited September 26, 20187 yr by feggit found the answer
September 26, 20187 yr Have you tried using a WebWalkingEvent? Haven't tested this code but off the top of my head you may be able to do something like this: WebWalkingEvent walkToDestination = new WebWalkingEvent(area); Event event = execute(walkToDestination); if (event.hasFailed()) { // Event failed do something }
September 26, 20187 yr Sure you aren't manually sleeping that minute somewhere? Or returning it from onLoop?
September 28, 20187 yr Author On 9/26/2018 at 3:51 PM, FrostBug said: Sure you aren't manually sleeping that minute somewhere? Or returning it from onLoop? Yes I am sure, because immediately the next line I am printing the boolean and it took a very look time. Don't know why but it works now without any delay. On 9/26/2018 at 10:45 AM, Ragnar Lothbrok said: Have you tried using a WebWalkingEvent? Haven't tested this code but off the top of my head you may be able to do something like this: WebWalkingEvent walkToDestination = new WebWalkingEvent(area); Event event = execute(walkToDestination); if (event.hasFailed()) { // Event failed do something } I tried after this suggestion but it didn't work. It turns out that it is WebWalkEvent instead of WebWalkingEvent XD But it worked after I used the correct class name, so thanks.
Create an account or sign in to comment