Class Widgets

java.lang.Object
net.storm.sdk.widgets.Widgets

public class Widgets extends Object
Provides utility methods for interacting with the game's widget system.

Widgets are the fundamental UI elements in the game client, representing everything from inventory slots and chat boxes to bank interfaces and skill menus. This class offers methods to query, retrieve, and check the visibility of widgets.

Widgets are organized hierarchically using a group/id/child structure:

  • Group: The parent interface (e.g., inventory, bank, skills)
  • ID: A specific widget within the group
  • Child: A child element within a widget (optional)

Example Usage:


 // Get a specific widget by group and id
 IWidget bankWidget = Widgets.get(12, 0);

 // Check if a widget is visible
 if (Widgets.isVisible(bankWidget)) {
     // Interact with the widget
 }

 // Get all widgets in a group matching a filter
 List<IWidget> itemWidgets = Widgets.getAll(149, widget -> widget.getItemId() != -1);

 // Close all open interfaces
 Widgets.closeInterfaces();
 
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    Closes all currently open interfaces.
    static IWidget
    get(int component)
    Retrieves a widget by its packed component ID.
    static IWidget
    get(int group, int id)
    Retrieves a specific widget by its group and ID.
    static IWidget
    get(int group, int id, int child)
    Retrieves a specific widget by its group, ID, and child index.
    static IWidget
    get(int group, Predicate<? super IWidget> filter)
    Retrieves the first widget within a group that matches the given filter.
    static IWidget
    get(InterfaceAddress interfaceAddress)
    Deprecated, for removal: This API element is subject to removal in a future version.
    This method is scheduled for removal.
    static List<IWidget>
    getAll(int group)
    Retrieves all widgets within the specified group.
    static List<IWidget>
    getAll(int group, Predicate<? super IWidget> filter)
    Retrieves all widgets within the specified group that match the given filter.
    getChild(int component, int child)
    Retrieves a child widget from a packed component ID.
    static List<IWidget>
    getChildren(int group, int id, int child, Predicate<IWidget> filter)
    Retrieves all children of the widget at the specified group, ID, and child index that match the filter.
    static List<IWidget>
    getChildren(int group, int id, Predicate<IWidget> filter)
    Retrieves all children of the widget at the specified group and ID that match the filter.
    static List<IWidget>
    getChildren(int component, Predicate<IWidget> filter)
    Retrieves all children of the widget with the specified packed component ID that match the filter.
    static List<IWidget>
    Retrieves all children of a widget that match the specified filter.
    static List<IWidget>
    getChildren(InterfaceAddress interfaceAddress, Predicate<IWidget> filter)
    Deprecated, for removal: This API element is subject to removal in a future version.
    This method is scheduled for removal.
    static boolean
    isVisible(int component)
    Checks whether the widget with the specified packed component ID is visible.
    static boolean
    isVisible(int group, int id)
    Checks whether the widget at the specified group and ID is currently visible.
    static boolean
    isVisible(int group, int id, int child)
    Checks whether the widget at the specified group, ID, and child index is visible.
    static boolean
    Checks whether the specified widget is currently visible on screen.
    static boolean
    isVisible(InterfaceAddress interfaceAddress)
    Deprecated, for removal: This API element is subject to removal in a future version.
    This method is scheduled for removal.

    Methods inherited from class java.lang.Object

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

    • Widgets

      public Widgets()
  • Method Details

    • getAll

      public static List<IWidget> getAll(int group)
      Retrieves all widgets within the specified group.
      Parameters:
      group - the widget group ID to query
      Returns:
      a list of all widgets in the specified group, or an empty list if none exist
    • getAll

      public static List<IWidget> getAll(int group, Predicate<? super IWidget> filter)
      Retrieves all widgets within the specified group that match the given filter.
      Parameters:
      group - the widget group ID to query
      filter - a predicate to filter the widgets
      Returns:
      a list of widgets matching the filter, or an empty list if none match
    • get

      public static IWidget get(int group, int id)
      Retrieves a specific widget by its group and ID.
      Parameters:
      group - the widget group ID
      id - the widget ID within the group
      Returns:
      the widget if found, or null if not found
    • get

      public static IWidget get(int group, int id, int child)
      Retrieves a specific widget by its group, ID, and child index.
      Parameters:
      group - the widget group ID
      id - the widget ID within the group
      child - the child index within the widget
      Returns:
      the child widget if found, or null if not found
    • get

      public static IWidget get(int component)
      Retrieves a widget by its packed component ID.

      The component ID is a packed integer containing both the group and widget ID.

      Parameters:
      component - the packed component ID
      Returns:
      the widget if found, or null if not found
    • get

      @Deprecated(forRemoval=true) public static IWidget get(InterfaceAddress interfaceAddress)
      Deprecated, for removal: This API element is subject to removal in a future version.
      This method is scheduled for removal. Use get(int, int) instead.
      Retrieves a widget by its interface address.
      Parameters:
      interfaceAddress - the interface address specifying the widget location
      Returns:
      the widget if found, or null if not found
    • get

      public static IWidget get(int group, Predicate<? super IWidget> filter)
      Retrieves the first widget within a group that matches the given filter.
      Parameters:
      group - the widget group ID to search
      filter - a predicate to match widgets
      Returns:
      the first matching widget, or null if none match
    • getChild

      public IWidget getChild(int component, int child)
      Retrieves a child widget from a packed component ID.
      Parameters:
      component - the packed component ID of the parent widget
      child - the child index within the widget
      Returns:
      the child widget if found, or null if not found
    • isVisible

      public static boolean isVisible(IWidget widget)
      Checks whether the specified widget is currently visible on screen.
      Parameters:
      widget - the widget to check
      Returns:
      true if the widget is visible, false otherwise
    • isVisible

      public static boolean isVisible(int group, int id)
      Checks whether the widget at the specified group and ID is currently visible.
      Parameters:
      group - the widget group ID
      id - the widget ID within the group
      Returns:
      true if the widget is visible, false otherwise
    • isVisible

      public static boolean isVisible(int group, int id, int child)
      Checks whether the widget at the specified group, ID, and child index is visible.
      Parameters:
      group - the widget group ID
      id - the widget ID within the group
      child - the child index within the widget
      Returns:
      true if the widget is visible, false otherwise
    • isVisible

      public static boolean isVisible(int component)
      Checks whether the widget with the specified packed component ID is visible.
      Parameters:
      component - the packed component ID
      Returns:
      true if the widget is visible, false otherwise
    • isVisible

      @Deprecated(forRemoval=true) public static boolean isVisible(InterfaceAddress interfaceAddress)
      Deprecated, for removal: This API element is subject to removal in a future version.
      This method is scheduled for removal. Use isVisible(int, int) instead.
      Checks whether the widget at the specified interface address is visible.
      Parameters:
      interfaceAddress - the interface address of the widget
      Returns:
      true if the widget is visible, false otherwise
    • getChildren

      public static List<IWidget> getChildren(IWidget widget, Predicate<IWidget> filter)
      Retrieves all children of a widget that match the specified filter.
      Parameters:
      widget - the parent widget
      filter - a predicate to filter child widgets
      Returns:
      a list of matching child widgets, or an empty list if none match
    • getChildren

      public static List<IWidget> getChildren(int group, int id, Predicate<IWidget> filter)
      Retrieves all children of the widget at the specified group and ID that match the filter.
      Parameters:
      group - the widget group ID
      id - the widget ID within the group
      filter - a predicate to filter child widgets
      Returns:
      a list of matching child widgets, or an empty list if none match
    • getChildren

      public static List<IWidget> getChildren(int group, int id, int child, Predicate<IWidget> filter)
      Retrieves all children of the widget at the specified group, ID, and child index that match the filter.
      Parameters:
      group - the widget group ID
      id - the widget ID within the group
      child - the child index within the widget
      filter - a predicate to filter child widgets
      Returns:
      a list of matching child widgets, or an empty list if none match
    • getChildren

      public static List<IWidget> getChildren(int component, Predicate<IWidget> filter)
      Retrieves all children of the widget with the specified packed component ID that match the filter.
      Parameters:
      component - the packed component ID
      filter - a predicate to filter child widgets
      Returns:
      a list of matching child widgets, or an empty list if none match
    • getChildren

      @Deprecated(forRemoval=true) public static List<IWidget> getChildren(InterfaceAddress interfaceAddress, Predicate<IWidget> filter)
      Deprecated, for removal: This API element is subject to removal in a future version.
      This method is scheduled for removal. Use getChildren(int, int, Predicate) instead.
      Retrieves all children of the widget at the specified interface address that match the filter.
      Parameters:
      interfaceAddress - the interface address of the parent widget
      filter - a predicate to filter child widgets
      Returns:
      a list of matching child widgets, or an empty list if none match
    • closeInterfaces

      public static void closeInterfaces()
      Closes all currently open interfaces.

      This is equivalent to pressing the Escape key to close modal interfaces such as the bank, shop, or dialog windows.