Chicken Wing Posted August 22, 2015 Share Posted August 22, 2015 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? 1 Quote Link to comment Share on other sites More sharing options...
Flamezzz Posted August 22, 2015 Share Posted August 22, 2015 mouse.click(inventory.getMouseDestination(slot))something like this 1 Quote Link to comment Share on other sites More sharing options...
Apaec Posted August 22, 2015 Share Posted August 22, 2015 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 Quote Link to comment Share on other sites More sharing options...
senpai jinkusu Posted August 22, 2015 Share Posted August 22, 2015 (edited) 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, 2015 by senpai jinkusu Quote Link to comment Share on other sites More sharing options...
FrostBug Posted August 22, 2015 Share Posted August 22, 2015 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"); 1 Quote Link to comment Share on other sites More sharing options...