Class AutomatedMenu

java.lang.Object
net.storm.api.interact.AutomatedMenu
All Implemented Interfaces:
Automation

public class AutomatedMenu extends Object implements Automation
Represents an automated menu interaction that can be queued for execution.

This class encapsulates all the data required to execute a game menu action, whether it's interacting with an NPC, using an item, clicking a game object, or any other right-click menu option. It implements the Builder pattern for convenient construction of menu actions.

The menu entry structure follows the game's internal format with:

  • option - The action text (e.g., "Attack", "Use", "Talk-to")
  • target - The target entity name
  • identifier - Entity-specific identifier (NPC index, object ID, etc.)
  • opcode - The MenuAction type
  • param0, param1 - Additional action parameters

Example usage:


 AutomatedMenu menu = AutomatedMenu.builder()
     .option("Attack")
     .target("Goblin")
     .identifier(npcIndex)
     .opcode(MenuAction.NPC_SECOND_OPTION)
     .param0(0)
     .param1(0)
     .build();
 menu.queue(client);
 

See Also:
  • Constructor Details

    • AutomatedMenu

      public AutomatedMenu()
  • Method Details

    • queue

      public void queue(IClient client)
      Queues this automated menu action for execution via the client.

      This is a convenience method that delegates to IClient.interact(AutomatedMenu). The action will be processed by the interaction system according to the configured InteractMethod.

      Parameters:
      client - the game client to queue the interaction with
    • toString

      public String toString()
      Returns a string representation of this automated menu for debugging.

      Includes all relevant parameters: param0, param1, identifier, opcode, option, target, click point, item ID, and world view ID.

      Overrides:
      toString in class Object
      Returns:
      a debug string representation of this menu action