Interface IWalker
This interface handles automatic pathfinding across the game world, including:
- Walking to specific locations
- Building paths with collision detection
- Using teleports and transports (ships, gliders, etc.)
- Avoiding wilderness areas
- Caching and optimizing paths
Example usage:
IWalker walker = Static.getWalker();
WorldArea destination = new WorldArea(new WorldPoint(3222, 3218, 0), 5, 5);
walker.walkTo(destination, WalkOptions.builder().build(), 30000, 3);
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionLinkedHashMap<net.runelite.api.coords.WorldPoint, Teleport> buildExperimentalTeleportLinks(net.runelite.api.coords.WorldArea destination, WalkOptions options) Builds a map of available teleports to help reach a destination.default TilePathbuildPath(Collection<net.runelite.api.coords.WorldPoint> startPoints, List<net.runelite.api.coords.WorldArea> targetAreas, WalkOptions options) Builds a path from start points to any of the provided target areas.buildPath(Collection<net.runelite.api.coords.WorldPoint> startPoints, List<net.runelite.api.coords.WorldArea> targetAreas, WalkOptions options, HashMap<net.runelite.api.coords.WorldPoint, Teleport> teleports, Map<net.runelite.api.coords.WorldPoint, List<Transport>> transports) Builds a path from start points to any of the provided target areas.default TilePathbuildPath(Collection<net.runelite.api.coords.WorldPoint> startPoints, net.runelite.api.coords.WorldArea destination, CollisionMap collisionMap) Builds a path from multiple start points using default wilderness avoidance.default TilePathbuildPath(Collection<net.runelite.api.coords.WorldPoint> startPoints, net.runelite.api.coords.WorldArea destination, CollisionMap collisionMap, boolean avoidWilderness) Builds a path from multiple start points with wilderness avoidance option.default TilePathbuildPath(Collection<net.runelite.api.coords.WorldPoint> startPoints, net.runelite.api.coords.WorldArea destination, CollisionMap collisionMap, boolean avoidWilderness, boolean useCache) Builds a path with cache option.default TilePathbuildPath(Collection<net.runelite.api.coords.WorldPoint> startPoints, net.runelite.api.coords.WorldArea destination, CollisionMap collisionMap, boolean avoidWilderness, boolean useCache, boolean useTransports) Builds a path with transport and cache options.default TilePathbuildPath(Collection<net.runelite.api.coords.WorldPoint> startPoints, net.runelite.api.coords.WorldArea destination, CollisionMap collisionMap, boolean avoidWilderness, boolean useCache, boolean useTransports, HashMap<net.runelite.api.coords.WorldPoint, Teleport> teleports) Builds a path with full parameter control (legacy method).default TilePathbuildPath(Collection<net.runelite.api.coords.WorldPoint> startPoints, net.runelite.api.coords.WorldArea destination, WalkOptions options) Builds a path from start points to a destination with options.buildPath(Collection<net.runelite.api.coords.WorldPoint> startPoints, net.runelite.api.coords.WorldArea destination, WalkOptions options, HashMap<net.runelite.api.coords.WorldPoint, Teleport> teleports, Map<net.runelite.api.coords.WorldPoint, List<Transport>> transports) Builds a path from start points to a destination with full control.default TilePathbuildPath(List<net.runelite.api.coords.WorldArea> targetAreas, WalkOptions options) Builds a path from the player's current location to any of the provided target areas.default TilePathbuildPath(net.runelite.api.coords.WorldArea destination, CollisionMap collisionMap) Builds a path from the player's location using default wilderness avoidance.default TilePathbuildPath(net.runelite.api.coords.WorldArea destination, CollisionMap collisionMap, boolean avoidWilderness) Builds a path from the player's location with wilderness avoidance option.default TilePathbuildPath(net.runelite.api.coords.WorldArea destination, WalkOptions options) Builds a path from the player's current location to a destination.default LinkedHashMap<net.runelite.api.coords.WorldPoint, Teleport> buildTeleportLinks(net.runelite.api.coords.WorldArea destination) Builds a map of available teleports to help reach a destination with default options.LinkedHashMap<net.runelite.api.coords.WorldPoint, Teleport> buildTeleportLinks(net.runelite.api.coords.WorldArea destination, WalkOptions options) Deprecated.Builds a map of available transports with default options.buildTransportLinks(WalkOptions options) Builds a map of available transports (ships, gliders, etc.) based on options.Builds a map of ALL available teleports with default options.buildUnfilteredTeleportLinks(WalkOptions options) Builds a map of ALL available teleports without destination-based filtering.Gets the currently executing path.Gets the last built or executed path.default net.runelite.api.coords.WorldPointgetNearestWalkableTile(net.runelite.api.coords.WorldPoint source) Finds the nearest walkable tile from a source point.default net.runelite.api.coords.WorldPointgetNearestWalkableTile(net.runelite.api.coords.WorldPoint source, Predicate<net.runelite.api.coords.WorldPoint> filter) Finds the nearest walkable tile from a source point with a filter.default net.runelite.api.coords.WorldPointgetNearestWalkableTile(net.runelite.api.coords.WorldPoint source, CollisionMap collisionMap) Finds the nearest walkable tile from a source point with a specific collision map.net.runelite.api.coords.WorldPointgetNearestWalkableTile(net.runelite.api.coords.WorldPoint source, CollisionMap collisionMap, Predicate<net.runelite.api.coords.WorldPoint> filter) Finds the nearest walkable tile from a source point.voidsetCurrentPath(TilePath path) Sets the current path being executed.voidsetLastPath(TilePath path) Sets the last path for tracking purposes.voidwalk(net.runelite.api.coords.WorldPoint worldPoint) Walks to a specific world point.booleanwalkAlong(net.runelite.api.coords.WorldArea destination, TilePath path, Map<net.runelite.api.coords.WorldPoint, List<Transport>> transports, WalkOptions options) Executes walking along a pre-built path.booleanwalkTo(net.runelite.api.coords.WorldArea destination, CollisionMap collisionMap, boolean useTeleports) Walks to a destination area with collision detection and optional teleports.booleanwalkTo(net.runelite.api.coords.WorldArea destination, WalkOptions options) Walks to a destination area with advanced options.
-
Method Details
-
walk
void walk(net.runelite.api.coords.WorldPoint worldPoint) Walks to a specific world point.This is a simple walking method that clicks on the target point. For complex pathfinding, use
walkTo(WorldArea, WalkOptions)instead.- Parameters:
worldPoint- the destination point
-
walkTo
boolean walkTo(net.runelite.api.coords.WorldArea destination, CollisionMap collisionMap, boolean useTeleports) Walks to a destination area with collision detection and optional teleports.- Parameters:
destination- the destination areacollisionMap- the collision map for pathfindinguseTeleports- whether to use teleports- Returns:
- true if successfully started walking, false otherwise
-
walkTo
Walks to a destination area with advanced options.This is the main walking method that handles:
- Pathfinding with collision detection
- Using teleports and transports
- Avoiding wilderness
- Path caching for performance
- Parameters:
destination- the destination areaoptions- the walking options- Returns:
- true if successfully started walking, false otherwise
-
getCurrentPath
TilePath getCurrentPath()Gets the currently executing path.- Returns:
- the current path, or null if not walking
-
getLastPath
TilePath getLastPath()Gets the last built or executed path.- Returns:
- the last path, or null if no path was built
-
setLastPath
Sets the last path for tracking purposes.- Parameters:
path- the path to set
-
setCurrentPath
Sets the current path being executed.- Parameters:
path- the path to set
-
buildPath
TilePath buildPath(Collection<net.runelite.api.coords.WorldPoint> startPoints, net.runelite.api.coords.WorldArea destination, WalkOptions options, HashMap<net.runelite.api.coords.WorldPoint, Teleport> teleports, Map<net.runelite.api.coords.WorldPoint, List<Transport>> transports) Builds a path from start points to a destination with full control.This is the core pathfinding method that creates a
TilePathusing:- Collision detection from the collision map
- Available teleports (spells, items, etc.)
- Available transports (ships, gliders, etc.)
- Path optimization and caching
- Parameters:
startPoints- possible starting points for the pathdestination- the destination areaoptions- walking options (collision map, wilderness avoidance, etc.)teleports- available teleports mapped by destinationtransports- available transports mapped by source location- Returns:
- the computed path, or null if no path found
-
buildPath
default TilePath buildPath(Collection<net.runelite.api.coords.WorldPoint> startPoints, net.runelite.api.coords.WorldArea destination, WalkOptions options) Builds a path from start points to a destination with options.Automatically determines available teleports based on the destination.
- Parameters:
startPoints- possible starting points for the pathdestination- the destination areaoptions- walking options- Returns:
- the computed path, or null if no path found
-
buildPath
Builds a path from the player's current location to a destination.Convenience method that uses the local player's position as the starting point.
- Parameters:
destination- the destination areaoptions- walking options- Returns:
- the computed path, or null if no path found
-
buildPath
default TilePath buildPath(Collection<net.runelite.api.coords.WorldPoint> startPoints, net.runelite.api.coords.WorldArea destination, CollisionMap collisionMap, boolean avoidWilderness, boolean useCache, boolean useTransports, HashMap<net.runelite.api.coords.WorldPoint, Teleport> teleports) Builds a path with full parameter control (legacy method).- Parameters:
startPoints- possible starting pointsdestination- the destination areacollisionMap- the collision mapavoidWilderness- whether to avoid wildernessuseCache- whether to use path cachinguseTransports- whether to use transportsteleports- available teleports- Returns:
- the computed path, or null if no path found
-
buildPath
default TilePath buildPath(net.runelite.api.coords.WorldArea destination, CollisionMap collisionMap, boolean avoidWilderness) Builds a path from the player's location with wilderness avoidance option.- Parameters:
destination- the destination areacollisionMap- the collision mapavoidWilderness- whether to avoid wilderness- Returns:
- the computed path, or null if no path found
-
buildPath
default TilePath buildPath(net.runelite.api.coords.WorldArea destination, CollisionMap collisionMap) Builds a path from the player's location using default wilderness avoidance.- Parameters:
destination- the destination areacollisionMap- the collision map- Returns:
- the computed path, or null if no path found
-
buildPath
default TilePath buildPath(Collection<net.runelite.api.coords.WorldPoint> startPoints, net.runelite.api.coords.WorldArea destination, CollisionMap collisionMap) Builds a path from multiple start points using default wilderness avoidance.- Parameters:
startPoints- possible starting pointsdestination- the destination areacollisionMap- the collision map- Returns:
- the computed path, or null if no path found
-
buildPath
default TilePath buildPath(Collection<net.runelite.api.coords.WorldPoint> startPoints, net.runelite.api.coords.WorldArea destination, CollisionMap collisionMap, boolean avoidWilderness) Builds a path from multiple start points with wilderness avoidance option.- Parameters:
startPoints- possible starting pointsdestination- the destination areacollisionMap- the collision mapavoidWilderness- whether to avoid wilderness- Returns:
- the computed path, or null if no path found
-
buildPath
default TilePath buildPath(Collection<net.runelite.api.coords.WorldPoint> startPoints, net.runelite.api.coords.WorldArea destination, CollisionMap collisionMap, boolean avoidWilderness, boolean useCache) Builds a path with cache option.- Parameters:
startPoints- possible starting pointsdestination- the destination areacollisionMap- the collision mapavoidWilderness- whether to avoid wildernessuseCache- whether to use path caching- Returns:
- the computed path, or null if no path found
-
buildPath
default TilePath buildPath(Collection<net.runelite.api.coords.WorldPoint> startPoints, net.runelite.api.coords.WorldArea destination, CollisionMap collisionMap, boolean avoidWilderness, boolean useCache, boolean useTransports) Builds a path with transport and cache options.- Parameters:
startPoints- possible starting pointsdestination- the destination areacollisionMap- the collision mapavoidWilderness- whether to avoid wildernessuseCache- whether to use path cachinguseTransports- whether to use transports- Returns:
- the computed path, or null if no path found
-
walkAlong
boolean walkAlong(net.runelite.api.coords.WorldArea destination, TilePath path, Map<net.runelite.api.coords.WorldPoint, List<Transport>> transports, WalkOptions options) Executes walking along a pre-built path.This method handles the actual walking execution, including:
- Following the path tiles
- Using transports when encountered
- Handling obstacles and recalculation
- Parameters:
destination- the destination areapath- the pre-built path to followtransports- available transportsoptions- walking options- Returns:
- true if successfully walking, false otherwise
-
buildTransportLinks
Builds a map of available transports (ships, gliders, etc.) based on options.Transports are mapped by their source location. Multiple transports may be available from the same location.
- Parameters:
options- walking options (requirements, filters, etc.)- Returns:
- map of transports by source location
-
buildTransportLinks
Builds a map of available transports with default options.- Returns:
- map of transports by source location
-
buildTeleportLinks
LinkedHashMap<net.runelite.api.coords.WorldPoint,Teleport> buildTeleportLinks(net.runelite.api.coords.WorldArea destination, WalkOptions options) Deprecated.Builds a map of available teleports to help reach a destination (legacy method).- Parameters:
destination- the destination areaoptions- walking options- Returns:
- map of teleports by destination location
-
buildExperimentalTeleportLinks
LinkedHashMap<net.runelite.api.coords.WorldPoint,Teleport> buildExperimentalTeleportLinks(net.runelite.api.coords.WorldArea destination, WalkOptions options) Builds a map of available teleports to help reach a destination.Teleports include:
- Magic spells (standard, ancient, lunar)
- Teleport items (tabs, jewelry, etc.)
- Player-owned house teleports
- Fairy rings, spirit trees, etc.
- Parameters:
destination- the destination areaoptions- walking options (requirements, filters, etc.)- Returns:
- map of teleports by destination location
-
buildTeleportLinks
default LinkedHashMap<net.runelite.api.coords.WorldPoint,Teleport> buildTeleportLinks(net.runelite.api.coords.WorldArea destination) Builds a map of available teleports to help reach a destination with default options.- Parameters:
destination- the destination area- Returns:
- map of teleports by destination location
-
getNearestWalkableTile
net.runelite.api.coords.WorldPoint getNearestWalkableTile(net.runelite.api.coords.WorldPoint source, CollisionMap collisionMap, Predicate<net.runelite.api.coords.WorldPoint> filter) Finds the nearest walkable tile from a source point.This method searches for the closest tile that:
- Is walkable (not blocked by collision)
- Passes the filter predicate
- Parameters:
source- the starting pointcollisionMap- the collision map to usefilter- a filter to apply to candidate tiles- Returns:
- the nearest walkable tile, or null if none found
-
getNearestWalkableTile
default net.runelite.api.coords.WorldPoint getNearestWalkableTile(net.runelite.api.coords.WorldPoint source, Predicate<net.runelite.api.coords.WorldPoint> filter) Finds the nearest walkable tile from a source point with a filter.- Parameters:
source- the starting pointfilter- a filter to apply to candidate tiles- Returns:
- the nearest walkable tile, or null if none found
-
getNearestWalkableTile
default net.runelite.api.coords.WorldPoint getNearestWalkableTile(net.runelite.api.coords.WorldPoint source) Finds the nearest walkable tile from a source point.- Parameters:
source- the starting point- Returns:
- the nearest walkable tile, or null if none found
-
getNearestWalkableTile
default net.runelite.api.coords.WorldPoint getNearestWalkableTile(net.runelite.api.coords.WorldPoint source, CollisionMap collisionMap) Finds the nearest walkable tile from a source point with a specific collision map.- Parameters:
source- the starting pointcollisionMap- the collision map to use- Returns:
- the nearest walkable tile, or null if none found
-
buildPath
TilePath buildPath(Collection<net.runelite.api.coords.WorldPoint> startPoints, List<net.runelite.api.coords.WorldArea> targetAreas, WalkOptions options, HashMap<net.runelite.api.coords.WorldPoint, Teleport> teleports, Map<net.runelite.api.coords.WorldPoint, List<Transport>> transports) Builds a path from start points to any of the provided target areas.This method finds the shortest path to ANY of the provided target areas, useful for finding the nearest of multiple destinations (e.g., nearest bank). The pathfinder will return the path to whichever target area is closest.
- Parameters:
startPoints- possible starting points for the pathtargetAreas- list of target areas - path will go to the nearest oneoptions- walking options (collision map, wilderness avoidance, etc.)teleports- available teleports mapped by destinationtransports- available transports mapped by source location- Returns:
- the computed path to the nearest target, or null if no path found
-
buildPath
default TilePath buildPath(Collection<net.runelite.api.coords.WorldPoint> startPoints, List<net.runelite.api.coords.WorldArea> targetAreas, WalkOptions options) Builds a path from start points to any of the provided target areas.Convenience method that automatically builds transport and teleport links.
- Parameters:
startPoints- possible starting points for the pathtargetAreas- list of target areas - path will go to the nearest oneoptions- walking options- Returns:
- the computed path to the nearest target, or null if no path found
-
buildPath
default TilePath buildPath(List<net.runelite.api.coords.WorldArea> targetAreas, WalkOptions options) Builds a path from the player's current location to any of the provided target areas.Convenience method that uses the local player's position as the starting point.
- Parameters:
targetAreas- list of target areas - path will go to the nearest oneoptions- walking options- Returns:
- the computed path to the nearest target, or null if no path found
-
buildUnfilteredTeleportLinks
HashMap<net.runelite.api.coords.WorldPoint,Teleport> buildUnfilteredTeleportLinks(WalkOptions options) Builds a map of ALL available teleports without destination-based filtering.Unlike
buildExperimentalTeleportLinks(WorldArea, WalkOptions)which filters and weights teleports based on proximity to a single destination, this method returns ALL available teleports. This is useful for multi-area pathfinding where the destination is not known in advance.Basic filters still apply:
- Teleports too close to the player (< 30 tiles) unless forceLoad is set
- Home teleports if disabled in options
- Minigame teleports if disabled in options
- Parameters:
options- walking options (home teleport, minigame teleport settings, etc.)- Returns:
- map of all available teleports by destination location
-
buildUnfilteredTeleportLinks
Builds a map of ALL available teleports with default options.- Returns:
- map of all available teleports by destination location
-
buildExperimentalTeleportLinks(WorldArea, WalkOptions)instead