Class Movement

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

public class Movement extends Object
Provides comprehensive movement and pathfinding utilities for navigating the game world.

This class serves as the primary interface for all movement-related operations, including direct walking, pathfinding, run energy management, and distance calculations. It supports both simple direct movement and complex pathfinding using the global collision map.

Key features include:

  • Direct walking: Force walk to specific coordinates
  • Pathfinding: Calculate optimal paths using collision data
  • Teleport integration: Use teleports as part of path calculations
  • Distance calculation: Calculate tile distances between points
  • Run management: Toggle run mode and check stamina status

Example Usage:


 // Simple walk to a world point
 WorldPoint destination = new WorldPoint(3200, 3200, 0);
 Movement.walk(destination);

 // Pathfind to a location with collision avoidance
 boolean fullPath = Movement.walkTo(destination);
 if (!fullPath) {
     // Only a partial path was found
 }

 // Walk to a bank location
 Movement.walkTo(BankLocation.GRAND_EXCHANGE);

 // Check and toggle run
 if (!Movement.isRunEnabled() && Movement.getRunEnergy() > 50) {
     Movement.toggleRun();
 }

 // Calculate distance to a destination
 int distance = Movement.calculateDistance(destination);

 // Get the full path for custom handling
 TilePath path = Movement.getPath(destination);
 
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static int
    calculateDistance(List<net.runelite.api.coords.WorldPoint> start, net.runelite.api.coords.WorldArea destination)
    Calculates the shortest tile distance from multiple starting points to a destination.
    static int
    calculateDistance(List<net.runelite.api.coords.WorldPoint> start, net.runelite.api.coords.WorldPoint destination)
    Calculates the shortest tile distance from multiple starting points to a destination point.
    static int
    calculateDistance(net.runelite.api.coords.WorldArea destination)
    Calculates the tile distance from the local player to a destination area.
    static int
    calculateDistance(net.runelite.api.coords.WorldPoint destination)
    Calculates the tile distance from the local player to a destination point.
    static int
    calculateDistance(net.runelite.api.coords.WorldPoint start, net.runelite.api.coords.WorldArea destination)
    Calculates the tile distance from a starting point to a destination area.
    static int
    calculateDistance(net.runelite.api.coords.WorldPoint start, net.runelite.api.coords.WorldPoint destination)
    Calculates the tile distance between two points.
    static net.runelite.api.coords.WorldPoint
    Retrieves the current movement destination.
    static net.runelite.api.coords.WorldPoint
    getNearestWalkableTile(net.runelite.api.coords.WorldPoint source)
    Finds the nearest walkable tile to a source point.
    static net.runelite.api.coords.WorldPoint
    getNearestWalkableTile(net.runelite.api.coords.WorldPoint source, Predicate<net.runelite.api.coords.WorldPoint> filter)
    Finds the nearest walkable tile to a source point.
    static net.runelite.api.coords.WorldPoint
    getNearestWalkableTile(net.runelite.api.coords.WorldPoint source, CollisionMap collisionMap)
    Finds the nearest walkable tile using a custom collision map.
    static 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 using a custom collision map.
    static TilePath
    getPath(Collection<net.runelite.api.coords.WorldPoint> startPoints, net.runelite.api.coords.WorldArea destination)
    Calculates a path from multiple starting points to a destination area.
    static TilePath
    getPath(Collection<net.runelite.api.coords.WorldPoint> startPoints, net.runelite.api.coords.WorldArea destination, boolean useCache)
    Calculates a path with optional caching.
    static TilePath
    getPath(Collection<net.runelite.api.coords.WorldPoint> startPoints, net.runelite.api.coords.WorldArea destination, CollisionMap collisionMap)
    Calculates a path from multiple starting points to a destination area using a custom collision map.
    static TilePath
    getPath(Collection<net.runelite.api.coords.WorldPoint> startPoints, net.runelite.api.coords.WorldArea destination, CollisionMap collisionMap, boolean useCache)
    Calculates a path using a custom collision map with optional caching.
    static TilePath
    getPath(Collection<net.runelite.api.coords.WorldPoint> startPoints, net.runelite.api.coords.WorldArea destination, CollisionMap collisionMap, boolean useCache, boolean useTransports)
    Calculates a path with transport and caching options.
    static TilePath
    getPath(Collection<net.runelite.api.coords.WorldPoint> startPoints, net.runelite.api.coords.WorldArea destination, CollisionMap collisionMap, boolean useCache, boolean useTransports, HashMap<net.runelite.api.coords.WorldPoint,Teleport> teleports)
    Calculates a path with full customization options including teleports.
    static TilePath
    getPath(Collection<net.runelite.api.coords.WorldPoint> startPoints, net.runelite.api.coords.WorldArea destination, WalkOptions options, HashMap<net.runelite.api.coords.WorldPoint,Teleport> teleports)
    Calculates a path using custom walk options and teleports.
    static TilePath
    getPath(Collection<net.runelite.api.coords.WorldPoint> startPoints, net.runelite.api.coords.WorldPoint destination)
    Calculates a path from multiple starting points to a destination.
    static TilePath
    getPath(Collection<net.runelite.api.coords.WorldPoint> startPoints, net.runelite.api.coords.WorldPoint destination, CollisionMap collisionMap)
    Calculates a path from multiple starting points to a destination using a custom collision map.
    static TilePath
    getPath(net.runelite.api.coords.WorldArea destination)
    Calculates a path from the local player to a destination area.
    static TilePath
    getPath(net.runelite.api.coords.WorldArea destination, CollisionMap collisionMap)
    Calculates a path from the local player to a destination area using a custom collision map.
    static TilePath
    getPath(net.runelite.api.coords.WorldPoint destination)
    Calculates a path from the local player to a destination point.
    static TilePath
    getPath(net.runelite.api.coords.WorldPoint destination, CollisionMap collisionMap)
    Calculates a path from the local player to a destination using a custom collision map.
    static int
    Retrieves the player's current run energy.
    static boolean
    Checks whether run mode is currently enabled.
    static boolean
    Checks whether the stamina boost effect is currently active.
    static boolean
    Checks whether the local player is currently walking or running.
    static void
    setDestination(int sceneX, int sceneY)
    Force walks to a specific scene coordinate.
    static void
    Toggles run mode on or off via the minimap orb.
    static void
    walk(net.runelite.api.coords.WorldPoint worldPoint)
    Force walks directly to a world point without pathfinding.
    static void
    walk(Locatable locatable)
    Force walks directly to a locatable entity without pathfinding.
    static boolean
    walkTo(int x, int y)
    Pathfinds and walks to world coordinates using the global collision map.
    static boolean
    walkTo(int x, int y, int plane)
    Pathfinds and walks to world coordinates on a specific plane.
    static boolean
    walkTo(net.runelite.api.coords.WorldArea worldArea)
    Pathfinds and walks to a world area using the global collision map.
    static boolean
    walkTo(net.runelite.api.coords.WorldArea worldArea, Boolean useTeleports)
    Pathfinds and walks to a world area with teleport option.
    static boolean
    walkTo(net.runelite.api.coords.WorldArea worldArea, CollisionMap collisionMap)
    Pathfinds and walks to a world area using a custom collision map.
    static boolean
    walkTo(net.runelite.api.coords.WorldArea worldArea, CollisionMap collisionMap, Boolean useTeleports)
    Pathfinds and walks to a world area using a custom collision map with teleport option.
    static boolean
    walkTo(net.runelite.api.coords.WorldArea destination, WalkOptions options)
    Pathfinds and walks to a destination using custom walk options.
    static boolean
    walkTo(net.runelite.api.coords.WorldPoint worldPoint)
    Pathfinds and walks to a world point using the global collision map.
    static boolean
    walkTo(net.runelite.api.coords.WorldPoint worldPoint, boolean useTeleports)
    Pathfinds and walks to a world point with teleport option.
    static boolean
    walkTo(net.runelite.api.coords.WorldPoint worldPoint, CollisionMap collisionMap)
    Pathfinds and walks to a world point using a custom collision map.
    static boolean
    walkTo(net.runelite.api.coords.WorldPoint worldPoint, CollisionMap collisionMap, boolean useTeleports)
    Pathfinds and walks to a world point using a custom collision map with teleport option.
    static boolean
    walkTo(net.runelite.api.coords.WorldPoint destination, WalkOptions options)
    Pathfinds and walks to a destination using custom walk options.
    static boolean
    walkTo(Locatable locatable)
    Pathfinds and walks to a locatable entity using the global collision map.
    static boolean
    walkTo(BankLocation bankLocation)
    Pathfinds and walks to a bank location using the global collision map.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Movement

      public Movement()
  • Method Details

    • setDestination

      public static void setDestination(int sceneX, int sceneY)
      Force walks to a specific scene coordinate.

      Scene coordinates are relative to the current loaded region, not world coordinates.

      Parameters:
      sceneX - the scene X coordinate
      sceneY - the scene Y coordinate
    • getDestination

      @Nullable public static net.runelite.api.coords.WorldPoint getDestination()
      Retrieves the current movement destination.
      Returns:
      the current destination as a WorldPoint, or null if not currently moving
    • isWalking

      public static boolean isWalking()
      Checks whether the local player is currently walking or running.
      Returns:
      true if the player is currently moving, false otherwise
    • walk

      public static void walk(net.runelite.api.coords.WorldPoint worldPoint)
      Force walks directly to a world point without pathfinding.

      This method does not consider obstacles and simply sets the destination. Use walkTo(WorldPoint) for pathfinding.

      Parameters:
      worldPoint - the destination point
    • walkTo

      public static boolean walkTo(net.runelite.api.coords.WorldPoint worldPoint, CollisionMap collisionMap)
      Pathfinds and walks to a world point using a custom collision map.
      Parameters:
      worldPoint - the destination point
      collisionMap - the collision map to use for pathfinding
      Returns:
      true if a complete path to the destination was found, false if only a partial path
    • walkTo

      public static boolean walkTo(net.runelite.api.coords.WorldPoint worldPoint, CollisionMap collisionMap, boolean useTeleports)
      Pathfinds and walks to a world point using a custom collision map with teleport option.
      Parameters:
      worldPoint - the destination point
      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.WorldPoint worldPoint, boolean useTeleports)
      Pathfinds and walks to a world point with teleport option.
      Parameters:
      worldPoint - the destination point
      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 worldArea, CollisionMap collisionMap)
      Pathfinds and walks to a world area using a custom collision map.
      Parameters:
      worldArea - the destination area
      collisionMap - the collision map to use for pathfinding
      Returns:
      true if a complete path was found, false if only a partial path
    • walkTo

      public static boolean walkTo(net.runelite.api.coords.WorldArea worldArea, Boolean useTeleports)
      Pathfinds and walks to a world area with teleport option.
      Parameters:
      worldArea - the destination area
      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 worldArea, CollisionMap collisionMap, Boolean useTeleports)
      Pathfinds and walks to a world area using a custom collision map with teleport option.
      Parameters:
      worldArea - 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 worldArea)
      Pathfinds and walks to a world area using the global collision map.
      Parameters:
      worldArea - the destination area
      Returns:
      true if a complete path was found, false if only a partial path
    • walk

      public static void walk(Locatable locatable)
      Force walks directly to a locatable entity without pathfinding.
      Parameters:
      locatable - the destination entity (NPC, player, object, etc.)
    • walkTo

      public static boolean walkTo(net.runelite.api.coords.WorldPoint worldPoint)
      Pathfinds and walks to a world point using the global collision map.
      Parameters:
      worldPoint - the destination point
      Returns:
      true if a complete path was found, false if only a partial path
    • walkTo

      public static boolean walkTo(Locatable locatable)
      Pathfinds and walks to a locatable entity using the global collision map.
      Parameters:
      locatable - the destination entity
      Returns:
      true if a complete path was found, false if only a partial path
    • walkTo

      public static boolean walkTo(BankLocation bankLocation)
      Pathfinds and walks to a bank location using the global collision map.
      Parameters:
      bankLocation - the destination bank
      Returns:
      true if a complete path was found, false if only a partial path
    • walkTo

      public static boolean walkTo(int x, int y)
      Pathfinds and walks to world coordinates using the global collision map.

      Uses the current plane of the player.

      Parameters:
      x - the destination world X coordinate
      y - the destination world Y coordinate
      Returns:
      true if a complete path was found, false if only a partial path
    • walkTo

      public static boolean walkTo(int x, int y, int plane)
      Pathfinds and walks to world coordinates on a specific plane.
      Parameters:
      x - the destination world X coordinate
      y - the destination world Y coordinate
      plane - the destination plane (0-3)
      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 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
    • isRunEnabled

      public static boolean isRunEnabled()
      Checks whether run mode is currently enabled.
      Returns:
      true if run is enabled, false if walking
    • toggleRun

      public static void toggleRun()
      Toggles run mode on or off via the minimap orb.
    • isStaminaBoosted

      public static boolean isStaminaBoosted()
      Checks whether the stamina boost effect is currently active.

      The stamina effect reduces run energy drain rate.

      Returns:
      true if stamina boost is active, false otherwise
    • getRunEnergy

      public static int getRunEnergy()
      Retrieves the player's current run energy.
      Returns:
      the current run energy (0-100)
    • calculateDistance

      public static int calculateDistance(net.runelite.api.coords.WorldArea destination)
      Calculates the tile distance from the local player to a destination area.
      Parameters:
      destination - the destination area
      Returns:
      the number of tiles in the path to the destination
    • calculateDistance

      public static int calculateDistance(net.runelite.api.coords.WorldPoint start, net.runelite.api.coords.WorldArea destination)
      Calculates the tile distance from a starting point to a destination area.
      Parameters:
      start - the starting point
      destination - the destination area
      Returns:
      the number of tiles in the path
    • calculateDistance

      public static int calculateDistance(List<net.runelite.api.coords.WorldPoint> start, net.runelite.api.coords.WorldArea destination)
      Calculates the shortest tile distance from multiple starting points to a destination.
      Parameters:
      start - the collection of starting points
      destination - the destination area
      Returns:
      the number of tiles in the shortest path
    • calculateDistance

      public static int calculateDistance(net.runelite.api.coords.WorldPoint destination)
      Calculates the tile distance from the local player to a destination point.
      Parameters:
      destination - the destination point
      Returns:
      the number of tiles in the path
    • calculateDistance

      public static int calculateDistance(net.runelite.api.coords.WorldPoint start, net.runelite.api.coords.WorldPoint destination)
      Calculates the tile distance between two points.
      Parameters:
      start - the starting point
      destination - the destination point
      Returns:
      the number of tiles in the path
    • calculateDistance

      public static int calculateDistance(List<net.runelite.api.coords.WorldPoint> start, net.runelite.api.coords.WorldPoint destination)
      Calculates the shortest tile distance from multiple starting points to a destination point.
      Parameters:
      start - the collection of starting points
      destination - the destination point
      Returns:
      the number of tiles in the shortest path
    • getPath

      public static TilePath getPath(net.runelite.api.coords.WorldPoint destination)
      Calculates a path from the local player to a destination point.
      Parameters:
      destination - the destination point
      Returns:
      the calculated tile path
    • getPath

      public static TilePath getPath(net.runelite.api.coords.WorldPoint destination, CollisionMap collisionMap)
      Calculates a path from the local player to a destination using a custom collision map.
      Parameters:
      destination - the destination point
      collisionMap - the collision map to use
      Returns:
      the calculated tile path
    • getPath

      public static TilePath getPath(Collection<net.runelite.api.coords.WorldPoint> startPoints, net.runelite.api.coords.WorldPoint destination)
      Calculates a path from multiple starting points to a destination.
      Parameters:
      startPoints - the collection of starting points
      destination - the destination point
      Returns:
      the calculated tile path from the optimal starting point
    • getPath

      public static TilePath getPath(Collection<net.runelite.api.coords.WorldPoint> startPoints, net.runelite.api.coords.WorldPoint destination, CollisionMap collisionMap)
      Calculates a path from multiple starting points to a destination using a custom collision map.
      Parameters:
      startPoints - the collection of starting points
      destination - the destination point
      collisionMap - the collision map to use
      Returns:
      the calculated tile path
    • getPath

      public static TilePath getPath(net.runelite.api.coords.WorldArea destination)
      Calculates a path from the local player to a destination area.
      Parameters:
      destination - the destination area
      Returns:
      the calculated tile path
    • getPath

      public static TilePath getPath(net.runelite.api.coords.WorldArea destination, CollisionMap collisionMap)
      Calculates a path from the local player to a destination area using a custom collision map.
      Parameters:
      destination - the destination area
      collisionMap - the collision map to use
      Returns:
      the calculated tile path
    • getPath

      public static TilePath getPath(Collection<net.runelite.api.coords.WorldPoint> startPoints, net.runelite.api.coords.WorldArea destination)
      Calculates a path from multiple starting points to a destination area.
      Parameters:
      startPoints - the collection of starting points
      destination - the destination area
      Returns:
      the calculated tile path
    • getPath

      public static TilePath getPath(Collection<net.runelite.api.coords.WorldPoint> startPoints, net.runelite.api.coords.WorldArea destination, CollisionMap collisionMap)
      Calculates a path from multiple starting points to a destination area using a custom collision map.
      Parameters:
      startPoints - the collection of starting points
      destination - the destination area
      collisionMap - the collision map to use
      Returns:
      the calculated tile path
    • getPath

      public static TilePath getPath(Collection<net.runelite.api.coords.WorldPoint> startPoints, net.runelite.api.coords.WorldArea destination, boolean useCache)
      Calculates a path with optional caching.
      Parameters:
      startPoints - the collection of starting points
      destination - the destination area
      useCache - whether to use cached path data
      Returns:
      the calculated tile path
    • getPath

      public static TilePath getPath(Collection<net.runelite.api.coords.WorldPoint> startPoints, net.runelite.api.coords.WorldArea destination, CollisionMap collisionMap, boolean useCache)
      Calculates a path using a custom collision map with optional caching.
      Parameters:
      startPoints - the collection of starting points
      destination - the destination area
      collisionMap - the collision map to use
      useCache - whether to use cached path data
      Returns:
      the calculated tile path
    • getPath

      public static TilePath getPath(Collection<net.runelite.api.coords.WorldPoint> startPoints, net.runelite.api.coords.WorldArea destination, CollisionMap collisionMap, boolean useCache, boolean useTransports)
      Calculates a path with transport and caching options.
      Parameters:
      startPoints - the collection of starting points
      destination - the destination area
      collisionMap - the collision map to use
      useCache - whether to use cached path data
      useTransports - whether to include transport links in pathfinding
      Returns:
      the calculated tile path
    • getPath

      public static TilePath getPath(Collection<net.runelite.api.coords.WorldPoint> startPoints, net.runelite.api.coords.WorldArea destination, CollisionMap collisionMap, boolean useCache, boolean useTransports, HashMap<net.runelite.api.coords.WorldPoint,Teleport> teleports)
      Calculates a path with full customization options including teleports.
      Parameters:
      startPoints - the collection of starting points
      destination - the destination area
      collisionMap - the collision map to use
      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
    • getPath

      public static TilePath getPath(Collection<net.runelite.api.coords.WorldPoint> startPoints, net.runelite.api.coords.WorldArea destination, WalkOptions options, HashMap<net.runelite.api.coords.WorldPoint,Teleport> teleports)
      Calculates a path using custom walk options and teleports.
      Parameters:
      startPoints - the collection of starting points
      destination - the destination area
      options - custom walk options
      teleports - map of teleport destinations to teleport objects
      Returns:
      the calculated tile path
    • getNearestWalkableTile

      public static net.runelite.api.coords.WorldPoint getNearestWalkableTile(net.runelite.api.coords.WorldPoint source, Predicate<net.runelite.api.coords.WorldPoint> filter)
      Finds the nearest walkable tile to a source point.
      Parameters:
      source - the source point to search from
      filter - a predicate to filter candidate tiles
      Returns:
      the nearest walkable tile matching the filter, or null if none found
    • getNearestWalkableTile

      public static 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 using a custom collision map.
      Parameters:
      source - the source point to search from
      collisionMap - the collision map to use
      filter - a predicate to filter candidate tiles
      Returns:
      the nearest walkable tile matching the filter, or null if none found
    • getNearestWalkableTile

      public static net.runelite.api.coords.WorldPoint getNearestWalkableTile(net.runelite.api.coords.WorldPoint source)
      Finds the nearest walkable tile to a source point.
      Parameters:
      source - the source point to search from
      Returns:
      the nearest walkable tile, or null if none found
    • getNearestWalkableTile

      public static net.runelite.api.coords.WorldPoint getNearestWalkableTile(net.runelite.api.coords.WorldPoint source, CollisionMap collisionMap)
      Finds the nearest walkable tile using a custom collision map.
      Parameters:
      source - the source point to search from
      collisionMap - the collision map to use
      Returns:
      the nearest walkable tile, or null if none found