For some reason, OSBot doesn't have this already. So here:
public boolean selectMenuOption(String action, String noun) throws InterruptedException
{
if (!client.isMenuOpen()) return false;
boolean found = false;
int index = 0;
List<Option> menu = client.getMenu();
for (; index < menu.size(); index++)
{
if (menu.get(index).action.equals(action) && menu.get(index).noun.contains(noun))
{
found = true;
break;
}
}
if (found)
{
int x = client.getMenuX();
int y = client.getMenuY() + 21 + index * 14;
return client.moveMouseTo(new RectangleDestination(x, y, client.getMenuWidth(), 10), false, true, false);
}
return found;
}
Clicks a menu option from a currently visible menu.