Class Menu
- java.lang.Object
-
- org.dreambot.api.wrappers.widgets.Menu
-
public class Menu extends java.lang.ObjectStatic class to interact with the top level Menu
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static booleanclickAction(java.lang.String action)Clicks the menu action given.static booleanclickAction(java.lang.String action, java.lang.String name)Click action.static booleanclickAction(java.lang.String action, java.lang.String name, int id)Click action.static booleanclickAction(java.lang.String action, java.lang.String name, Entity entity)Deprecated.static booleanclickAction(java.lang.String action, Entity entity)Click action.static booleanclickIndex(int index)Click index.static booleanclose()Removes the current top level menu from the game interface.static booleancontains(java.lang.String action)Determines if menu contains action (NOT THE ENTITY/OBJECT NAME) in one of the menu rows.static booleancontains(java.lang.String action, java.lang.String object, Entity entity)Deprecated.static booleancontains(java.lang.String action, Entity entity)Determines if menu contains action (NOT THE ENTITY/OBJECT NAME) in one of the menu rows.static booleancontainsEntity(Entity entity)static booleancontainsObject(java.lang.String name)Determines if menu contains object name (NOT THE ACTION) in one of the menu rows.static java.awt.RectanglegetBounds()Gets bounds.static intgetCount()static java.lang.StringgetDefaultAction()Gets default action.static MenuRowgetFirstMenuRow()static intgetHeight()static intgetIndex(java.lang.String action)Gets the index of offset menu item in the list of menu itemsstatic intgetIndex(java.lang.String action, java.lang.String object)Gets index.static intgetIndex(java.lang.String action, java.lang.String object, int id)Gets the index of offset menu item in the list of menu items using the given action, object, and entity index if provided.static intgetIndex(java.lang.String action, java.lang.String object, Entity entity)Deprecated.static intgetIndex(java.lang.String action, Entity entity)Gets index.static java.awt.RectanglegetIndexRectangle(int index)Gets index rectangle.static GameMenugetMenu()static java.util.List<MenuRow>getMenuRows()Gets each row of the menu as a MenuRow objectstatic java.util.List<MenuRow>getMenuRows(org.dreambot.internal.injector.interfaces.RSMenu menu)static java.lang.String[]getOptions()Deprecated.use getMenuRows for row datastatic java.util.List<GameMenu>getSubMenus()static intgetWidth()static intgetX()static intgetY()static booleanhover(int index)static booleaninject(MenuRow row)static booleaninject(MenuRow row, java.awt.Point p)static booleanisMenuManipulationActive()static booleanisMouseOnAction(int index)Is mouse on action.static booleanisMouseOnAction(java.lang.String action)Is mouse on action.static booleanisVisible()static booleanmouseOverAction(int index)Mouse over action.static booleanmouseOverAction(java.lang.String action)Mouse over action.static booleanopen()static voidtoggleMenuManipulation(boolean toggle)
-
-
-
Method Detail
-
containsEntity
public static boolean containsEntity(Entity entity)
-
isVisible
public static boolean isVisible()
-
getHeight
public static int getHeight()
-
getWidth
public static int getWidth()
-
getY
public static int getY()
-
getX
public static int getX()
-
getCount
public static int getCount()
-
getOptions
@Deprecated public static java.lang.String[] getOptions()
Deprecated.use getMenuRows for row data- Returns:
-
getSubMenus
public static java.util.List<GameMenu> getSubMenus()
-
getMenu
public static GameMenu getMenu()
-
getIndex
@Deprecated public static int getIndex(java.lang.String action, java.lang.String object, Entity entity)Deprecated.
-
getFirstMenuRow
@Nullable public static MenuRow getFirstMenuRow()
-
getMenuRows
public static java.util.List<MenuRow> getMenuRows()
Gets each row of the menu as a MenuRow object- Returns:
- List of MenuRow
-
getMenuRows
public static java.util.List<MenuRow> getMenuRows(org.dreambot.internal.injector.interfaces.RSMenu menu)
-
getBounds
public static java.awt.Rectangle getBounds()
Gets bounds.- Returns:
- the bounds
-
getDefaultAction
public static java.lang.String getDefaultAction()
Gets default action.- Returns:
- the default action
-
getIndex
public static int getIndex(java.lang.String action)
Gets the index of offset menu item in the list of menu items- Parameters:
action- The action to look for- Returns:
- The index of the item if it was found, otherwise -1.
-
getIndex
public static int getIndex(java.lang.String action, Entity entity)Gets index.- Parameters:
action- the actionentity- the entity- Returns:
- the index
-
getIndex
public static int getIndex(java.lang.String action, java.lang.String object)Gets index.- Parameters:
action- the actionobject- the object- Returns:
- the index
-
getIndex
public static int getIndex(java.lang.String action, java.lang.String object, int id)Gets the index of offset menu item in the list of menu items using the given action, object, and entity index if provided.- Parameters:
action- the action to get the index forobject- the object to get the index forid- the entity id to get exact index, use -1 to ignore- Returns:
- The index of the item if it was found, otherwise -1.
-
clickAction
public static boolean clickAction(java.lang.String action)
Clicks the menu action given.- Parameters:
action- The action to click, using best option.- Returns:
- the boolean
-
clickAction
public static boolean clickAction(java.lang.String action, java.lang.String name)Click action.- Parameters:
action- the actionname- the name- Returns:
- the boolean
-
clickAction
@Deprecated public static boolean clickAction(java.lang.String action, java.lang.String name, Entity entity)Deprecated.
-
clickAction
public static boolean clickAction(java.lang.String action, Entity entity)Click action.- Parameters:
action- the actionentity- the entity- Returns:
- the boolean
-
clickAction
public static boolean clickAction(java.lang.String action, java.lang.String name, int id)Click action.- Parameters:
action- the actionname- the name of the objectid- the entity index- Returns:
- the boolean
-
clickIndex
public static boolean clickIndex(int index)
Click index.- Parameters:
index- the index- Returns:
- the boolean
-
open
public static boolean open()
-
getIndexRectangle
public static java.awt.Rectangle getIndexRectangle(int index)
Gets index rectangle.- Parameters:
index- the index- Returns:
- the index rectangle
-
mouseOverAction
public static boolean mouseOverAction(java.lang.String action)
Mouse over action.- Parameters:
action- the action- Returns:
- the boolean
-
mouseOverAction
public static boolean mouseOverAction(int index)
Mouse over action.- Parameters:
index- the index- Returns:
- the boolean
-
isMouseOnAction
public static boolean isMouseOnAction(java.lang.String action)
Is mouse on action.- Parameters:
action- the action- Returns:
- the boolean
-
isMouseOnAction
public static boolean isMouseOnAction(int index)
Is mouse on action.- Parameters:
index- the index- Returns:
- the boolean
-
close
public static boolean close()
Removes the current top level menu from the game interface.- Returns:
- the boolean
-
containsObject
public static boolean containsObject(java.lang.String name)
Determines if menu contains object name (NOT THE ACTION) in one of the menu rows.- Parameters:
name- the name of the entity/object to check- Returns:
- true if menu contains name, otherwise false
-
contains
public static boolean contains(java.lang.String action)
Determines if menu contains action (NOT THE ENTITY/OBJECT NAME) in one of the menu rows.- Parameters:
action- the action to check- Returns:
- true if menu contains action, otherwise false
-
contains
public static boolean contains(java.lang.String action, Entity entity)Determines if menu contains action (NOT THE ENTITY/OBJECT NAME) in one of the menu rows.- Parameters:
action- the action to checkentity- the to filter search- Returns:
- true if menu contains action, otherwise false
-
contains
@Deprecated public static boolean contains(java.lang.String action, java.lang.String object, Entity entity)Deprecated.
-
isMenuManipulationActive
public static boolean isMenuManipulationActive()
-
toggleMenuManipulation
public static void toggleMenuManipulation(boolean toggle)
-
inject
public static boolean inject(MenuRow row)
-
inject
public static boolean inject(MenuRow row, java.awt.Point p)
-
hover
public static boolean hover(int index)
-
-