Package rsb.methods
Class Menu
java.lang.Object
rsb.methods.MethodProvider
rsb.methods.Menu
- Direct Known Subclasses:
ChooseOption
Context menu related operations.
-
Field Summary
Fields inherited from class rsb.methods.MethodProvider
methods
-
Method Summary
Modifier and TypeMethodDescriptionboolean
clickIndex
(int i) Left clicks at the given index.boolean
Checks whether a given action (or action substring) is present in the menu.boolean
Checks whether a given action with given target is present in the menu.boolean
Clicks the menu target.boolean
Clicks the menu target.String[]
net.runelite.api.MenuEntry[]
String[]
int
Returns the index in the menu for a given action.int
Returns the index in the menu for a given action with a given target.String[]
boolean
Checks whether the menu is collapsed.boolean
isOpen()
Checks whether the menu is open.boolean
itemHasAction
(RSItem item, String action) Determines if the item contains the desired action.static String
stripFormatting
(String input) Strips HTML tags.
-
Method Details
-
doAction
Clicks the menu target. Will left-click if the menu item is the first, otherwise open menu and click the target.- Parameters:
action
- The action (or action substring) to click.- Returns:
true
if the menu item was clicked; otherwisefalse
.
-
doAction
Clicks the menu target. Will left-click if the menu item is the first, otherwise open menu and click the target.- Parameters:
action
- The action (or action substring) to click.target
- The target (or target substring) of the action to click.- Returns:
true
if the menu item was clicked; otherwisefalse
.
-
itemHasAction
Determines if the item contains the desired action.- Parameters:
item
- The item to check.action
- The item menu action to check.- Returns:
true
if the item has the action; otherwisefalse
.
-
clickIndex
public boolean clickIndex(int i) Left clicks at the given index.- Parameters:
i
- The index of the item.- Returns:
true
if the mouse was clicked; otherwisefalse
.
-
getLocation
-
isCollapsed
public boolean isCollapsed()Checks whether the menu is collapsed.- Returns:
true
if the menu is collapsed; otherwisefalse
.
-
isOpen
public boolean isOpen()Checks whether the menu is open.- Returns:
true
if the menu is open; otherwisefalse
.
-
stripFormatting
Strips HTML tags.- Parameters:
input
- The string you want to parse.- Returns:
- The parsed
String
.
-
getEntries
public net.runelite.api.MenuEntry[] getEntries() -
getEntriesString
-
getActions
-
getTargets
-
getIndex
Returns the index in the menu for a given action. Starts at 0.- Parameters:
action
- The action that you want the index of.- Returns:
- The index of the given target in the context menu; otherwise -1.
-
getIndex
Returns the index in the menu for a given action with a given target. Starts at 0.- Parameters:
action
- The action of the menu entry of which you want the index.target
- The target of the menu entry of which you want the index. If target is null, operates like getIndex(String action).- Returns:
- The index of the given target in the context menu; otherwise -1.
-
contains
Checks whether a given action (or action substring) is present in the menu.- Parameters:
action
- The action or action substring.- Returns:
true
if present, otherwisefalse
.
-
contains
Checks whether a given action with given target is present in the menu.- Parameters:
action
- The action or action substring.target
- The target or target substring.- Returns:
true
if present, otherwisefalse
.
-