Class Walking

java.lang.Object
com.valhalla.sdk.api.methods.Walking

public final class Walking extends Object
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 Type
    Method
    Description
    analyzeRoute(List<Tile> route, int maximumDistance)
    Analyzes the first collision transition requiring movement or handling.
    static boolean
    canWalk(Locatable destination)
    Tests local collision reachability to a locatable.
    static boolean
    canWalk(Tile destination)
    Tests local collision reachability from the player.
    static boolean
    Compatibility alias for native walking; it does not perform desktop pixel input.
    static int
    Measures direct distance from the local player.
    static List<Tile>
    findPath(Tile destination)
    Finds an exact local collision path from the player.
    static List<Tile>
    findWaypoints(Tile destination)
    Compresses a local collision path into turn and endpoint waypoints.
    Returns current local collision data.
    static Optional<Tile>
    Returns the final queued destination.
    static int
    Measures remaining direct destination distance.
    static Optional<Tile>
    Returns the next queued walking step.
    static Tile
    Returns the local-player location.
    static List<Tile>
    Returns the native walking queue.
    static boolean
    isAt(Locatable destination)
    Tests exact occupancy of a locatable's tile.
    static boolean
    isAt(Locatable destination, int radius)
    Tests whether the player is within a same-plane radius of a locatable.
    static boolean
    isAt(Tile tile)
    Tests exact occupancy.
    static boolean
    isAt(Tile tile, int radius)
    Tests whether the player is within a same-plane radius of a tile.
    static boolean
    Reports current player movement.
    static LocalPath<Tile>
    localPath(Tile... nodes)
    Creates a local path from varargs nodes.
    static LocalPath<Tile>
    Creates a local path from a node list.
    static boolean
    Tests whether another route leg should be dispatched.
    static boolean
    shouldWalk(int distance)
    Tests whether movement is idle, unqueued, or nearing its queued destination.
    static boolean
    waitUntilAt(Locatable destination, int radius, long timeoutMillis)
    Blocks until the player reaches a locatable's radius or the timeout expires.
    static boolean
    waitUntilAt(Tile tile, int radius, long timeoutMillis)
    Blocks until the player reaches a same-plane radius or the timeout expires.
    static boolean
    waitUntilIdle(long timeoutMillis)
    Blocks the script thread until movement stops or a timeout expires.
    static boolean
    walk(int x, int y)
    Dispatches an X/Y destination on plane zero.
    static boolean
    walk(int x, int y, int plane)
    Dispatches an explicit world destination.
    static boolean
    walk(Locatable destination)
    Dispatches the tile represented by a locatable.
    static boolean
    walk(Tile tile)
    Dispatches a native destination.
    static boolean
    Dispatches an exact destination.
    static boolean
    walkPath(List<? extends Locatable> nodes)
    Dispatches the next useful leg of an ordered local path.

    Methods inherited from class java.lang.Object

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

    • isMoving

      public static boolean isMoving()
      Reports current player movement.
      Returns:
      whether the local player currently reports movement
    • getPlayerTile

      public static Tile getPlayerTile()
      Returns the local-player location.
      Returns:
      current local-player world tile
    • distanceTo

      public static int distanceTo(Tile tile)
      Measures direct distance from the local player.
      Parameters:
      tile - destination tile
      Returns:
      Chebyshev distance from the local player
    • getWalkingQueue

      public static List<Tile> getWalkingQueue()
      Returns the native walking queue.
      Returns:
      immutable route queue captured from the local player
    • getNextStep

      public static Optional<Tile> getNextStep()
      Returns the next queued walking step.
      Returns:
      first queued step beyond the player's current tile, if present
    • getDestination

      public static Optional<Tile> 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 -1 when absent
    • shouldWalk

      public static boolean shouldWalk()
      Tests whether another route leg should be dispatched.
      Returns:
      true when 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:
      true when it is reasonable for a caller to issue another leg
    • walk

      public static boolean walk(Tile tile)
      Dispatches a native destination.
      Parameters:
      tile - destination tile
      Returns:
      true when accepted; arrival must be verified separately
    • walk

      public static boolean walk(Locatable destination)
      Dispatches the tile represented by a locatable.
      Parameters:
      destination - locatable destination
      Returns:
      true when 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 X
      y - world Y
      Returns:
      true when accepted
    • walk

      public static boolean walk(int x, int y, int plane)
      Dispatches an explicit world destination.
      Parameters:
      x - world X
      y - world Y
      plane - world plane
      Returns:
      true when accepted
    • walkExact

      public static boolean walkExact(Tile tile)
      Dispatches an exact destination.
      Parameters:
      tile - exact destination
      Returns:
      true when native dispatch is accepted
    • clickTileOnMinimap

      public static boolean clickTileOnMinimap(Tile tile)
      Compatibility alias for native walking; it does not perform desktop pixel input.
      Parameters:
      tile - destination tile
      Returns:
      true when native dispatch is accepted
    • canWalk

      public static boolean canWalk(Tile destination)
      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:
      true when collision finds a route, or the fallback plane matches
    • canWalk

      public static boolean canWalk(Locatable destination)
      Tests local collision reachability to a locatable.
      Parameters:
      destination - locatable to test
      Returns:
      true under the same semantics as canWalk(Tile)
    • getCollisionMap

      public static Optional<CollisionMap> getCollisionMap()
      Returns current local collision data.
      Returns:
      latest local collision map, or empty when the adapter did not supply one
    • findPath

      public static List<Tile> findPath(Tile destination)
      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

      public static List<Tile> findWaypoints(Tile destination)
      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

      public static LocalPath<Tile> localPath(Tile... nodes)
      Creates a local path from varargs nodes.
      Parameters:
      nodes - ordered path nodes
      Returns:
      mutable local-path controller
    • localPath

      public static LocalPath<Tile> localPath(List<Tile> nodes)
      Creates a local path from a node list.
      Parameters:
      nodes - ordered path nodes
      Returns:
      mutable local-path controller
    • walkPath

      public static boolean walkPath(List<? extends Locatable> nodes)
      Dispatches the next useful leg of an ordered local path.
      Parameters:
      nodes - ordered locatable nodes
      Returns:
      true when a native walk action was accepted
    • analyzeRoute

      public static Optional<MoveTask> analyzeRoute(List<Tile> route, int maximumDistance)
      Analyzes the first collision transition requiring movement or handling.
      Parameters:
      route - ordered route tiles
      maximumDistance - maximum local lookahead distance
      Returns:
      move task when collision is available, otherwise empty
    • isAt

      public static boolean isAt(Tile tile)
      Tests exact occupancy.
      Parameters:
      tile - target tile
      Returns:
      whether the player occupies that exact tile
    • isAt

      public static boolean isAt(Locatable destination)
      Tests exact occupancy of a locatable's tile.
      Parameters:
      destination - target location
      Returns:
      whether the player occupies its exact tile
    • isAt

      public static boolean isAt(Locatable destination, int radius)
      Tests whether the player is within a same-plane radius of a locatable.
      Parameters:
      destination - target location
      radius - inclusive Chebyshev radius
      Returns:
      true when within the radius on the same plane
    • isAt

      public static boolean isAt(Tile tile, int radius)
      Tests whether the player is within a same-plane radius of a tile.
      Parameters:
      tile - target tile
      radius - inclusive non-negative Chebyshev radius
      Returns:
      true when 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:
      true when the player became idle before the timeout
    • waitUntilAt

      public static boolean waitUntilAt(Tile tile, int radius, long timeoutMillis)
      Blocks until the player reaches a same-plane radius or the timeout expires.
      Parameters:
      tile - target tile
      radius - inclusive Chebyshev radius
      timeoutMillis - maximum wait duration
      Returns:
      true when the target radius was reached
    • waitUntilAt

      public static boolean waitUntilAt(Locatable destination, int radius, long timeoutMillis)
      Blocks until the player reaches a locatable's radius or the timeout expires.
      Parameters:
      destination - target location
      radius - inclusive Chebyshev radius
      timeoutMillis - maximum wait duration
      Returns:
      true when the target radius was reached