rendered paste body public int doInventory(int invIndex, String Action)
throws InterruptedException {
Rectangle inventorySpot = Info.getInventoryRectangle(invIndex);
int currentMouseX = currentMouseX();
int currentMouseY = currentMouseY();
if (inventorySpot.contains(currentMouseX, currentMouseY)) {
mouseClickRight(currentMouseX, currentMouseY);
Menu bankBoothMenu = getMenu(Areas.GAME, 2000);
//if(bankBoothMenu.getOption(0).toLowerCase().contains("cancel")){log("woot");}
// if (bankBoothMenu != null) {
int selectindex=-1;
for(int i=0; i<bankBoothMenu.options.length; i++)
{
String options = bankBoothMenu.getOption(i);
sleep(100);
//if(options.toLowerCase().contains("cancel")) { bankBoothMenu.exit(); return 0; }
log("menu containing" + options);
if(options.contains(Action)) { log("found the All text and set the selectindex"); bankBoothMenu.select(i);}
}
if(selectindex==-1) { return 0; }
//}
} /*else {
mouseClickRight(inventorySpot);
Menu bankBoothMenu = getMenu(Areas.GAME, 2000);
if (bankBoothMenu != null) {
sleep(100);
int selectindex=-1;
for(int i=0; i<bankBoothMenu.options.length; i++)
{
String options = bankBoothMenu.getOption(i);
sleep(100);
if(options.toLowerCase().contains("cancel")) { bankBoothMenu.exit(); return 0;}
log("menu containing" + options);
if(options.contains(Action)) { selectindex = i; }
}
bankBoothMenu.select(selectindex);
}//ifbankboothnotnull
}//else */
sleep(250);
return 1;
}//doinventory