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

Interfaces In Stores

Featured Replies

It seems that the interfaces in stores are very messed up. For one, they are too big and cover 5-6x the size of the objects in the store, but they are also very misaligned. So when using selectInterfaceOption(), it will miss 90% of the time because the child is too large, but even then it's completed misaligned. 

 

This feature would be great to have. Thanks.

 

EDIT: The parent seems to be 300, at least for the general store, with children going for 0-x.

Edited by danieljvdm

I don't understand what you're saying, last time I checked the interface positions + sizes were correct. You probably are thinking that the background sprites are the items. 

  • Developer

Id's of the items in the store are all stored in one particular child. The calculation of the position needs to be done manually. We will add features to the API to interact with stores. For now, you'll have to write it yourself or wait for us to add it to the API. 

  • Developer

You can still do it yourself, it's not hard. Get the child id that contains the items, use the interface value extractor for that, and calculate the position based on their slot.

  • Author

I was having trouble finding the right ids, I'll try again though. How would I calculate position based on slot?

Here's how you do it:

	/**	 * Gets the specified item bounds.	 * @param itemId the item id.	 * @return the item bounds.	 */	private Rectangle getShopItemBounds(int itemId) {		int slot = -1;				for (int i = 0; i < client.getInterface(300).getChild(75).getInv().length; i++) {			if (client.getInterface(300).getChild(75).getInv()[i] - 2 == itemId) {				slot = i + 1;				break;			}		}				if (slot == -1) {			return null;		}				int row = (int) Math.ceil((slot / 8.0) - 1);		int column = slot > 8 ? slot - (row * 8) : slot;		column--;				int x = 80 + (column * 16) + (column * 31);		int y = 69 + (row * 16) + (row * 31);		return new Rectangle(x, y, 31, 31);	}		/**	 * Buys an item from the shop.	 * @param Item the item.	 * @throws InterruptedException if another thread has interrupted the current thread.	 */	private void buyShopItem(Item item) throws InterruptedException {		Rectangle itemBounds = getShopItemBounds(item.getId());		RectangleDestination destination = new RectangleDestination(itemBounds);				selectOption(null, destination, "Buy " + item.getAmount(), false);	}

Edited by Xyssto

  • Author

Where item is the regular Runescape item ID? Thanks a lot bro. So you can use the getInv() method on interfaces? Interesting.

 

I understand this code perfectly, I just wasn't sure how RS stored the items in the shop, this shed a lot of light.

Edited by danieljvdm

  • Developer

Where item is the regular Runescape item ID? Thanks a lot bro. So you can use the getInv() method on interfaces? Interesting.

 

I understand this code perfectly, I just wasn't sure how RS stored the items in the shop, this shed a lot of light.

getInv() is a child specific method and has nothing to do with your inventory. It's the inventory of a child id. The child id containing the items for your inventory for example is interface 149 child 0. 

  • Author

Xyssto, I think your code doesn't work because there is no menu until the item is right-clicked.

It does work, I have tested it before posting. You're probably using it incorrectly.

Edited by Xyssto

Guest
This topic is now closed to further replies.

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

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.