Skip to main content

Action Resolver

Verification boundary

revision-sensitive RuneLite UI, packet, or in-game outcomes; treat those as live-client verification pending unless the page records direct evidence.

Use ActionResolver to match menu actions for packet wrappers, query filters, and high-level actions.

Diagnostic menu-entry snapshots live in Menu Entries. Focus this page on matching and one-based action-index resolution.

Behavior:

  • Strips RuneLite text tags.
  • Trims whitespace.
  • Ignores null and empty actions.
  • Matches requested actions case-insensitively.
  • Returns one-based RuneLite action indexes.

Example:

int index = ActionResolver.findActionIndex(widget.getActions(), "Withdraw-10");
if (index <= 0) {
return InteractionResult.fail(InteractionStatus.ACTION_NOT_FOUND, "No withdraw action");
}

Use ActionResolver.hasAction(...) inside query predicates. Do not loop over action arrays manually.

Walker transport resolution (PluginTransportActionResolver and TeleportSpellWalkerAction) uses ActionResolver.hasAction(...) to match minigame teleport titles and spell names safely against enum models without manual string parsing.

Multiple Accepted Actions

Pass actions in preference order when callers accept multiple menu verbs. The method returns the index of the first matching action in the widget or entity action array, not the first requested action.

int index = ActionResolver.findActionIndex(
item.getActions(),
"Wear",
"Wield",
"Equip"
);

if (index > 0) {
WidgetPackets.queueWidgetActionPacket(index, item.getId(), item.getIndex(), item.getItemId());
}

Query Predicate Usage

Use hasAction to filter query results. It strips tags and matches case-insensitively, matching action classes.

Optional<Widget> teleport = Inventory.search()
.filter(item -> ActionResolver.hasAction(item.getActions(), "Teleport"))
.first();

Failure Messages

Repeat raw caller input on failure.

String requested = ActionResolver.describeRequested("Withdraw-10", "Withdraw-5");
return InteractionResult.fail(
InteractionStatus.ACTION_NOT_FOUND,
"Missing action: " + requested
);