lazyy Posted April 20, 2014 Posted April 20, 2014 example: Even if i have 2147m rune arrows in inventory it will tell me that i only have 1 rune arrow
Merccy Posted April 20, 2014 Posted April 20, 2014 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();
lazyy Posted April 20, 2014 Author Posted April 20, 2014 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)");
Merccy Posted April 20, 2014 Posted April 20, 2014 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.
lazyy Posted April 20, 2014 Author Posted April 20, 2014 (edited) 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 April 20, 2014 by lazyy
Merccy Posted April 20, 2014 Posted April 20, 2014 if(i.contains("Rune arrow")){ int amount = i.getItemForName("Rune arrow").getAmount(); totalgold += 200 * amount; }
lazyy Posted April 20, 2014 Author Posted April 20, 2014 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
Eliot Posted April 22, 2014 Posted April 22, 2014 I'm moved this to a section where you'll find more help.