uyfgfarOS Posted January 9, 2017 Share Posted January 9, 2017 (edited) Hi all, I'm developing a simple herb cleaner that cleans herbs, sells clean, buys grimy and repeat. I'm a bit stuck on the Grand Exchange, I'm just trying to find out how to get the grand exchange window to stay open and wait for the offers to buy or sell to complete, then collect. This is my logic so far: while (grandExchange.getStatus(GrandExchange.Box.BOX_1).valueOf(getName()).toString() == "PENDING_SALE") { if (grandExchange.getStatus(GrandExchange.Box.BOX_1).valueOf(getName()).toString() == "FINISHED_SALE"); { grandExchange.collect(); break; } } Cheers Edited January 9, 2017 by uyfgfarOS Quote Link to comment Share on other sites More sharing options...
Khaleesi Posted January 9, 2017 Share Posted January 9, 2017 You don't need a while loop, the OnLoop is basicly your while loop Try this: if (grandExchange.getStatus(GrandExchange.Box.BOX_1) == GrandExchange.Status.PENDING_BUY) { status = "Pending offer"; }else if (grandExchange.getStatus(GrandExchange.Box.BOX_1) == GrandExchange.Status.FINISHED_BUY) { status = "Offer completed - Collecting"; } 2 Quote Link to comment Share on other sites More sharing options...
Abuse Posted January 9, 2017 Share Posted January 9, 2017 (edited) EDIT: I posted in the wrong thread, don't drink and type Edited January 9, 2017 by Abuse 1 Quote Link to comment Share on other sites More sharing options...
idential Posted January 9, 2017 Share Posted January 9, 2017 nice idea! should be solid gp/h Quote Link to comment Share on other sites More sharing options...
uyfgfarOS Posted January 9, 2017 Author Share Posted January 9, 2017 You don't need a while loop, the OnLoop is basicly your while loop Try this: if (grandExchange.getStatus(GrandExchange.Box.BOX_1) == GrandExchange.Status.PENDING_BUY) { status = "Pending offer"; }else if (grandExchange.getStatus(GrandExchange.Box.BOX_1) == GrandExchange.Status.FINISHED_BUY) { status = "Offer completed - Collecting"; } Cheers mate, completely forgot about the onLoop! nice idea! should be solid gp/h Thanks mate! I'll post when I've finished it Quote Link to comment Share on other sites More sharing options...