Jump to content

How do I interact with specific item?


Recommended Posts

Posted (edited)

OSBot Version: 2.3.90


Description: When using Item.interact with an inventory of the same items it seems to only interact with the first found item.


 


Firstly, I'm not an idiot when it comes to programming, so locking my last post and telling me it was my own issue isn't the way to go about it.


 


Secondly, I've tested numerous ways of doing this and it still does the same thing.


 


Basically, when you have any duplicate items in your inventory and select an item at a slot, for example the last slot, the client will find the first available item of that ID and use that instead.


 


CODE LINKED AS PASTEBIN; Some reason when I write a quick example in Notepad++ the formatting is ruined posting here.


 


http://pastebin.com/LdMRUwJK


 


Now, this works fine if the items are different, for example, with this inventory;


 


d3mYwcs.png


 


First it will drop the Rod, which is correct. Then it will drop the feathers, which is also correct, however after that it begins to drop the trout FROM THE FIRST TROUT TO THE LAST, which isn't correct. It should drop the one next to the feathers and work back, however item.interact seems to just find the next available item not the specific item.


Edited by Zee Best
Posted

Firstly, your example doesn't include anything to do with the var item.

Secondly, how are you getting the item? items[index] or getInventory().getItemAtSlot(index)?

 

Sorry, had to write it into Notepad++ as most of my work uses my own API.

 

I'm using it as items[index] that's why I've declared the array. Even using getItemAtSlot(index) still returns the same result.

Posted

Why has this been moved to scripting help? IT IS A FUCKING BUG. Do you not understand? I'm not an idiot, I've been programming almost 10 years, I'm a Scholar on a different botting forum and I know what I'm doing.

 

I don't need help, I have already told you the problem, use the fucking code I posted with a similar inventory and you will see the issue too...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...