mlrkey Posted May 23, 2015 Share Posted May 23, 2015 (edited) Can't seem to figure this out, I have 15 of a certain item in my inv and I want to only drop 5 of that item. Edited May 23, 2015 by mlrkey Quote Link to comment Share on other sites More sharing options...
Joseph Posted May 23, 2015 Share Posted May 23, 2015 public boolean dropOnlyThis(String[] blackList) throws IllegalArgumentException, InterruptedException { if (getInventory().contains(blackList)) { List<Item> list = getInventory().filter(new ContainsNameFilter<Item>(blackList)); for (Item item: list) { if (item != null) { item.interact("drop"); sleep(gRandom(400,100)); } } } return !getInventory().contains(blackList); } tell me if this helps Quote Link to comment Share on other sites More sharing options...
mlrkey Posted May 23, 2015 Author Share Posted May 23, 2015 public boolean dropOnlyThis(String[] blackList) throws IllegalArgumentException, InterruptedException { if (getInventory().contains(blackList)) { List<Item> list = getInventory().filter(new ContainsNameFilter<Item>(blackList)); for (Item item: list) { if (item != null) { item.interact("drop"); sleep(gRandom(400,100)); } } } return !getInventory().contains(blackList); } tell me if this helps I should have been more specific. I have 15 of a certain item in my inv and I want to only drop 5 of that item. Quote Link to comment Share on other sites More sharing options...
Flamezzz Posted May 23, 2015 Share Posted May 23, 2015 Smth like this? inventory.dropForFilter(item -> item.getName().equals("Item Name") && inventory.getAmount("Item Name") > 10); 10 can obv be replaced with getAmount-5 before you use this statement if you want Quote Link to comment Share on other sites More sharing options...
FrostBug Posted May 23, 2015 Share Posted May 23, 2015 Just do something like if(getInventory().getAmount("Item") > 10) { getInventory().drop("Item"); } If you're using a non-sequential framework, it should get repeated in every loop cycle until you've dropped 5 Quote Link to comment Share on other sites More sharing options...