Hel Posted April 8, 2018 Posted April 8, 2018 I've fiddled for a little bit and can't seem to figure out if it's possible, but I'm trying to check if I can reach a tile from a position that isn't my own. map.canReach seems to only be able to use the player's current position.
Mordred Posted April 8, 2018 Posted April 8, 2018 52 minutes ago, Slut said: I've fiddled for a little bit and can't seem to figure out if it's possible, but I'm trying to check if I can reach a tile from a position that isn't my own. map.canReach seems to only be able to use the player's current position. Your Sig just made me laugh, then question what the fuck education is.... 1
Chris Posted April 8, 2018 Posted April 8, 2018 6 hours ago, Slut said: I've fiddled for a little bit and can't seem to figure out if it's possible, but I'm trying to check if I can reach a tile from a position that isn't my own. map.canReach seems to only be able to use the player's current position. just make your own with LocalRouteFinder if path != null return true : false; 2
liverare Posted April 8, 2018 Posted April 8, 2018 public boolean canReach(Position from, Position to) { return !(new LocalPathFinder(bot).findPath(from,to).isEmpty()); } https://osbot.org/api/org/osbot/rs07/api/util/LocalPathFinder.html 2
Hel Posted April 9, 2018 Author Posted April 9, 2018 bump, localPathFinder only works within a certain area, kind've need a method that works over larger distances.
FrostBug Posted April 9, 2018 Posted April 9, 2018 (edited) 6 minutes ago, Slut said: bump, localPathFinder only works within a certain area, kind've need a method that works over larger distances. You'll have to make your own web pathfinder for that EDIT: Or make a client suggestion for access to the webwalkers underlying pathfinder Edited April 9, 2018 by FrostBug
jasper078 Posted April 9, 2018 Posted April 9, 2018 9 hours ago, Slut said: bump, localPathFinder only works within a certain area, kind've need a method that works over larger distances. Tile flags are only available when a region is loaded, these are needed to decide whether or not something is reachable. You could dump the tile flags to work out if something is reachable over a larger area. 1
dreameo Posted April 10, 2018 Posted April 10, 2018 hmm you can try this: create a webwalkevent and use setsourcepos(Position p) <-- I believe this sets the starting pos? then do prefretchreq on event and true/false should let you know if it's reachable. 1