August 22, 201510 yr 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?
August 22, 201510 yr 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
August 22, 201510 yr 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 August 22, 201510 yr by senpai jinkusu
August 22, 201510 yr 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