Jump to content

How do I interact with specific item?


Zee Best

Recommended Posts

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
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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