bank, bot, camera, chatbox, client, colorPicker, combat, configs, depositBox, dialogues, diaries, display, doorHandler, equipment, experienceTracker, favour, grandExchange, graphicObjects, groundItems, hintArrow, inventory, keyboard, logger, logoutTab, magic, map, menu, mouse, npcs, objects, players, prayer, projectiles, quests, settings, skills, store, tabs, trade, walking, widgets, worlds
Constructor and Description |
---|
Widgets() |
Modifier and Type | Method and Description |
---|---|
boolean |
closeOpenInterface()
Closes the currently open widget (first level), if any.
|
java.util.List<RS2Widget> |
containingActions(int rootId,
java.lang.String... actions)
Gets all widgets for a given parent containing the actions
|
java.util.List<RS2Widget> |
containingSprite(int sprite)
Checks all widgets (second and third level) for the specified sprite.
|
java.util.List<RS2Widget> |
containingSprite(int rootId,
int sprite)
Checks all widgets (second and third level) for the specified parent id (first level) for the specified sprite.
|
java.util.List<RS2Widget> |
containingText(boolean ignoreChatbox,
java.lang.String... texts)
Checks all widgets (second and third level) for a matching text.
|
java.util.List<RS2Widget> |
containingText(int rootId,
java.lang.String... texts)
Checks all the widgets (second and third level) for the specified parent id (first level) for a matching text.
|
java.util.List<RS2Widget> |
containingText(java.lang.String... texts) |
java.util.List<RS2Widget> |
filter(Filter<RS2Widget>... filters)
Filters the widgets
|
java.util.List<RS2Widget> |
filter(int[] rootIds,
Filter<RS2Widget>... filters)
Filters the widgets for the given root ids.
|
java.util.List<RS2Widget> |
filter(int rootId,
Filter<RS2Widget>... filters)
Filters the widgets for the given root id.
|
RS2Widget |
get(int rootId,
int childId)
Returns the widget (second level) for the specified parent and child id.
|
RS2Widget |
get(int rootId,
int childId,
int subChildId)
Returns the widget (third level) for the specified parent, child and subchild id.
|
java.util.List<java.lang.Integer> |
getActiveWidgetRoots()
Gets all active widget root ids
|
java.util.List<RS2Widget> |
getAll()
Gets all the second and third level widgets (the childs of all parents + the sub childs of all childs).
|
RS2Widget |
getCloseInterface()
Gets the widget that closes an open interface
|
boolean[] |
getValid()
Gets the array of booleans determining the validity of the first level widgets.
|
RS2Widget |
getWidgetContainingAction(int rootId,
java.lang.String... actions)
Gets the first widget from a root widget containing a specific action
|
RS2Widget |
getWidgetContainingAction(java.lang.String... actions)
Gets the first widget containing a specific action
|
RS2Widget |
getWidgetContainingSprite(int sprite)
Checks all widgets (second and third level) for the specified sprite.
|
RS2Widget |
getWidgetContainingSprite(int rootId,
int sprite)
Checks all widgets (second and third level) for the specified parent id (first level) for the specified sprite.
|
RS2Widget |
getWidgetContainingText(boolean ignoreChatbox,
java.lang.String... texts)
Checks all widgets excluding
Chatbox messages. |
RS2Widget |
getWidgetContainingText(int rootId,
java.lang.String... texts)
Checks all widgets under the root id.
|
RS2Widget |
getWidgetContainingText(java.lang.String... texts)
Checks all widgets excluding
Chatbox messages. |
RS2Widget[] |
getWidgets(int rootId)
Returns all the child widgets (second level) for the specified parent id.
|
RS2Widget[] |
getWidgets(int rootId,
int childId)
Returns all the child widgets (third level) for the specified parent and child id.
|
void |
initializeModule() |
boolean |
interact(int rootId,
int childId,
int subChildId,
java.lang.String action)
Interacts with a specific child widget (third level).
|
boolean |
interact(int rootId,
int childId,
java.lang.String action)
Interacts with a specific child widget (second level).
|
boolean |
intertact(RS2Widget[] widgets,
java.lang.String action)
Identifies the widget to interact with based on the action and attempts to interact with it
|
boolean |
isValid(int rootId)
Checks if
getValid() returns true for the given root widget id |
boolean |
isVisible(int rootId)
Determines whether the first level widget is visible by checking if any child widgets (second level) are visible.
|
boolean |
isVisible(int rootId,
int childId)
Determines whether the second level widget is visible.
|
boolean |
isVisible(int rootId,
int childId,
int subChildId)
Determines whether the third level widget is visible.
|
boolean |
isVisible(RS2Widget[] widgets)
Determines whether any of the given widgets are visible.
|
java.util.List<RS2Widget> |
matchingTextColour(int rootId,
int textColor)
Checks all widgets (second and third level) for the specified parent id (first level) for the specified text colour.
|
RS2Widget |
refresh(RS2Widget widget)
This methods can be used to refresh the accessor instance of a stored widget instance.
|
RS2Widget |
singleFilter(Filter<RS2Widget>... filters)
Filters the widgets
|
RS2Widget |
singleFilter(int[] rootIds,
Filter<RS2Widget>... filters)
Filters the widgets for the given root id.
|
RS2Widget |
singleFilter(int rootId,
Filter<RS2Widget>... filters)
Filters the widgets for the given root id.
|
filter, singleFilter
exchangeContext, execute, getBank, getBot, getCamera, getChatbox, getClient, getColorPicker, getCombat, getConfigs, getDepositBox, getDialogues, getDiaries, getDisplay, getDoorHandler, getEquipment, getExperienceTracker, getFavour, getGrandExchange, getGraphicObjects, getGroundItems, getHintArrow, getInventory, getKeyboard, getLogoutTab, getMagic, getMap, getMenuAPI, getMouse, getNpcs, getObjects, getPlayers, getPrayer, getProjectiles, getQuests, getSettings, getSkills, getStore, getTabs, getTrade, getWalking, getWidgets, getWorlds, gRandom, gRandom, gRandom, initializeContext, log, log, myPlayer, myPosition, random, random, sleep, stripFormatting, warn
public RS2Widget refresh(RS2Widget widget)
widget
- The widget to refresh.public RS2Widget[] getWidgets(int rootId)
rootId
- The id of the first level widget.public java.util.List<java.lang.Integer> getActiveWidgetRoots()
public RS2Widget[] getWidgets(int rootId, int childId)
rootId
- The id of the first level widget.childId
- The id of the second level widget.public RS2Widget get(int rootId, int childId)
rootId
- The id of the first level widget.childId
- The id of the second level widget.public RS2Widget get(int rootId, int childId, int subChildId)
rootId
- The id of the first level widget.childId
- The id of the second level widget.subChildId
- The id of the third level widget.public boolean[] getValid()
public boolean isValid(int rootId)
getValid()
returns true for the given root widget idrootId
- The root widget idgetValid()
[rootId]public boolean isVisible(RS2Widget[] widgets)
widgets
- The widgets to check for visibility.public boolean isVisible(int rootId)
rootId
- The id of the first level widget.public boolean isVisible(int rootId, int childId)
rootId
- The id of the first level widget.childId
- The id of the second level widget.public boolean isVisible(int rootId, int childId, int subChildId)
rootId
- The id of the first level widget.childId
- The id of the second level widget.subChildId
- The id of the third level widget.public java.util.List<RS2Widget> getAll()
getAll
in class CollectionAPI<RS2Widget>
public RS2Widget getCloseInterface()
public boolean closeOpenInterface()
public boolean intertact(RS2Widget[] widgets, java.lang.String action)
widgets
- The group of widgets to check fromaction
- The action to performpublic boolean interact(int rootId, int childId, java.lang.String action)
rootId
- The id of the first level widget.childId
- The id of the second level widget.action
- The action to interact with.public boolean interact(int rootId, int childId, int subChildId, java.lang.String action)
rootId
- The id of the first level widget.childId
- The id of the second level widget.subChildId
- The id of the third level widget.action
- The action to interact with.public java.util.List<RS2Widget> containingActions(int rootId, java.lang.String... actions)
rootId
- The id of the parent widgetactions
- The actions to check forpublic RS2Widget getWidgetContainingAction(java.lang.String... actions)
actions
- The actions to search forpublic RS2Widget getWidgetContainingAction(int rootId, java.lang.String... actions)
rootId
- The parent widget (first level) id to searchactions
- The actions to search forpublic RS2Widget getWidgetContainingText(int rootId, java.lang.String... texts)
rootId
- The parent widget (first level) id to search.texts
- The widget text(s) to search for.public RS2Widget getWidgetContainingText(java.lang.String... texts)
Chatbox
messages.texts
- The widget text(s) to search for.public RS2Widget getWidgetContainingText(boolean ignoreChatbox, java.lang.String... texts)
Chatbox
messages.ignoreChatbox
- True to ignore all chatbox related widgetstexts
- The widget text(s) to search for.public java.util.List<RS2Widget> containingText(java.lang.String... texts)
containingText(boolean, String...)
with ignoreChatbox truepublic java.util.List<RS2Widget> containingText(boolean ignoreChatbox, java.lang.String... texts)
ignoreChatbox
- True to ignore all chatbox related widgetstexts
- The text/pattern to look for. Each widget only has to contain ONE of the specified text.public java.util.List<RS2Widget> containingText(int rootId, java.lang.String... texts)
rootId
- The parent widget (first level) id to search.texts
- The text/pattern to look for. Each widget only has to contain ONE of the specified text.public java.util.List<RS2Widget> containingSprite(int sprite)
sprite
- The sprite to search for.public java.util.List<RS2Widget> containingSprite(int rootId, int sprite)
rootId
- The id of the first level widget.sprite
- The sprite to search for.public RS2Widget getWidgetContainingSprite(int sprite)
sprite
- The sprite to search for.public RS2Widget getWidgetContainingSprite(int rootId, int sprite)
rootId
- The id of the first level widget.sprite
- The sprite to search for.public java.util.List<RS2Widget> matchingTextColour(int rootId, int textColor)
rootId
- The id of the first level widget.textColor
- The text colors to match.@SafeVarargs public final RS2Widget singleFilter(Filter<RS2Widget>... filters)
filters
- The filters.@SafeVarargs public final RS2Widget singleFilter(int rootId, Filter<RS2Widget>... filters)
rootId
- The root id for which to filter all owned sub widgets (second and third level).filters
- The filters.@SafeVarargs public final RS2Widget singleFilter(int[] rootIds, Filter<RS2Widget>... filters)
rootIds
- The root ids for which to filter all owned sub widgets (second and third level).filters
- The filters.@SafeVarargs public final java.util.List<RS2Widget> filter(Filter<RS2Widget>... filters)
@SafeVarargs public final java.util.List<RS2Widget> filter(int rootId, Filter<RS2Widget>... filters)
rootId
- The root id for which to filter all owned sub widgets (second and third level).filters
- The filters.@SafeVarargs public final java.util.List<RS2Widget> filter(int[] rootIds, Filter<RS2Widget>... filters)
rootIds
- The root ids for which to filter all owned sub widgets (second and third level).filters
- The filters.public void initializeModule()
initializeModule
in class API