uyfgfarOS Posted January 9, 2017 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
Khaleesi Posted January 9, 2017 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
Abuse Posted January 9, 2017 Posted January 9, 2017 (edited) EDIT: I posted in the wrong thread, don't drink and type Edited January 9, 2017 by Abuse 1
uyfgfarOS Posted January 9, 2017 Author 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