Jump to content

Inventory Issue?


Recommended Posts

Posted

Not really sure why this is happening, but after interacting with an item in the inventory, it hovers over the item again or something like that?

FW1smjn.gif

In this example it involves dropping, but even things like ID'ing herbs causes this to happen.

Any ideas how to fix? I am just looping over inventory.getItems(), and it's only iterating once...

Posted

Not really sure why this is happening, but after interacting with an item in the inventory, it hovers over the item again or something like that?

FW1smjn.gif

In this example it involves dropping, but even things like ID'ing herbs causes this to happen.

Any ideas how to fix? I am just looping over inventory.getItems(), and it's only iterating once...

Show us the code? And by the way for dropping you just probably just use getInventory().dropAll(itemName);

Posted (edited)

Like I said I'm literally just iterating inventory.getItems and interacting with the item. And that built in method got me banned so I made my own.

How do you know it was the built in drop method that got you banned emote32342.png

 

And just so you know, all the built in method does is:

Filter nameFilter = new NameFilter("Trout");

for (int slot = 0; slot < 28; slot ++) {

   Item itemInSlot = getInventory().getItemInSlot(slot);

   if(itemInSlot != null && nameFilter.match(itemInSlot)) {
       getInventory().interact(slot, "Drop");
       sleep(gRandom(75, 25));
   }    
}

So I fail to see how what you are doing will be any different.

Edited by Explv
Posted (edited)

How do you know it was the built in drop method that got you banned emote32342.png

 

And just so you know, all the built in method does is:

Filter nameFilter = new NameFilter("Trout");

for (int slot = 0; slot < 28; slot ++) {

   Item itemInSlot = getInventory().getItemInSlot(slot);

   if(itemInSlot != null && nameFilter.match(itemInSlot)) {
       getInventory().interact(slot, "Drop");
       sleep((long)gRandom(75, 25.0D));
   }    
}

So I fail to see how what you are doing will be any different.

 

 

randomized drop patterns are gud?

They are pretty to watch :boge:

Edited by House
Posted (edited)

randomized drop patterns are gud?

They are pretty to watch boge.png

 

Well he isn't randomizing it, he's just iterating over the inventory and dropping the items in order?

 

And I don't think randomizing it would make any difference, and would probably be slower lol

Edited by Explv
Posted

Well he isn't randomizing it, he's just iterating over the inventory and dropping the items in order?

 

And I don't think randomizing it would make any difference, and would probably be slower lol

 

Not really a problem for it going slower. Thanks for showing me how to use Filters and getItemInSlot kappa. But shouldn't it be < 27 :D

Posted (edited)

Not really a problem for it going slower. Thanks for showing me how to use Filters and getItemInSlot kappa. But shouldn't it be < 27 biggrin.png

 

What you are experiencing is the fact that the Inventory doesn't update immediately. Either loop all 28 slots in 1 onLoop, or keep an iterator between onLoops to know where to continue from.

 

Also, its < 28 cause indexes 0-27 need to be iterated over :p

Edited by Lemons
  • Like 1
Posted (edited)

Not really a problem for it going slower. Thanks for showing me how to use Filters and getItemInSlot kappa. But shouldn't it be < 27 biggrin.png

 

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27

 

0                                                                                                                                       < 28

Edited by Explv

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