May 23, 201510 yr 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, 201510 yr by mlrkey
May 23, 201510 yr 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
May 23, 201510 yr Author 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.
May 23, 201510 yr 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
May 23, 201510 yr 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
Create an account or sign in to comment