rexas 12 Share Posted December 20, 2016 Having trouble getting unnoted items amount in my inventory, is there a method for this, because i can't find it. I tried a workaround, but it throws null pointer exception. private int getAmount() { int amount = 0; List<Item> items = script.getInventory().all(); if(items != null && items.size() != 0) { for (Item item : items) { if (item.getName().equals("Supercompost")) { amount++; } } } return amount; } Link to comment Share on other sites More sharing options...
Hashtag 8670 Share Posted December 20, 2016 getInventory().count("Rune kiteshield"); Link to comment Share on other sites More sharing options...
rexas 12 Author Share Posted December 20, 2016 getInventory().count("Rune kiteshield"); Thanks Link to comment Share on other sites More sharing options...
Xephy 237 Share Posted December 21, 2016 getInventory().count("Rune kiteshield"); Does that not pull the count for all Rune kiteshields in your inventory (Both noted and unnoted)? Link to comment Share on other sites More sharing options...
rokaHakor 171 Share Posted December 21, 2016 Does that not pull the count for all Rune kiteshields in your inventory (Both noted and unnoted)? It returns how many inventory spaces items, with the specified name or item ID, are taking. Link to comment Share on other sites More sharing options...
Hashtag 8670 Share Posted December 21, 2016 Does that not pull the count for all Rune kiteshields in your inventory (Both noted and unnoted)? Filter can be used to specify it. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.