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.

Use an item in specific slot help

Featured Replies

Hey, is there a way to select an item in a specific slot in the inventory? I am using :

sA.inventory.getItemInSlot(14).interact("Use");

to select the 14th unstrung bow, however it just selects the first one (which I understand why). Is there a way to do it without manually defining the area on the screen to click? 

I tried alot of the inventory slot destination and similar API, and I couldn't get it to return a slot other than the first one. so unless you manually use mouse.click and work with slot rectangles, then  I don't think so no. But I could have missed something!

 

apa

Hey, is there a way to select an item in a specific slot in the inventory? I am using :

sA.inventory.getItemInSlot(14).interact("Use");

to select the 14th unstrung bow, however it just selects the first one (which I understand why). Is there a way to do it without manually defining the area on the screen to click? 

http://osbot.org/api/org/osbot/rs07/api/Inventory.html

 

the Inventory subclass doesn't override the ItemContainer's "getItemInSlot" abstract method, meaning it's always gonna use the same method definedd in the parent class

Edited by senpai jinkusu

getItemInSlot simply returns an Item instance. Item does not contain any information about which slot it was retrieved from. So when you try to interact with that item, it will simply use the first one it finds.

 

What you need to use is the overload of interact that takes a slot id as parameter

public boolean interact(int slot,                        java.lang.String... actions)

eg.

getInventory().interact(14, "Use");

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.