Jump to content

using GrandExchange API


PayPalMeRSGP
 Share

Recommended Posts

How do you get the GrandExchange.Box that the below method uses to buy an item. 

buyItem(int itemId, java.lang.String searchTerm, int price, int quantity) 

 

Is there another way of doing it that is not (python-like psuedocode)

for box in geBoxes:
	if box.getItemID == correctItemID:
      return box
return null

Thanks. 

Link to comment
Share on other sites

Just thought I'd add this code in, this will test if the item has been brought in a specific box in the GE so if you have any waiting involved you can use this code to check if the buy has completed.

// Tests to see if box one is being used or not
if (getGrandExchange().getStatus(GrandExchange.Box.BOX_1) != GrandExchange.Status.EMPTY) {
	log("Box 1 of the Grand Exchange is not empty...");
	sleep(random(2000, 3000));
    // Tests to see if box 1 is finished
	if (grandExchange.getAmountRemaining(GrandExchange.Box.BOX_1) == 0) {
	    log("Item 1 has finished in GE box 1...");
    }
}

Also I used 'getAmountRemaining' because all the other methods were not working for me in the new update.

-Flewis

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.

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.

 Share

  • Recently Browsing   0 members

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