Package net.storm.sdk.movement
Class Movement
java.lang.Object
net.storm.sdk.movement.Movement
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic intcalculateDistance(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 intcalculateDistance(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 intcalculateDistance(net.runelite.api.coords.WorldArea destination) Calculates the tile distance from the local player to a destination area.static intcalculateDistance(net.runelite.api.coords.WorldPoint destination) Calculates the tile distance from the local player to a destination point.static intcalculateDistance(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 intcalculateDistance(net.runelite.api.coords.WorldPoint start, net.runelite.api.coords.WorldPoint destination) Calculates the tile distance between two points.static net.runelite.api.coords.WorldPointRetrieves the current movement destination.static net.runelite.api.coords.WorldPointgetNearestWalkableTile(net.runelite.api.coords.WorldPoint source) Finds the nearest walkable tile to a source point.static net.runelite.api.coords.WorldPointgetNearestWalkableTile(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.WorldPointgetNearestWalkableTile(net.runelite.api.coords.WorldPoint source, CollisionMap collisionMap) Finds the nearest walkable tile using a custom collision map.static 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 using a custom collision map.static TilePathgetPath(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 TilePathgetPath(Collection<net.runelite.api.coords.WorldPoint> startPoints, net.runelite.api.coords.WorldArea destination, boolean useCache) Calculates a path with optional caching.static TilePathgetPath(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 TilePathgetPath(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 TilePathgetPath(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 TilePathgetPath(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 TilePathgetPath(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 TilePathgetPath(Collection<net.runelite.api.coords.WorldPoint> startPoints, net.runelite.api.coords.WorldPoint destination) Calculates a path from multiple starting points to a destination.static TilePathgetPath(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 TilePathgetPath(net.runelite.api.coords.WorldArea destination) Calculates a path from the local player to a destination area.static TilePathgetPath(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 TilePathgetPath(net.runelite.api.coords.WorldPoint destination) Calculates a path from the local player to a destination point.static TilePathgetPath(net.runelite.api.coords.WorldPoint destination, CollisionMap collisionMap) Calculates a path from the local player to a destination using a custom collision map.static intRetrieves the player's current run energy.static booleanChecks whether run mode is currently enabled.static booleanChecks whether the stamina boost effect is currently active.static booleanChecks whether the local player is currently walking or running.static voidsetDestination(int sceneX, int sceneY) Force walks to a specific scene coordinate.static voidToggles run mode on or off via the minimap orb.static voidwalk(net.runelite.api.coords.WorldPoint worldPoint) Force walks directly to a world point without pathfinding.static voidForce walks directly to a locatable entity without pathfinding.static booleanwalkTo(int x, int y) Pathfinds and walks to world coordinates using the global collision map.static booleanwalkTo(int x, int y, int plane) Pathfinds and walks to world coordinates on a specific plane.static booleanwalkTo(net.runelite.api.coords.WorldArea worldArea) Pathfinds and walks to a world area using the global collision map.static booleanPathfinds and walks to a world area with teleport option.static booleanwalkTo(net.runelite.api.coords.WorldArea worldArea, CollisionMap collisionMap) Pathfinds and walks to a world area using a custom collision map.static booleanwalkTo(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 booleanwalkTo(net.runelite.api.coords.WorldArea destination, WalkOptions options) Pathfinds and walks to a destination using custom walk options.static booleanwalkTo(net.runelite.api.coords.WorldPoint worldPoint) Pathfinds and walks to a world point using the global collision map.static booleanwalkTo(net.runelite.api.coords.WorldPoint worldPoint, boolean useTeleports) Pathfinds and walks to a world point with teleport option.static booleanwalkTo(net.runelite.api.coords.WorldPoint worldPoint, CollisionMap collisionMap) Pathfinds and walks to a world point using a custom collision map.static booleanwalkTo(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 booleanwalkTo(net.runelite.api.coords.WorldPoint destination, WalkOptions options) Pathfinds and walks to a destination using custom walk options.static booleanPathfinds and walks to a locatable entity using the global collision map.static booleanwalkTo(BankLocation bankLocation) Pathfinds and walks to a bank location using the global collision map.
-
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 coordinatesceneY- 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 pointcollisionMap- 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 pointcollisionMap- the collision map to use for pathfindinguseTeleports- 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 pointuseTeleports- 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 areacollisionMap- the collision map to use for pathfinding- Returns:
- true if a complete path was found, false if only a partial path
-
walkTo
Pathfinds and walks to a world area with teleport option.- Parameters:
worldArea- the destination areauseTeleports- 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 areacollisionMap- the collision map to use for pathfindinguseTeleports- 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
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
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
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 coordinatey- 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 coordinatey- the destination world Y coordinateplane- the destination plane (0-3)- Returns:
- true if a complete path was found, false if only a partial path
-
walkTo
Pathfinds and walks to a destination using custom walk options.- Parameters:
destination- the destination areaoptions- custom walk options for path calculation- Returns:
- true if a complete path was found, false if only a partial path
-
walkTo
Pathfinds and walks to a destination using custom walk options.- Parameters:
destination- the destination pointoptions- 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 pointdestination- 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 pointsdestination- 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 pointdestination- 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 pointsdestination- the destination point- Returns:
- the number of tiles in the shortest path
-
getPath
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 pointcollisionMap- 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 pointsdestination- 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 pointsdestination- the destination pointcollisionMap- the collision map to use- Returns:
- the calculated tile path
-
getPath
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 areacollisionMap- 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 pointsdestination- 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 pointsdestination- the destination areacollisionMap- 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 pointsdestination- the destination areauseCache- 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 pointsdestination- the destination areacollisionMap- the collision map to useuseCache- 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 pointsdestination- the destination areacollisionMap- the collision map to useuseCache- whether to use cached path datauseTransports- 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 pointsdestination- the destination areacollisionMap- the collision map to useuseCache- whether to use cached path datauseTransports- whether to include transport linksteleports- 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 pointsdestination- the destination areaoptions- custom walk optionsteleports- 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 fromfilter- 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 fromcollisionMap- the collision map to usefilter- 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 fromcollisionMap- the collision map to use- Returns:
- the nearest walkable tile, or null if none found
-