Class Walker
- java.lang.Object
-
- net.openosrs.api.service.movement.Walker
-
public class Walker extends java.lang.ObjectSingle-owner walk executor over a computedLocalPathfinderroute. One Walker instance owns at most one active route. Each game tick the caller (plugin) invokesonTick(); Walker submits the next hop when the player reaches the current waypoint, detects stalls with bounded retries, and reports honest state: a submitted step is not an arrived step.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceWalker.ObstacleCallbackOptional hook: invoked when the walker suspects an obstacle on the route.static classWalker.State
-
Constructor Summary
Constructors Constructor Description Walker(MovementService movement, LocalPathfinder pathfinder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancel()Cancel the owned route.Walker.StategetState()net.runelite.api.coords.WorldPointgetTarget()voidonTick()Advance walker state by one game tick.voidsetObstacleCallback(Walker.ObstacleCallback callback)booleanwalkTo(net.runelite.api.coords.WorldPoint destination)Compute and own a route to the destination using the local pathfinder.
-
-
-
Constructor Detail
-
Walker
@Inject public Walker(MovementService movement, LocalPathfinder pathfinder)
-
-
Method Detail
-
setObstacleCallback
public void setObstacleCallback(Walker.ObstacleCallback callback)
-
walkTo
public boolean walkTo(net.runelite.api.coords.WorldPoint destination)
Compute and own a route to the destination using the local pathfinder. The caller must be on the client thread.
-
onTick
public void onTick()
Advance walker state by one game tick. Must be called from the client thread.
-
cancel
public void cancel()
Cancel the owned route.
-
getState
public Walker.State getState()
-
getTarget
public net.runelite.api.coords.WorldPoint getTarget()
-
-