Package rsb.methods

Class Equipment


public class Equipment extends MethodProvider
Equipment related operations.
  • Method Details

    • getInterface

      public RSWidget getInterface()
      Gets the equipment interface.
      Returns:
      the equipment interface
    • getItems

      public RSItem[] getItems()
      Gets the equipment array.
      Returns:
      An array containing all equipped items
    • getCachedItems

      public RSItem[] getCachedItems()
      Gets the cached equipment array (i.e. does not open the interface).
      Returns:
      The items equipped as seen when the equipment tab was last opened.
    • getItem

      public RSItem getItem(int index)
      Gets the equipment item at a given index.
      Parameters:
      index - The item index.
      Returns:
      The equipped item.
    • find

      public RSItem[] find(Predicate<RSItem> filter)
    • getCount

      public int getCount()
      Returns the number of items equipped excluding stack sizes.
      Returns:
      Amount of items currently equipped.
    • getCount

      public int getCount(int itemID)
      Returns the number of items matching a given ID equipped excluding stack sizes.
      Parameters:
      itemID - The item ID to count. Same as the equipment/item id in the inventory.
      Returns:
      Amount of specified item currently equipped.
      See Also:
    • containsAll

      public boolean containsAll(int... items)
      Checks whether the player has all of the given items equipped.
      Parameters:
      items - The item ID to check for. Same as the equipment/item id in the inventory.
      Returns:
      true if specified item is currently equipped; otherwise false.
      See Also:
    • containsOneOf

      public boolean containsOneOf(int... items)
      Checks if the player has one (or more) of the given items equipped.
      Parameters:
      items - The IDs of items to check for.
      Returns:
      true if the player has one (or more) of the given items equipped; otherwise false.