Jump to content

Inventory.getAmount Doesn't recognize stackables


lazyy

Recommended Posts

 

It probably returns the amount of inventory slots with that item.

You could do something like this (not tested):

this.client.getInventory().getItemForName("Rune arrow").getAmount();

 

will try it out but its basically the same as what i used before

 

client.getInventory.getAmount("Dragon bolts (e)");

Link to comment
Share on other sites

No it is not, your code will give you the amount of slots that is filled with Dragon bolts (e). 

My code will get that item and tell you how many of them are in that stack.

 

 

didn't work still counts as one

nvm im probably an retard this is my code

 

if(i.contains("Rune arrow")){

                i.getItemForName("Rune arrow").getAmount();

            totalgold += 200;

            

            }

 

i just want the int totalgold to multiply by every rune arrow in the inventory

Edited by lazyy
Link to comment
Share on other sites

if(i.contains("Rune arrow")){

                int amount = i.getItemForName("Rune arrow").getAmount();

            totalgold += 200 * amount;

            

            }

 

thanks so much for your code

 

but it still recognizes a stack of rune arrows as 1 item -_-

 

will just have to live with it i guess

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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