Class WidgetPackets
- java.lang.Object
-
- com.kraken.api.core.packet.entity.WidgetPackets
-
public class WidgetPackets extends java.lang.ObjectA high-level utility class for sending widget-related game packets. This class abstracts the complexity of constructing and sending packets related to widget (interface) interactions, such as clicking buttons. It uses aPacketClientprovider to send the low-level packets, which are defined by thePacketFactory.
-
-
Constructor Summary
Constructors Constructor Description WidgetPackets()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidqueueResumeCount(int id)Queues the RESUME_COUNTDIALOG packet, sent in response to a numerical input dialog (e.g., "How many?" or "Enter amount").voidqueueResumeObj(int value)Queues the RESUME_OBJDIALOG packet, typically sent as a continuation packet after selecting an option in a multi-choice dialog, where the value represents an item ID or object ID relevant to the dialog option.voidqueueWidgetSubAction(net.runelite.api.widgets.Widget widget, java.lang.String menu, java.lang.String action)Queues a widget sub-action packet by identifying the specific sub-action and menu options associated with a given widget.
-
-
-
Method Detail
-
queueWidgetSubAction
public void queueWidgetSubAction(net.runelite.api.widgets.Widget widget, java.lang.String menu, java.lang.String action)Queues a widget sub-action packet by identifying the specific sub-action and menu options associated with a given widget.This method identifies the indices of both a sub-action (from item definitions) and a specific menu option (from the widget's actions). If matches for both the sub-action and menu option are found, it sends a low-level packet to perform the action.
Only executes if the widget and its associated item ID are valid, while the sub-actions and menu options must contain the desired action and menu option.
- Parameters:
widget- TheWidgetinstance on which the action is to be performed. This is the target widget for the queued action.menu- A case-insensitive @<String> representing the menu action text to search for (e.g., "Use", "Examine").action- A case-insensitive @<String> representing the sub-action text to search for (e.g., "Clean", "Equip").
-
queueResumeCount
public void queueResumeCount(int id)
Queues the RESUME_COUNTDIALOG packet, sent in response to a numerical input dialog (e.g., "How many?" or "Enter amount").- Parameters:
id- The integer value entered by the player.
-
queueResumeObj
public void queueResumeObj(int value)
Queues the RESUME_OBJDIALOG packet, typically sent as a continuation packet after selecting an option in a multi-choice dialog, where the value represents an item ID or object ID relevant to the dialog option.- Parameters:
value- The numerical value associated with the dialog option.
-
-