Skip to main content

Sailing Actions

SailingActions is a result-aware, paced wrapper around SailingInteraction. It covers boat direction, speed, and sail state for the OSRS Sailing skill.

SailingInteraction queues its own MousePackets.queueClickPacket() internally; SailingActions does not add a second click on top of it.

Query Methods

  • isNavigating()boolean - varbit NAVIGATING_VARBIT (19105) is non-zero
  • isMoving()boolean - varbit SPEED_VARBIT (19175) is non-zero
  • getDirection()SailingInteraction.Direction - reads SAILING_BOAT_SPAWNED_ANGLE_VARBIT (19129) and converts via Direction.fromAngle(angle) (divides by 128)

Action Methods

All action methods gate on GameStateGuard.requireLoggedInWithPlayer() and ActionPacer.isReady() before dispatching.

  • setDirection(SailingInteraction.Direction direction)InteractionResult - sets the heading; returns TARGET_NULL if direction is null
  • increaseSpeed()InteractionResult - calls SailingInteraction.increaseSpeed(); the underlying method calls setSails() when not moving, and no-ops at speed 2
  • decreaseSpeed()InteractionResult - calls SailingInteraction.decreaseSpeed(); the underlying method no-ops at speed 3 (reverse)
  • setSails()InteractionResult - starts movement if not already moving
  • unsetSails()InteractionResult - stops movement if currently moving

Direction Enum

SailingInteraction.Direction has 16 compass values from SOUTH (code 0) through SOUTH_SOUTH_EAST (code 15), stepping clockwise in 22.5-degree increments. Use Direction.fromCode(int) or Direction.fromAngle(int) for reverse-lookup.

ConstantCode
SOUTH0
SOUTH_SOUTH_WEST1
SOUTH_WEST2
WEST_SOUTH_WEST3
WEST4
WEST_NORTH_WEST5
NORTH_WEST6
NORTH_NORTH_WEST7
NORTH8
NORTH_NORTH_EAST9
NORTH_EAST10
EAST_NORTH_EAST11
EAST12
EAST_SOUTH_EAST13
SOUTH_EAST14
SOUTH_SOUTH_EAST15

Example

if (SailingActions.isNavigating() && !SailingActions.isMoving()) {
SailingActions.setSails();
}

SailingInteraction.Direction current = SailingActions.getDirection();
if (current != SailingInteraction.Direction.NORTH) {
InteractionResult result = SailingActions.setDirection(SailingInteraction.Direction.NORTH);
if (result.failed()) {
log.debug("setDirection failed: {}", result.getMessage());
}
}

Behavior Notes

  • SailingActions is a utility class, not a plugin. runelite-plugin.properties does not register it.
  • increaseSpeed and decreaseSpeed delegate entirely to SailingInteraction; their no-op conditions (at max/min speed) are enforced in the legacy layer, not in SailingActions. A returned InteractionResult.success does not guarantee a packet was sent.
  • Live RuneLite verification is still required for all sailing actions; the varbit IDs and widget ID (SAILING_CONTROLS_ID = 61407257) were captured from Sailing beta builds and may drift.