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 TypeMethodDescriptionbooleanclickIndex(int i) Left clicks at the given index.booleanChecks whether a given action (or action substring) is present in the menu.booleanChecks whether a given action with given target is present in the menu.booleanClicks the menu target.booleanClicks the menu target.String[]net.runelite.api.MenuEntry[]String[]intReturns the index in the menu for a given action.intReturns the index in the menu for a given action with a given target.String[]booleanChecks whether the menu is collapsed.booleanisOpen()Checks whether the menu is open.booleanitemHasAction(RSItem item, String action) Determines if the item contains the desired action.static StringstripFormatting(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:
trueif 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:
trueif 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:
trueif 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:
trueif the mouse was clicked; otherwisefalse.
-
getLocation
-
isCollapsed
public boolean isCollapsed()Checks whether the menu is collapsed.- Returns:
trueif the menu is collapsed; otherwisefalse.
-
isOpen
public boolean isOpen()Checks whether the menu is open.- Returns:
trueif 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:
trueif 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:
trueif present, otherwisefalse.
-