Jump to content

Waiting for items to buy/sell in the GE


Recommended Posts

Posted (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 by uyfgfarOS
Posted

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";
}
  • Like 2
Posted

 

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 :) 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...