Package net.eternalclient.api.packets
Class WidgetPackets
- java.lang.Object
-
- net.eternalclient.api.packets.WidgetPackets
-
public class WidgetPackets extends java.lang.Object
Utility class for creating and queuing widget packets.
-
-
Constructor Summary
Constructors Constructor Description WidgetPackets()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static RSPacketBufferNode
createContinuePacket(int widgetId, int childId)
Creates a continue packet with the given widget and child IDs.static RSPacketBufferNode
createDefaultAction(int type, int widgetPackedId, int itemId, int itemSlot)
Returns a `RSPacketBufferNode` representing the default action based on the given parameters.static RSPacketBufferNode
createEighthAction(int widgetId, int itemId, int childId)
Creates a packet buffer node for the eighth action of a widget button.static RSPacketBufferNode
createFifthAction(int widgetId, int itemId, int childId)
Creates a packet buffer node for the fifth action on a widget containing the specified widget ID, item ID, and child ID.static RSPacketBufferNode
createFirstAction(int widgetId, int itemId, int childId)
Creates a new RSPacketBufferNode for the first action of an RSButton.static RSPacketBufferNode
createFourthAction(int widgetId, int itemId, int childId)
Creates a packet buffer node for the fourth action with the specified widget ID, item ID, and child ID.static RSPacketBufferNode
createNinthAction(int widgetId, int itemId, int childId)
Creates a packet buffer node for the ninth action with the specified widget ID, item ID, and child ID.static RSPacketBufferNode
createSecondAction(int widgetId, int itemId, int childId)
Creates a second action packet buffer node with the given widget ID, item ID, and child ID.static RSPacketBufferNode
createSeventhAction(int widgetId, int itemId, int childId)
Creates a packet buffer node for the seventh action with specified widget ID, item ID, and child ID.static RSPacketBufferNode
createSixthAction(int widgetId, int itemId, int childId)
Creates a packet buffer node for the sixth action of a button with specified widget ID, item ID, and child ID.static RSPacketBufferNode
createTenthAction(int widgetId, int itemId, int childId)
Creates a packet buffer node for the tenth action of a button on an interface.static RSPacketBufferNode
createThirdAction(int widgetId, int itemId, int childId)
Creates a packet buffer node for the third action of a widget with the given widgetId, itemId, and childId.static RSPacketBufferNode
createType1Action(int widgetId)
Creates a type 1 widget action packet buffer node.static RSPacketBufferNode
createWidgetOnWidget(int sourceWidgetId, int sourceSlot, int sourceItemId, int destinationWidgetId, int destinationSlot, int destinationItemId)
Creates a packet buffer node to send a widget creation packet.static void
queueResumePauseWidgetPacket(int widgetId, int childId)
Sends a continue packet for the specified widget and child id.static void
queueWidgetAction10Packet(int widgetId, int itemId, int childId)
Queues a widget action packet with the given widget ID, item ID, and child ID, then sends the packet.static void
queueWidgetAction1Packet(int widgetId, int itemId, int childId)
Queues a packet of the first action for a widget, identified by widgetId, itemId, and childId, and sends it.static void
queueWidgetAction2Packet(int widgetId, int itemId, int childId)
Queues a widget action packet with the given widget ID, item ID, and child ID.static void
queueWidgetAction3Packet(int widgetId, int itemId, int childId)
Queues a widget action 3 packet with the specified widget id, item id, and child id.static void
queueWidgetAction4Packet(int widgetId, int itemId, int childId)
Queues a widget action for a packet and sends it.static void
queueWidgetAction5Packet(int widgetId, int itemId, int childId)
Queues a packet to perform the fifth action on a widget with the given id, item id, and child id.static void
queueWidgetAction6Packet(int widgetId, int itemId, int childId)
Queues and sends the sixth action packet for a specified widget with the given item and child id.static void
queueWidgetAction7Packet(int widgetId, int itemId, int childId)
Queues a packet for the seventh action of a widget.static void
queueWidgetAction8Packet(int widgetId, int itemId, int childId)
Queues the eighth action packet for the specified widget, item, and child.static void
queueWidgetAction9Packet(int widgetId, int itemId, int childId)
Queues a ninth action packet for a given widget, item, and child.static void
widgetAction(RSWidget rsWidget, java.lang.String action)
Performs the specified action on the given RSWidget based on the index of the action, invoking the respective widget option method.static void
widgetEighthOption(RSWidget rsWidget)
Performs the eighth option for the given RSWidget.static void
widgetFifthOption(RSWidget rsWidget)
Performs the fifth option action on the specified RSWidget.static void
widgetFirstOption(RSWidget rsWidget)
Queues a widget action 1 packet for the specified RSWidget.static void
widgetFourthOption(RSWidget rsWidget)
Perform the fourth option on a given RSWidget.static void
widgetItemAction(net.eternalclient.api.data.widgets.WidgetInfo container, Item item, int index)
Performs a specific action on a widget item.static void
widgetItemAction(net.eternalclient.api.data.widgets.WidgetInfo container, Item item, java.lang.String action)
Performs a specific action on an item within a widget container.static void
widgetNinthOption(RSWidget rsWidget)
Executes the ninth option of the specified RSWidget.static void
widgetSecondOption(RSWidget rsWidget)
Performs the second option on the specified RSWidget.static void
widgetSeventhOption(RSWidget rsWidget)
Executes the seventh option of the given RSWidget.static void
widgetSixthOption(RSWidget rsWidget)
Performs the sixth option action on the given RSWidget.static void
widgetTenthOption(RSWidget rsWidget)
Executes the tenth option of the specified RSWidget.static void
widgetThirdOption(RSWidget rsWidget)
Executes the third option for the given RSWidget.
-
-
-
Method Detail
-
widgetFirstOption
public static void widgetFirstOption(RSWidget rsWidget)
Queues a widget action 1 packet for the specified RSWidget.- Parameters:
rsWidget
- the RSWidget object to perform the widget action on
-
widgetSecondOption
public static void widgetSecondOption(RSWidget rsWidget)
Performs the second option on the specified RSWidget.- Parameters:
rsWidget
- the RSWidget to perform the second option on
-
widgetThirdOption
public static void widgetThirdOption(RSWidget rsWidget)
Executes the third option for the given RSWidget.- Parameters:
rsWidget
- the RSWidget to perform the third option on
-
widgetFourthOption
public static void widgetFourthOption(RSWidget rsWidget)
Perform the fourth option on a given RSWidget.- Parameters:
rsWidget
- the RSWidget object to perform the action on
-
widgetFifthOption
public static void widgetFifthOption(RSWidget rsWidget)
Performs the fifth option action on the specified RSWidget.- Parameters:
rsWidget
- the RSWidget to perform the action on
-
widgetSixthOption
public static void widgetSixthOption(RSWidget rsWidget)
Performs the sixth option action on the given RSWidget.- Parameters:
rsWidget
- the RSWidget to perform the action on
-
widgetSeventhOption
public static void widgetSeventhOption(RSWidget rsWidget)
Executes the seventh option of the given RSWidget.- Parameters:
rsWidget
- the RSWidget on which to perform the action
-
widgetEighthOption
public static void widgetEighthOption(RSWidget rsWidget)
Performs the eighth option for the given RSWidget.- Parameters:
rsWidget
- the RSWidget object to perform the eighth option on
-
widgetNinthOption
public static void widgetNinthOption(RSWidget rsWidget)
Executes the ninth option of the specified RSWidget.- Parameters:
rsWidget
- the RSWidget to perform the ninth option on
-
widgetTenthOption
public static void widgetTenthOption(RSWidget rsWidget)
Executes the tenth option of the specified RSWidget.- Parameters:
rsWidget
- the RSWidget object to perform the action on
-
widgetItemAction
public static void widgetItemAction(net.eternalclient.api.data.widgets.WidgetInfo container, Item item, java.lang.String action)
Performs a specific action on an item within a widget container.- Parameters:
container
- the widget container holding the itemitem
- the item to perform the action onaction
- the action to be performed on the item
-
widgetItemAction
public static void widgetItemAction(net.eternalclient.api.data.widgets.WidgetInfo container, Item item, int index)
Performs a specific action on a widget item.- Parameters:
container
- the container widgetitem
- the item to perform the action onindex
- the index of the action to perform
-
widgetAction
public static void widgetAction(RSWidget rsWidget, java.lang.String action)
Performs the specified action on the given RSWidget based on the index of the action, invoking the respective widget option method.- Parameters:
rsWidget
- the RSWidget to perform the action onaction
- the desired action to perform
-
queueWidgetAction1Packet
public static void queueWidgetAction1Packet(int widgetId, int itemId, int childId)
Queues a packet of the first action for a widget, identified by widgetId, itemId, and childId, and sends it.- Parameters:
widgetId
- the ID of the widgetitemId
- the ID of the itemchildId
- the ID of the child
-
queueWidgetAction2Packet
public static void queueWidgetAction2Packet(int widgetId, int itemId, int childId)
Queues a widget action packet with the given widget ID, item ID, and child ID.- Parameters:
widgetId
- the ID of the widgetitemId
- the ID of the itemchildId
- the ID of the child
-
queueWidgetAction3Packet
public static void queueWidgetAction3Packet(int widgetId, int itemId, int childId)
Queues a widget action 3 packet with the specified widget id, item id, and child id.- Parameters:
widgetId
- the id of the widgetitemId
- the id of the itemchildId
- the id of the child
-
queueWidgetAction4Packet
public static void queueWidgetAction4Packet(int widgetId, int itemId, int childId)
Queues a widget action for a packet and sends it.- Parameters:
widgetId
- the id of the widgetitemId
- the id of the itemchildId
- the id of the child widget
-
queueWidgetAction5Packet
public static void queueWidgetAction5Packet(int widgetId, int itemId, int childId)
Queues a packet to perform the fifth action on a widget with the given id, item id, and child id.- Parameters:
widgetId
- the id of the widgetitemId
- the id of the itemchildId
- the id of the child
-
queueWidgetAction6Packet
public static void queueWidgetAction6Packet(int widgetId, int itemId, int childId)
Queues and sends the sixth action packet for a specified widget with the given item and child id.- Parameters:
widgetId
- the id of the widgetitemId
- the id of the itemchildId
- the id of the child
-
queueWidgetAction7Packet
public static void queueWidgetAction7Packet(int widgetId, int itemId, int childId)
Queues a packet for the seventh action of a widget.- Parameters:
widgetId
- the ID of the widgetitemId
- the ID of the itemchildId
- the ID of the child
-
queueWidgetAction8Packet
public static void queueWidgetAction8Packet(int widgetId, int itemId, int childId)
Queues the eighth action packet for the specified widget, item, and child.- Parameters:
widgetId
- the id of the widgetitemId
- the id of the itemchildId
- the id of the child
-
queueWidgetAction9Packet
public static void queueWidgetAction9Packet(int widgetId, int itemId, int childId)
Queues a ninth action packet for a given widget, item, and child.- Parameters:
widgetId
- the ID of the widgetitemId
- the ID of the itemchildId
- the ID of the child
-
queueWidgetAction10Packet
public static void queueWidgetAction10Packet(int widgetId, int itemId, int childId)
Queues a widget action packet with the given widget ID, item ID, and child ID, then sends the packet.- Parameters:
widgetId
- the ID of the widgetitemId
- the ID of the itemchildId
- the ID of the child
-
queueResumePauseWidgetPacket
public static void queueResumePauseWidgetPacket(int widgetId, int childId)
Sends a continue packet for the specified widget and child id.- Parameters:
widgetId
- the id of the widgetchildId
- the id of the child widget
-
createType1Action
public static RSPacketBufferNode createType1Action(int widgetId)
Creates a type 1 widget action packet buffer node.- Parameters:
widgetId
- the ID of the widget- Returns:
- the RSPacketBufferNode object
-
createDefaultAction
public static RSPacketBufferNode createDefaultAction(int type, int widgetPackedId, int itemId, int itemSlot)
Returns a `RSPacketBufferNode` representing the default action based on the given parameters.- Parameters:
type
- the widget action typewidgetPackedId
- the packed id of the widgetitemId
- the id of the itemitemSlot
- the slot of the item- Returns:
- the `RSPacketBufferNode` representing the default action
- Throws:
java.lang.IllegalArgumentException
- if the widget action type is invalid
-
createFirstAction
public static RSPacketBufferNode createFirstAction(int widgetId, int itemId, int childId)
Creates a new RSPacketBufferNode for the first action of an RSButton.- Parameters:
widgetId
- the ID of the widget containing the buttonitemId
- the ID of the item linked to the buttonchildId
- the ID of the child button- Returns:
- the created RSPacketBufferNode
-
createSecondAction
public static RSPacketBufferNode createSecondAction(int widgetId, int itemId, int childId)
Creates a second action packet buffer node with the given widget ID, item ID, and child ID.- Parameters:
widgetId
- the ID of the widgetitemId
- the ID of the itemchildId
- the ID of the child- Returns:
- the created packet buffer node
-
createThirdAction
public static RSPacketBufferNode createThirdAction(int widgetId, int itemId, int childId)
Creates a packet buffer node for the third action of a widget with the given widgetId, itemId, and childId.- Parameters:
widgetId
- the id of the widgetitemId
- the id of the itemchildId
- the id of the child- Returns:
- the created packet buffer node
-
createFourthAction
public static RSPacketBufferNode createFourthAction(int widgetId, int itemId, int childId)
Creates a packet buffer node for the fourth action with the specified widget ID, item ID, and child ID.- Parameters:
widgetId
- the ID of the widgetitemId
- the ID of the itemchildId
- the ID of the child- Returns:
- a packet buffer node for the fourth action
-
createFifthAction
public static RSPacketBufferNode createFifthAction(int widgetId, int itemId, int childId)
Creates a packet buffer node for the fifth action on a widget containing the specified widget ID, item ID, and child ID.- Parameters:
widgetId
- the ID of the widgetitemId
- the ID of the itemchildId
- the ID of the child widget- Returns:
- the generated packet buffer node
-
createSixthAction
public static RSPacketBufferNode createSixthAction(int widgetId, int itemId, int childId)
Creates a packet buffer node for the sixth action of a button with specified widget ID, item ID, and child ID.- Parameters:
widgetId
- the widget ID of the buttonitemId
- the item ID to be sentchildId
- the child ID of the button- Returns:
- the created packet buffer node
-
createSeventhAction
public static RSPacketBufferNode createSeventhAction(int widgetId, int itemId, int childId)
Creates a packet buffer node for the seventh action with specified widget ID, item ID, and child ID.- Parameters:
widgetId
- the ID of the widgetitemId
- the ID of the itemchildId
- the ID of the child- Returns:
- the packet buffer node for the seventh action
-
createEighthAction
public static RSPacketBufferNode createEighthAction(int widgetId, int itemId, int childId)
Creates a packet buffer node for the eighth action of a widget button.- Parameters:
widgetId
- the ID of the widgetitemId
- the ID of the itemchildId
- the ID of the child- Returns:
- the created RSPacketBufferNode
-
createNinthAction
public static RSPacketBufferNode createNinthAction(int widgetId, int itemId, int childId)
Creates a packet buffer node for the ninth action with the specified widget ID, item ID, and child ID.- Parameters:
widgetId
- the ID of the widgetitemId
- the ID of the itemchildId
- the ID of the child- Returns:
- the created packet buffer node
-
createTenthAction
public static RSPacketBufferNode createTenthAction(int widgetId, int itemId, int childId)
Creates a packet buffer node for the tenth action of a button on an interface.- Parameters:
widgetId
- the widget ID of the interfaceitemId
- the item ID of the buttonchildId
- the child ID of the button- Returns:
- the created packet buffer node
-
createWidgetOnWidget
public static RSPacketBufferNode createWidgetOnWidget(int sourceWidgetId, int sourceSlot, int sourceItemId, int destinationWidgetId, int destinationSlot, int destinationItemId)
Creates a packet buffer node to send a widget creation packet.- Parameters:
sourceWidgetId
- the ID of the source widgetsourceSlot
- the source slotsourceItemId
- the source item IDdestinationWidgetId
- the ID of the destination widgetdestinationSlot
- the destination slotdestinationItemId
- the destination item ID- Returns:
- the created packet buffer node
-
createContinuePacket
public static RSPacketBufferNode createContinuePacket(int widgetId, int childId)
Creates a continue packet with the given widget and child IDs.- Parameters:
widgetId
- the ID of the widgetchildId
- the ID of the child- Returns:
- the created RSPacketBufferNode
-
-