Jump to content

using GrandExchange API


Recommended Posts

Posted

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. 

Posted

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

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...