Class MovementService
- java.lang.Object
-
- net.openosrs.api.service.movement.MovementService
-
@Singleton public class MovementService extends java.lang.ObjectWalk submission and movement-state readback. Semantics (honest, per plan ยง5): - Readback methods (destination(),playerAt(),isMoving(),energy(),runEnabled()) are live client reads and are safe to call any time. - Walk submission uses the client's nativeMenuAction.WALKmenu tier; the client resolves the revision-specific packet tuple internally. - Packet-tier walking remains optional and is not required for this command.
-
-
Field Summary
Fields Modifier and Type Field Description static intVARP_RUN_ENABLEDHistorical varp for run-enabled state (173).
-
Constructor Summary
Constructors Constructor Description MovementService(net.runelite.api.Client client, MenuDispatcher dispatcher, VarService vars, SceneService scenes, WidgetService widgets)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description net.runelite.api.coords.WorldPointdestination()Current destination tile as a world point, or null when idle.intenergy()Run energy percentage (0-100).booleanisMoving()True when the local player has an active destination (moving).booleanlocalPlayerAt(net.runelite.api.coords.WorldPoint point)True when the local player stands exactly on the given point.net.runelite.api.coords.WorldPointplayerAt()Local player's current world position, or null when unavailable.booleanrunEnabled()Run-enabled state via varp 173 readback.voidtoggleRun()Toggle run via its settings component.booleanwalkLocal(net.runelite.api.coords.LocalPoint target)Submit a walk command to a local scene point.booleanwalkTo(net.runelite.api.coords.WorldPoint target)Submit a walk command to a world point.
-
-
-
Field Detail
-
VARP_RUN_ENABLED
public static final int VARP_RUN_ENABLED
Historical varp for run-enabled state (173). Verify live in P7.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MovementService
@Inject public MovementService(net.runelite.api.Client client, MenuDispatcher dispatcher, VarService vars, SceneService scenes, WidgetService widgets)
-
-
Method Detail
-
walkTo
public boolean walkTo(net.runelite.api.coords.WorldPoint target)
Submit a walk command to a world point. Uses the native menu tier. The client owns the WALK packet tuple.
-
walkLocal
public boolean walkLocal(net.runelite.api.coords.LocalPoint target)
Submit a walk command to a local scene point. The scene coordinates are supplied to the native client menu pipeline.
-
destination
public net.runelite.api.coords.WorldPoint destination()
Current destination tile as a world point, or null when idle.
-
isMoving
public boolean isMoving()
True when the local player has an active destination (moving).
-
playerAt
public net.runelite.api.coords.WorldPoint playerAt()
Local player's current world position, or null when unavailable.
-
localPlayerAt
public boolean localPlayerAt(net.runelite.api.coords.WorldPoint point)
True when the local player stands exactly on the given point.
-
energy
public int energy()
Run energy percentage (0-100). Client stores 0-10000 internally.
-
runEnabled
public boolean runEnabled()
Run-enabled state via varp 173 readback. Verify against live toggle in P7.
-
toggleRun
public void toggleRun()
Toggle run via its settings component. Finds the visible run-toggle control and routes it through the native menu tier.
-
-