Class ProcessingService
- java.lang.Object
-
- com.kraken.api.service.ui.processing.ProcessingService
-
public class ProcessingService extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description ProcessingService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetAmount()Retrieves the current value of the skill multi-quantity variable.booleanisOpen()Determines whether the widget corresponding to the specified interface ID is currently open and visible.booleanprocess(int... itemIds)Confirms the selection of one of the specified item IDs by resuming the appropriate widget interaction based on the current multi-quantity value.booleanprocess(ContainerItem containerItem)Confirms the selection of one of the specified container items by resuming the appropriate widget interaction based on the current multi-quantity value.booleanprocess(java.lang.String... itemNames)Confirms the selection of one of the specified item names by resuming the appropriate widget interaction based on the current multi-quantity value.voidprocessByIndex(int index)Confirms the selected index by resuming the specific widget and child interface associated with the provided index and the current multi-quantity value.voidsetAmount(int amount)Sets the skill multi-quantity value to the specified amount.
-
-
-
Method Detail
-
process
public boolean process(int... itemIds)
Confirms the selection of one of the specified item IDs by resuming the appropriate widget interaction based on the current multi-quantity value. This method expects the item id of the item to create, not necessarily the item the player has. i.e. for cooking Salmon it expects the item id of a cooked salmon, not the raw salmon that the player may have in their inventory.This method iterates over a map of processable item IDs and their associated slot indices, checking if any of the provided
itemIdsmatch the available items. If a match is found, it sends a "resume/pause" action packet for the corresponding widget slot with the current quantity value.- Parameters:
itemIds- A variable-length list of item IDs to compare against the processable items currently available. These represent the items the user wants to confirm.- Returns:
trueif at least one of the provideditemIdsmatches the processable items and an interaction is successfully queued;falseotherwise.
-
process
public boolean process(ContainerItem containerItem)
Confirms the selection of one of the specified container items by resuming the appropriate widget interaction based on the current multi-quantity value. This method expects the item id of the item to create, not necessarily the item the player has. i.e. for cooking Salmon it expects the item id of a cooked salmon, not the raw salmon that the player may have in their inventory.This method iterates over a map of processable item IDs and their associated slot indices, checking if any of the provided
itemIdsmatch the available items. If a match is found, it sends a "resume/pause" action packet for the corresponding widget slot with the current quantity value.- Parameters:
containerItem- A non null container item to compare against the processable items currently available. These represent the items the user wants to confirm.- Returns:
trueif at least one of the provideditemIdsmatches the processable items and an interaction is successfully queued;falseotherwise.
-
process
public boolean process(java.lang.String... itemNames)
Confirms the selection of one of the specified item names by resuming the appropriate widget interaction based on the current multi-quantity value.This method iterates over a map of processable item IDs and their associated slot indices, checking if any of the provided
itemNamesmatch the available items. If a match is found, it sends a "resume/pause" action packet for the corresponding widget slot with the current quantity value.- Parameters:
itemNames- A variable-length list of item names to compare against the processable items currently available. These represent the items the user wants to confirm.- Returns:
trueif at least one of the provideditemNamesmatches the processable items and an interaction is successfully queued;falseotherwise.
-
processByIndex
public void processByIndex(int index)
Confirms the selected index by resuming the specific widget and child interface associated with the provided index and the current multi-quantity value.This method executes on the client thread to ensure thread safety. It resolves the widget ID using a base interface ID and the provided
index, and queues the corresponding "resume/pause" action packet using the multi-quantity value retrieved bygetAmount().- Parameters:
index- The index to confirm in the interface. This value determines the child component of the base widget that the action will target.
-
isOpen
public boolean isOpen()
Determines whether the widget corresponding to the specified interface ID is currently open and visible.This method retrieves the widget associated with the
InterfaceID.Skillmulti.UNIVERSE. If the widget isnull, it returnsfalse, indicating that it is not open. Otherwise, it checks the visibility of the widget and returnstrueif the widget is visible.- Returns:
trueif the widget is open and currently visible;falseotherwise.
-
getAmount
public int getAmount()
Retrieves the current value of the skill multi-quantity variable.This method executes on the game client's thread. It reads the value associated with
VarClientID.SKILLMULTI_QUANTITY, which represents the current quantity in the make-X interface or other similar functionality.The value retrieval ensures thread-safety by invoking the method on the client's thread.
- Returns:
- The integer value of the @VarClientID.SKILLMULTI_QUANTITY variable,
or
0if no value is set or the retrieval fails.
-
setAmount
public void setAmount(int amount)
Sets the skill multi-quantity value to the specified amount.This method first compares the current value of the skill multi-quantity variable with the provided
amount. If they are the same, the method exits early without making any changes.If the values differ, the method updates the
VarClientID.SKILLMULTI_QUANTITYvariable to the specifiedamountby executing the update logic on the game client's thread. This ensures thread safety and avoids potential concurrency issues.- Parameters:
amount- The integer value to set as the new skill multi-quantity. It represents the selected quantity in the "Make-X" interface or similar functionality.
-
-