Interface Navigation
Walk methods block the calling thread until the walk completes (arrived, cancelled, failed, or timeout), but do not block the pipe — other threads can still send RPC calls and receive events while a walk is in progress.
One script walks at a time. A client has one character and one
server-side action queue, so a walk requested while another script
is walking is refused: the blocking call returns WalkResult.FAILED
straight away rather than waiting, and the walk already in progress is left
alone. Re-targeting your own walk is always allowed. cancelWalk()
and getWalkStatus() are likewise scoped to the calling script, and
the host and any managing ManagementScript keep override authority
over every script's walk. The full contract is on NavigationAPI.
Obtain an instance through ScriptContext.getNavigation().
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidCancels the walk this script started.voidcleanup()Cancels this script's active walk and waits for its walker to stop.voidInvalidates all cached region collision data.findPath(int toX, int toY) Finds a local A* path from the player's position to a destination.findPath(int fromX, int fromY, int toX, int toY) Finds a local A* path between two tiles.findWorldPath(int toX, int toY) Finds a world-scale path from the player's position without walking it.findWorldPath(int fromX, int fromY, int toX, int toY) Finds a world-scale path between two tiles without walking it.intReturns the region collision cache size.Returns the walker state for the calling script — never a sibling script's.booleanisReachable(int x, int y) Checks if a tile is reachable from the player's current position via local A*.booleanisReachable(int x, int y, int maxIterations) Checks if a tile is reachable with a custom iteration limit.walkTo(int x, int y) Walks to a tile using local A* pathfinding and blocks until completion.walkTo(int x, int y, long timeoutMs) Walks to a tile using local A* pathfinding and blocks until completion or timeout.default WalkResultwalkWorldPath(int x, int y) Walks a world path on plane 0 and blocks until completion.walkWorldPath(int x, int y, int plane) Walks a world path (with teleport/door/shortcut support) and blocks until completion.default WalkResultwalkWorldPath(int x, int y, int plane, boolean exactDestTile) Walks a world path with exact destination tile control and blocks until completion.walkWorldPath(int x, int y, int plane, boolean exactDestTile, WorldPathConfig config) Walks a world path with full pathfinder configuration and blocks until completion.walkWorldPath(int x, int y, int plane, boolean exactDestTile, WorldPathConfig config, long timeoutMs) Walks a world path with full pathfinder configuration and blocks until completion or timeout.walkWorldPath(int x, int y, int plane, long timeoutMs) Walks a world path and blocks until completion or timeout.
-
Method Details
-
walkTo
Walks to a tile using local A* pathfinding and blocks until completion.- Parameters:
x- target world tile Xy- target world tile Y- Returns:
- the walk result
-
walkTo
Walks to a tile using local A* pathfinding and blocks until completion or timeout.- Parameters:
x- target world tile Xy- target world tile YtimeoutMs- maximum time to wait in milliseconds- Returns:
- the walk result
-
walkWorldPath
Walks a world path (with teleport/door/shortcut support) and blocks until completion.- Parameters:
x- target world tile Xy- target world tile Yplane- target plane- Returns:
- the walk result
-
walkWorldPath
Walks a world path and blocks until completion or timeout.- Parameters:
x- target world tile Xy- target world tile Yplane- target planetimeoutMs- maximum time to wait in milliseconds- Returns:
- the walk result
-
walkWorldPath
Walks a world path on plane 0 and blocks until completion.- Parameters:
x- target world tile Xy- target world tile Y- Returns:
- the walk result
-
walkWorldPath
Walks a world path with exact destination tile control and blocks until completion.- Parameters:
x- target world tile Xy- target world tile Yplane- target planeexactDestTile- iftrue, click the exact destination tile with no variance- Returns:
- the walk result
-
walkWorldPath
Walks a world path with full pathfinder configuration and blocks until completion.- Parameters:
x- target world tile Xy- target world tile Yplane- target planeexactDestTile- iftrue, click the exact destination tile with no varianceconfig- pathfinder config overrides, ornullfor defaults- Returns:
- the walk result
-
walkWorldPath
WalkResult walkWorldPath(int x, int y, int plane, boolean exactDestTile, WorldPathConfig config, long timeoutMs) Walks a world path with full pathfinder configuration and blocks until completion or timeout.- Parameters:
x- target world tile Xy- target world tile Yplane- target planeexactDestTile- iftrue, click the exact destination tile with no varianceconfig- pathfinder config overrides, ornullfor defaultstimeoutMs- maximum time to wait in milliseconds- Returns:
- the walk result
-
cancelWalk
void cancelWalk()Cancels the walk this script started. Emitswalk_cancelledif one was in progress. A no-op if the walk in progress belongs to another script; the host and management scripts may cancel any walk. -
getWalkStatus
WalkStatus getWalkStatus()Returns the walker state for the calling script — never a sibling script's. SeeNavigationAPI.getWalkStatus()for the state names.- Returns:
- the walk status
-
isReachable
boolean isReachable(int x, int y) Checks if a tile is reachable from the player's current position via local A*.- Parameters:
x- target world Xy- target world Y- Returns:
trueif the tile is reachable
-
isReachable
boolean isReachable(int x, int y, int maxIterations) Checks if a tile is reachable with a custom iteration limit.- Parameters:
x- target world Xy- target world YmaxIterations- max A* iterations- Returns:
trueif the tile is reachable
-
findPath
Finds a local A* path from the player's position to a destination.- Parameters:
toX- destination world XtoY- destination world Y- Returns:
- the path result
-
findPath
Finds a local A* path between two tiles.- Parameters:
fromX- origin world XfromY- origin world YtoX- destination world XtoY- destination world Y- Returns:
- the path result
-
findWorldPath
Finds a world-scale path from the player's position without walking it.- Parameters:
toX- destination world XtoY- destination world Y- Returns:
- the path result
-
findWorldPath
Finds a world-scale path between two tiles without walking it.- Parameters:
fromX- origin world XfromY- origin world YtoX- destination world XtoY- destination world Y- Returns:
- the path result
-
getRegionCacheSize
int getRegionCacheSize()Returns the region collision cache size.- Returns:
- the number of cached regions
-
clearRegionCache
void clearRegionCache()Invalidates all cached region collision data. -
cleanup
void cleanup()Cancels this script's active walk and waits for its walker to stop. Called automatically by the script runtime when a script stops. Scripts may also call this explicitly. A sibling script's walk is left running.
-