Jump to content

Waiting for items to buy/sell in the GE


uyfgfarOS

Recommended Posts

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

 

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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