Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

using GrandExchange API

Featured Replies

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. 

private GrandExchange.Box getBox(){
        for (GrandExchange.Box box : GrandExchange.Box.values()) {
            if (getGrandExchange().getItemId(box) == correctItemID)
                return box;
        }
        return null;
}

 

Edited by Chris

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

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.