Interface Navigation


public interface Navigation
High-level navigation interface providing blocking walk operations.

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 Type
    Method
    Description
    void
    Cancels the walk this script started.
    void
    Cancels this script's active walk and waits for its walker to stop.
    void
    Invalidates 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.
    int
    Returns the region collision cache size.
    Returns the walker state for the calling script — never a sibling script's.
    boolean
    isReachable(int x, int y)
    Checks if a tile is reachable from the player's current position via local A*.
    boolean
    isReachable(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 WalkResult
    walkWorldPath(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 WalkResult
    walkWorldPath(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

      WalkResult walkTo(int x, int y)
      Walks to a tile using local A* pathfinding and blocks until completion.
      Parameters:
      x - target world tile X
      y - target world tile Y
      Returns:
      the walk result
    • walkTo

      WalkResult walkTo(int x, int y, long timeoutMs)
      Walks to a tile using local A* pathfinding and blocks until completion or timeout.
      Parameters:
      x - target world tile X
      y - target world tile Y
      timeoutMs - maximum time to wait in milliseconds
      Returns:
      the walk result
    • walkWorldPath

      WalkResult walkWorldPath(int x, int y, int plane)
      Walks a world path (with teleport/door/shortcut support) and blocks until completion.
      Parameters:
      x - target world tile X
      y - target world tile Y
      plane - target plane
      Returns:
      the walk result
    • walkWorldPath

      WalkResult walkWorldPath(int x, int y, int plane, long timeoutMs)
      Walks a world path and blocks until completion or timeout.
      Parameters:
      x - target world tile X
      y - target world tile Y
      plane - target plane
      timeoutMs - maximum time to wait in milliseconds
      Returns:
      the walk result
    • walkWorldPath

      default WalkResult walkWorldPath(int x, int y)
      Walks a world path on plane 0 and blocks until completion.
      Parameters:
      x - target world tile X
      y - target world tile Y
      Returns:
      the walk result
    • walkWorldPath

      default WalkResult walkWorldPath(int x, int y, int plane, boolean exactDestTile)
      Walks a world path with exact destination tile control and blocks until completion.
      Parameters:
      x - target world tile X
      y - target world tile Y
      plane - target plane
      exactDestTile - if true, click the exact destination tile with no variance
      Returns:
      the walk result
    • walkWorldPath

      WalkResult walkWorldPath(int x, int y, int plane, boolean exactDestTile, WorldPathConfig config)
      Walks a world path with full pathfinder configuration and blocks until completion.
      Parameters:
      x - target world tile X
      y - target world tile Y
      plane - target plane
      exactDestTile - if true, click the exact destination tile with no variance
      config - pathfinder config overrides, or null for 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 X
      y - target world tile Y
      plane - target plane
      exactDestTile - if true, click the exact destination tile with no variance
      config - pathfinder config overrides, or null for defaults
      timeoutMs - maximum time to wait in milliseconds
      Returns:
      the walk result
    • cancelWalk

      void cancelWalk()
      Cancels the walk this script started. Emits walk_cancelled if 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. See NavigationAPI.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 X
      y - target world Y
      Returns:
      true if 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 X
      y - target world Y
      maxIterations - max A* iterations
      Returns:
      true if the tile is reachable
    • findPath

      PathResult findPath(int toX, int toY)
      Finds a local A* path from the player's position to a destination.
      Parameters:
      toX - destination world X
      toY - destination world Y
      Returns:
      the path result
    • findPath

      PathResult findPath(int fromX, int fromY, int toX, int toY)
      Finds a local A* path between two tiles.
      Parameters:
      fromX - origin world X
      fromY - origin world Y
      toX - destination world X
      toY - destination world Y
      Returns:
      the path result
    • findWorldPath

      PathResult findWorldPath(int toX, int toY)
      Finds a world-scale path from the player's position without walking it.
      Parameters:
      toX - destination world X
      toY - destination world Y
      Returns:
      the path result
    • findWorldPath

      PathResult findWorldPath(int fromX, int fromY, int toX, int toY)
      Finds a world-scale path between two tiles without walking it.
      Parameters:
      fromX - origin world X
      fromY - origin world Y
      toX - destination world X
      toY - 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.