Class Travel

java.lang.Object
privbot.hooks.Travel

public final class Travel extends Object
Get to a named place (walk + transports + teleports), unifying PathingAPI with the Places named-location registry. Blocking variants poll a NavigationHandle on the calling (worker) thread and confirm arrival — they must NOT be called on the client thread (they sleep). navigateAsync(java.lang.String, privbot.movement.pathing.NavigationOptions) hands back the handle for plugins that drive their own tick loop.
  • Method Details

    • exactStep

      public ExactStepHandle exactStep(net.runelite.api.coords.WorldPoint destination, BooleanSupplier active, long timeoutMs)
      Dispatch once and prove the identical X/Y/plane; call poll on the worker and cancel on stop.
    • exactStep

      public ExactStepHandle exactStep(net.runelite.api.coords.WorldPoint destination, BooleanSupplier active, long timeoutMs, ActionTracker tracker)
      Share the caller's confirmation lifecycle; this creates no second proof or polling loop.
    • reachability

      public SceneReachability reachability()
      One immutable reachability grid per read scope, using the shared local pathfinder.
    • session

      public NavigationSession session(net.runelite.api.coords.WorldPoint destination, NavigationOptions options, NavigationSession.Policy policy)
      Create a bounded journey; call step on your script worker and cancel on stop/reconnect.
    • go

      public Job go(Destination destination)
      Starts a job that gets the player into destination: an optional teleport first (once, only when the player is more than 30 tiles away), then a pathed walk started asynchronously and polled every step. Step it once per tick; a step waits at most 2400 ms.

      What it proves: DONE ("arrived") only when the player's tile is inside the destination (Destination.contains(net.runelite.api.coords.WorldPoint)); the tile is the server tile on supported clients, the world location elsewhere. A teleport that lands anywhere else is not arrival: the walk continues from the landing. FAILED "no progress toward <name>" when the distance to the destination did not shrink for 20 steps; a route that failed or was cancelled is restarted once, then FAILED "route failed: <why>". After 300 steps without arriving (an off-plane or oscillating route never trips the stall count) it ends FAILED "took too long to reach <name>". UNSUPPORTED "navigation unavailable" when there is no path planner.

      Unreadable looks like: an unreadable player tile is never arrival and never lack of progress; the job stays RUNNING ("position unreadable") and fails after 5 such steps in a row. A finished job cancels its route.

      Thread rule: call Job.step(privbot.task.PrivTaskContext) from a node on the script worker; reads marshal themselves and waits use PrivTaskContext.sleepUntil(java.util.function.BooleanSupplier, int). The job is not thread-safe: step it from one thread. Job.cancel() is the exception: it may come from another thread (Stop) mid-step, ends the job FAILED "cancelled", and a route that step started after the cancel landed is cancelled before the step returns.

      Parameters:
      destination - where to go
      Returns:
      a new job, RUNNING
    • to

      public boolean to(String place)
      Blocking: travel to a named place. Resolution order is owned by Places.resolve(java.lang.String).
    • to

      public boolean to(Places.Place p)
      Blocking: travel to a resolved Places.Place.
    • walkTo

      public boolean walkTo(net.runelite.api.coords.WorldPoint pt)
      Blocking: walk/path to a raw world point (arrive radius 2).
    • to

      public boolean to(net.runelite.api.coords.WorldPoint pt)
      Blocking: travel to a raw world point (arrive radius 2).
    • to

      public boolean to(net.runelite.api.coords.WorldPoint pt, NavigationOptions opts, long timeoutMs)
      Blocking: travel to a raw world point with caller-chosen options and timeout. This is the WALK_TO / WALK_TO_AREA step of the Builder: opts.arriveRadius is the "close enough" radius (an area step passes half its extent), opts.allowTeleports is the step's "Allow teleports" box. Already inside the radius returns true without moving.
    • toBank

      public boolean toBank()
      Blocking: travel to the nearest configured bank (uses PathingAPI's bank routing).
    • isAt

      public boolean isAt(String place)
      Delegates to Places.isAt(String).