Class ProcessingService


  • public class ProcessingService
    extends java.lang.Object
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getAmount()
      Retrieves the current value of the skill multi-quantity variable.
      boolean isOpen()
      Determines whether the widget corresponding to the specified interface ID is currently open and visible.
      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.
      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.
      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.
      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.
      void setAmount​(int amount)
      Sets the skill multi-quantity value to the specified amount.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ProcessingService

        public ProcessingService()
    • 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 itemIds match 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:
        true if at least one of the provided itemIds matches the processable items and an interaction is successfully queued; false otherwise.
      • 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 itemIds match 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:
        true if at least one of the provided itemIds matches the processable items and an interaction is successfully queued; false otherwise.
      • 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 itemNames match 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:
        true if at least one of the provided itemNames matches the processable items and an interaction is successfully queued; false otherwise.
      • 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 by getAmount().

        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 is null, it returns false, indicating that it is not open. Otherwise, it checks the visibility of the widget and returns true if the widget is visible.

        Returns:
        true if the widget is open and currently visible; false otherwise.
      • 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 0 if 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_QUANTITY variable to the specified amount by 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.