Package com.valhalla.sdk.api.methods
Class Walking
java.lang.Object
com.valhalla.sdk.api.methods.Walking
Movement queries, local collision routing, and native walk dispatch for the local player.
walk(...) returning true means the native client accepted a
destination. It does not mean the player arrived. Use waitUntilAt(Tile, int, long),
inspect getDestination(), or verify game state in later script loops.
Native dispatch fails closed when the active adapter does not advertise
Capabilities.NATIVE_WALKING.
-
Method Summary
Modifier and TypeMethodDescriptionanalyzeRoute(List<Tile> route, int maximumDistance) Analyzes the first collision transition requiring movement or handling.static booleanTests local collision reachability to a locatable.static booleanTests local collision reachability from the player.static booleanclickTileOnMinimap(Tile tile) Compatibility alias for native walking; it does not perform desktop pixel input.static intdistanceTo(Tile tile) Measures direct distance from the local player.Finds an exact local collision path from the player.findWaypoints(Tile destination) Compresses a local collision path into turn and endpoint waypoints.static Optional<CollisionMap> Returns current local collision data.Returns the final queued destination.static intMeasures remaining direct destination distance.Returns the next queued walking step.static TileReturns the local-player location.Returns the native walking queue.static booleanTests exact occupancy of a locatable's tile.static booleanTests whether the player is within a same-plane radius of a locatable.static booleanTests exact occupancy.static booleanTests whether the player is within a same-plane radius of a tile.static booleanisMoving()Reports current player movement.Creates a local path from varargs nodes.Creates a local path from a node list.static booleanTests whether another route leg should be dispatched.static booleanshouldWalk(int distance) Tests whether movement is idle, unqueued, or nearing its queued destination.static booleanwaitUntilAt(Locatable destination, int radius, long timeoutMillis) Blocks until the player reaches a locatable's radius or the timeout expires.static booleanwaitUntilAt(Tile tile, int radius, long timeoutMillis) Blocks until the player reaches a same-plane radius or the timeout expires.static booleanwaitUntilIdle(long timeoutMillis) Blocks the script thread until movement stops or a timeout expires.static booleanwalk(int x, int y) Dispatches an X/Y destination on plane zero.static booleanwalk(int x, int y, int plane) Dispatches an explicit world destination.static booleanDispatches the tile represented by a locatable.static booleanDispatches a native destination.static booleanDispatches an exact destination.static booleanDispatches the next useful leg of an ordered local path.
-
Method Details
-
isMoving
public static boolean isMoving()Reports current player movement.- Returns:
- whether the local player currently reports movement
-
getPlayerTile
Returns the local-player location.- Returns:
- current local-player world tile
-
distanceTo
Measures direct distance from the local player.- Parameters:
tile- destination tile- Returns:
- Chebyshev distance from the local player
-
getWalkingQueue
Returns the native walking queue.- Returns:
- immutable route queue captured from the local player
-
getNextStep
Returns the next queued walking step.- Returns:
- first queued step beyond the player's current tile, if present
-
getDestination
Returns the final queued destination.- Returns:
- final native walking destination, if one is currently queued
-
getDestinationDistance
public static int getDestinationDistance()Measures remaining direct destination distance.- Returns:
- Chebyshev distance to the queued destination, or
-1when absent
-
shouldWalk
public static boolean shouldWalk()Tests whether another route leg should be dispatched.- Returns:
truewhen a new destination should be considered within four tiles
-
shouldWalk
public static boolean shouldWalk(int distance) Tests whether movement is idle, unqueued, or nearing its queued destination.- Parameters:
distance- inclusive remaining-distance threshold- Returns:
truewhen it is reasonable for a caller to issue another leg
-
walk
Dispatches a native destination.- Parameters:
tile- destination tile- Returns:
truewhen accepted; arrival must be verified separately
-
walk
Dispatches the tile represented by a locatable.- Parameters:
destination- locatable destination- Returns:
truewhen accepted; arrival must be verified separately
-
walk
public static boolean walk(int x, int y) Dispatches an X/Y destination on plane zero.- Parameters:
x- world Xy- world Y- Returns:
truewhen accepted
-
walk
public static boolean walk(int x, int y, int plane) Dispatches an explicit world destination.- Parameters:
x- world Xy- world Yplane- world plane- Returns:
truewhen accepted
-
walkExact
Dispatches an exact destination.- Parameters:
tile- exact destination- Returns:
truewhen native dispatch is accepted
-
clickTileOnMinimap
Compatibility alias for native walking; it does not perform desktop pixel input.- Parameters:
tile- destination tile- Returns:
truewhen native dispatch is accepted
-
canWalk
Tests local collision reachability from the player.When collision data is unavailable, this falls back to same-plane validation and therefore does not prove that walls or obstacles are absent.
- Parameters:
destination- tile to test- Returns:
truewhen collision finds a route, or the fallback plane matches
-
canWalk
Tests local collision reachability to a locatable.- Parameters:
destination- locatable to test- Returns:
trueunder the same semantics ascanWalk(Tile)
-
getCollisionMap
Returns current local collision data.- Returns:
- latest local collision map, or empty when the adapter did not supply one
-
findPath
Finds an exact local collision path from the player.- Parameters:
destination- local destination- Returns:
- ordered tiles, or an empty list when collision is unavailable or no route exists
-
findWaypoints
Compresses a local collision path into turn and endpoint waypoints.- Parameters:
destination- local destination- Returns:
- compressed path, or an empty list when no path exists
-
localPath
Creates a local path from varargs nodes.- Parameters:
nodes- ordered path nodes- Returns:
- mutable local-path controller
-
localPath
Creates a local path from a node list.- Parameters:
nodes- ordered path nodes- Returns:
- mutable local-path controller
-
walkPath
Dispatches the next useful leg of an ordered local path.- Parameters:
nodes- ordered locatable nodes- Returns:
truewhen a native walk action was accepted
-
analyzeRoute
Analyzes the first collision transition requiring movement or handling.- Parameters:
route- ordered route tilesmaximumDistance- maximum local lookahead distance- Returns:
- move task when collision is available, otherwise empty
-
isAt
Tests exact occupancy.- Parameters:
tile- target tile- Returns:
- whether the player occupies that exact tile
-
isAt
Tests exact occupancy of a locatable's tile.- Parameters:
destination- target location- Returns:
- whether the player occupies its exact tile
-
isAt
Tests whether the player is within a same-plane radius of a locatable.- Parameters:
destination- target locationradius- inclusive Chebyshev radius- Returns:
truewhen within the radius on the same plane
-
isAt
Tests whether the player is within a same-plane radius of a tile.- Parameters:
tile- target tileradius- inclusive non-negative Chebyshev radius- Returns:
truewhen within the radius on the same plane
-
waitUntilIdle
public static boolean waitUntilIdle(long timeoutMillis) Blocks the script thread until movement stops or a timeout expires.- Parameters:
timeoutMillis- maximum wait duration- Returns:
truewhen the player became idle before the timeout
-
waitUntilAt
Blocks until the player reaches a same-plane radius or the timeout expires.- Parameters:
tile- target tileradius- inclusive Chebyshev radiustimeoutMillis- maximum wait duration- Returns:
truewhen the target radius was reached
-
waitUntilAt
Blocks until the player reaches a locatable's radius or the timeout expires.- Parameters:
destination- target locationradius- inclusive Chebyshev radiustimeoutMillis- maximum wait duration- Returns:
truewhen the target radius was reached
-