Interaction Results
InteractionResult provides the standard return type for mutating action APIs instead of boolean returns. It delivers detailed feedback to help calling code decide whether to retry, wait, or abort an action.
Core fields:
status: machine-readableInteractionStatus.message: short human-readable explanation.targetTypeandtargetName: the target searched or acted on.requestedAction: cleaned action name or list of requested actions.actionIndex: RuneLite menu action index when the resolver finds one.availableActions: cleaned actions seen on the target.
Example:
InteractionResult result = NPCActions.interact("Banker", "Bank");
if (result.failed()) {
log.debug("{} target={} action={}",
result.getStatus(),
result.getTargetName(),
result.getRequestedAction());
}
Status guidance:
TARGET_NOT_FOUND: collection query lacked a target.TARGET_NULL: caller passed a null direct target.ACTION_NOT_FOUND: target existed but lacked the requested action.WIDGET_NOT_FOUND: widget-specific target problem.WIDGET_HIDDEN: the requested widget is hidden or a required side tab is not visible. A tab prerequisite uses targettab/<TAB_NAME>and never opens the tab implicitly.BANK_NOT_OPEN: bank-only action failed because the bank UI remained unavailable.TANNING_NOT_OPEN: tanning action failed because the tanner interface was closed.TANNING_SLOT_NOT_FOUND: no, or more than one, tanning slot matched the requested hide label.MOVEMENT_NOT_QUEUEDorPACKET_NOT_QUEUED: low-level queueing failed.
Use succeeded() and failed(). Avoid comparing messages.
Api Execution Pipeline
Mutating action methods return a structured InteractionResult. Exact guards and target-resolution steps vary by action. The diagram below shows a representative target interaction, not a required implementation order for every action class.