okay, how about this?
private boolean selectOpenMenuOption(String name) throws InterruptedException {
sA.log("Selecting Menu Option");
if (sA.client.isMenuOpen()) {
List<Option> options = sA.client.getMenu();
for (int i= 0; i < options.size(); i++) {
if (options.get(i).action.equalsIgnoreCase(name)) {
return sA.client.moveMouseTo(new RectangleDestination(sA.client.getMenuX(), sA.client.getMenuY()+19+(i*15), sA.client.getMenuWidth(), 15), false, true, false);
}
}
}
return false;
}
private boolean rightClick(RS2Object object) throws InterruptedException {
if (object != null && sA.canReach(object)) {
return sA.client.moveMouseTo(object.getMouseDestination(), false, true, true);
}
return false;
}
public boolean interactWithRightClick(RS2Object object) throws InterruptedException{
if(rightClick(object)) {
return selectOpenMenuOption(object.getDefinition().getActions()[0]);
}
return false;
}