Class Walker

java.lang.Object
net.storm.sdk.movement.Walker

public class Walker extends Object
Provides low-level pathfinding and walking utilities for advanced movement control.

This class offers more granular control over the pathfinding system compared to Movement. It provides methods to build paths, manage transport links, configure teleport options, and walk along pre-calculated paths.

Key features include:

  • Path building: Calculate paths with custom options
  • Transport links: Build and use transport connections (boats, carts, etc.)
  • Teleport links: Calculate optimal teleport destinations
  • Path management: Track current and last calculated paths

Example Usage:


 // Build a path with custom options
 WalkOptions options = new WalkOptions();
 options.setAvoidWilderness(true);
 TilePath path = Walker.buildPath(destination.toWorldArea(), options);

 // Walk along a pre-built path
 Map<WorldPoint, List<Transport>> transports = Walker.buildTransportLinks();
 Walker.walkAlong(destination, path, transports, options);

 // Get teleport links to a destination
 LinkedHashMap<WorldPoint, Teleport> teleports = Walker.buildTeleportLinks(destination);

 // Invalidate cached paths when needed
 Walker.invalidatePath();

 // Check the current path being walked
 TilePath currentPath = Walker.getCurrentPath();
 
See Also:
  • Constructor Details

    • Walker

      public Walker()
  • Method Details

    • walkTo

      public static boolean walkTo(net.runelite.api.coords.WorldArea destination, CollisionMap collisionMap, boolean useTeleports)
      Pathfinds and walks to a destination using a custom collision map.
      Parameters:
      destination - the destination area
      collisionMap - the collision map to use for pathfinding
      useTeleports - whether to consider teleports in the path
      Returns:
      true if a complete path was found, false if only a partial path
    • walkTo

      public static boolean walkTo(net.runelite.api.coords.WorldArea destination, WalkOptions options)
      Pathfinds and walks to a destination using custom walk options.
      Parameters:
      destination - the destination area
      options - custom walk options for path calculation
      Returns:
      true if a complete path was found, false if only a partial path
    • walkTo

      public static boolean walkTo(net.runelite.api.coords.WorldPoint destination, WalkOptions options)
      Pathfinds and walks to a destination point using custom walk options.
      Parameters:
      destination - the destination point
      options - custom walk options for path calculation
      Returns:
      true if a complete path was found, false if only a partial path
    • getCurrentPath

      public static TilePath getCurrentPath()
      Retrieves the path currently being walked.
      Returns:
      the current tile path, or null if not currently walking a path
    • getLastPath

      public static TilePath getLastPath()
      Retrieves the last calculated path.
      Returns:
      the last tile path calculated, or null if no path has been calculated
    • invalidatePath

      public static void invalidatePath()
      Invalidates both the current and last cached paths.

      Call this method when the game state changes in a way that would invalidate previously calculated paths (e.g., after teleporting).

    • walkAlong

      public static boolean walkAlong(net.runelite.api.coords.WorldArea destination, TilePath path, Map<net.runelite.api.coords.WorldPoint,List<Transport>> transports, WalkOptions options)
      Walks along a pre-calculated path using the specified transports and options.
      Parameters:
      destination - the final destination area
      path - the pre-calculated tile path to follow
      transports - map of transport links available for use
      options - custom walk options
      Returns:
      true if successfully walking the path, false otherwise
    • buildPath

      @Deprecated public static TilePath buildPath(net.runelite.api.coords.WorldArea destination, CollisionMap collisionMap, boolean avoidWilderness)
      Deprecated.
      Use buildPath(WorldArea, WalkOptions) with WalkOptions instead
      Builds a path to the destination using a custom collision map.
      Parameters:
      destination - the destination area
      collisionMap - the collision map to use
      avoidWilderness - whether to avoid wilderness areas
      Returns:
      the calculated tile path
    • buildPath

      @Deprecated public static TilePath buildPath(net.runelite.api.coords.WorldArea destination, CollisionMap collisionMap)
      Deprecated.
      Use buildPath(WorldArea, WalkOptions) with WalkOptions instead
      Builds a path to the destination using a custom collision map.
      Parameters:
      destination - the destination area
      collisionMap - the collision map to use
      Returns:
      the calculated tile path
    • buildPath

      @Deprecated public static TilePath buildPath(Collection<net.runelite.api.coords.WorldPoint> startPoints, net.runelite.api.coords.WorldArea destination, CollisionMap collisionMap)
      Deprecated.
      Builds a path from multiple starting points to the destination.
      Parameters:
      startPoints - the collection of possible starting points
      destination - the destination area
      collisionMap - the collision map to use
      Returns:
      the calculated tile path from the optimal starting point
    • buildPath

      @Deprecated public static TilePath buildPath(Collection<net.runelite.api.coords.WorldPoint> startPoints, net.runelite.api.coords.WorldArea destination, CollisionMap collisionMap, boolean avoidWilderness)
      Deprecated.
      Builds a path from multiple starting points with wilderness avoidance option.
      Parameters:
      startPoints - the collection of possible starting points
      destination - the destination area
      collisionMap - the collision map to use
      avoidWilderness - whether to avoid wilderness areas
      Returns:
      the calculated tile path
    • buildPath

      @Deprecated public static TilePath buildPath(Collection<net.runelite.api.coords.WorldPoint> startPoints, net.runelite.api.coords.WorldArea destination, CollisionMap collisionMap, boolean avoidWilderness, boolean useCache)
      Deprecated.
      Builds a path with caching option.
      Parameters:
      startPoints - the collection of possible starting points
      destination - the destination area
      collisionMap - the collision map to use
      avoidWilderness - whether to avoid wilderness areas
      useCache - whether to use cached path data
      Returns:
      the calculated tile path
    • buildPath

      @Deprecated public static TilePath buildPath(Collection<net.runelite.api.coords.WorldPoint> startPoints, net.runelite.api.coords.WorldArea destination, CollisionMap collisionMap, boolean avoidWilderness, boolean useCache, boolean useTransports)
      Deprecated.
      Builds a path with transport option.
      Parameters:
      startPoints - the collection of possible starting points
      destination - the destination area
      collisionMap - the collision map to use
      avoidWilderness - whether to avoid wilderness areas
      useCache - whether to use cached path data
      useTransports - whether to include transport links
      Returns:
      the calculated tile path
    • buildPath

      @Deprecated public static 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 teleport support.
      Parameters:
      startPoints - the collection of possible starting points
      destination - the destination area
      collisionMap - the collision map to use
      avoidWilderness - whether to avoid wilderness areas
      useCache - whether to use cached path data
      useTransports - whether to include transport links
      teleports - map of teleport destinations to teleport objects
      Returns:
      the calculated tile path
    • buildPath

      public static 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, HashMap<net.runelite.api.coords.WorldPoint,List<Transport>> transports)
      Builds a path with full customization using walk options, teleports, and transports.
      Parameters:
      startPoints - the collection of possible starting points
      destination - the destination area
      options - custom walk options
      teleports - map of teleport destinations to teleport objects
      transports - map of transport source points to available transports
      Returns:
      the calculated tile path
    • buildPath

      public static TilePath buildPath(Collection<net.runelite.api.coords.WorldPoint> startPoints, net.runelite.api.coords.WorldArea destination, WalkOptions options)
      Builds a path from multiple starting points using custom walk options.
      Parameters:
      startPoints - the collection of possible starting points
      destination - the destination area
      options - custom walk options
      Returns:
      the calculated tile path
    • buildPath

      public static TilePath buildPath(net.runelite.api.coords.WorldArea destination, WalkOptions options)
      Builds a path to a destination using custom walk options.
      Parameters:
      destination - the destination area
      options - custom walk options
      Returns:
      the calculated tile path
    • buildTransportLinks

      public static Map<net.runelite.api.coords.WorldPoint,List<Transport>> buildTransportLinks(WalkOptions options)
      Builds a map of all available transport links using custom walk options.

      Transport links include shortcuts, agility obstacles, boats, carts, and other methods of non-walking movement between areas.

      Parameters:
      options - custom walk options to filter transports
      Returns:
      a map of source points to available transports from those points
    • buildTransportLinks

      public static Map<net.runelite.api.coords.WorldPoint,List<Transport>> buildTransportLinks()
      Builds a map of all available transport links using default options.
      Returns:
      a map of source points to available transports from those points
    • buildTeleportLinks

      public static LinkedHashMap<net.runelite.api.coords.WorldPoint,Teleport> buildTeleportLinks(net.runelite.api.coords.WorldArea destination, WalkOptions options)
      Builds a map of teleport destinations that could help reach the destination.
      Parameters:
      destination - the target destination
      options - custom walk options to filter teleports
      Returns:
      an ordered map of teleport destinations to teleport objects
    • buildTeleportLinks

      public static LinkedHashMap<net.runelite.api.coords.WorldPoint,Teleport> buildTeleportLinks(net.runelite.api.coords.WorldArea destination)
      Builds a map of teleport destinations using default options.
      Parameters:
      destination - the target destination
      Returns:
      an ordered map of teleport destinations to teleport objects
    • buildExperimentalTeleportLinks

      @Deprecated public static LinkedHashMap<net.runelite.api.coords.WorldPoint,Teleport> buildExperimentalTeleportLinks(net.runelite.api.coords.WorldArea destination, WalkOptions options)
      Deprecated.
      This method is experimental and may be removed or changed
      Builds experimental teleport links with advanced optimization.
      Parameters:
      destination - the target destination
      options - custom walk options
      Returns:
      an ordered map of teleport destinations to teleport objects