HunterRS Posted September 12, 2017 Share Posted September 12, 2017 I am having a problem with figuring out if a player can access an Area. Talking webwalk wise, like quests, items, teleports... How can I check if the webwalk has found a path without acually executing the walk? Quote Link to comment Share on other sites More sharing options...
Team Cape Posted September 12, 2017 Share Posted September 12, 2017 (edited) WebWalkEvent wwe = new WebWalkEvent(area); wwe.prefetchRequirements(this); wwe.getDestination(); //returns the walkable position in the area if one was found Edited September 12, 2017 by Team Cape Quote Link to comment Share on other sites More sharing options...
HunterRS Posted September 12, 2017 Author Share Posted September 12, 2017 19 minutes ago, Team Cape said: wwe.prefetchRequirements(this); Could you explain this line? I tried without it and it didnt work. Quote Link to comment Share on other sites More sharing options...
harrypotter Posted September 12, 2017 Share Posted September 12, 2017 (edited) 5 minutes ago, HunterRS said: Could you explain this line? I tried without it and it didnt work. Check the docs: https://osbot.org/api/org/osbot/rs07/event/WebWalkEvent.html#prefetchRequirements-org.osbot.rs07.script.MethodProvider- Quote public boolean prefetchRequirements(MethodProvider provider) Generates the directions for this WebWalkEvent based on the requirements of PathPreferenceProfile. If no PathPreferenceProfile is declared, a default profile is set. If this method is not called prior to execution, it is called on event execution. You may only prefetch once for the event's instance. Returns: True if a destination was found and directions were created. Edited September 12, 2017 by harrypotter Quote Link to comment Share on other sites More sharing options...
HunterRS Posted September 12, 2017 Author Share Posted September 12, 2017 13 minutes ago, harrypotter said: Check the docs: https://osbot.org/api/org/osbot/rs07/event/WebWalkEvent.html#prefetchRequirements-org.osbot.rs07.script.MethodProvider- Ya saw this, still think I dont understand it fully Quote Link to comment Share on other sites More sharing options...
Team Cape Posted September 12, 2017 Share Posted September 12, 2017 1 hour ago, HunterRS said: Ya saw this, still think I dont understand it fully just creating the webwalkevent means nothing because the webwalkevent has no reference to your instance of script (this is why it does not do it on instantiation). do it with every line it provided, and it will work because prefetchRequirements() is what does that even if the webwalkevent isn't executed. Quote Link to comment Share on other sites More sharing options...
HunterRS Posted September 13, 2017 Author Share Posted September 13, 2017 9 hours ago, Team Cape said: just creating the webwalkevent means nothing because the webwalkevent has no reference to your instance of script (this is why it does not do it on instantiation). do it with every line it provided, and it will work because prefetchRequirements() is what does that even if the webwalkevent isn't executed. Ahhh I get it, ty very much Quote Link to comment Share on other sites More sharing options...