October 23, 20178 yr So currently i "whitelist" shit like this. but now i need to whitelist more than 1 thing, could someone give me a tip on how to procced? getInventory().dropAllExcept(item -> item.getName().contains("fishing"));
October 23, 20178 yr getInventory().dropAllExcept(item -> item.getName().contains("fishing", "bait", "air rune"));
October 23, 20178 yr Author 1 minute ago, Deceiver said: getInventory().dropAllExcept(item -> item.getName().contains("fishing", "bait", "air rune")); lol, already tried that. contains() only take 1 argument.
October 23, 20178 yr 7 minutes ago, atoo said: So currently i "whitelist" shit like this. but now i need to whitelist more than 1 thing, could someone give me a tip on how to procced? getInventory().dropAllExcept(item -> item.getName().contains("fishing")); ???? Look at the API bro https://osbot.org/api/org/osbot/rs07/api/Inventory.html#dropAllExcept-org.osbot.rs07.api.filter.Filter...- It can take more than one filter as a parameter, or you can just add an OR condition to your existing filter. getInventory().dropAllExcept(item -> item.getName().contains("fishing") || item.getName().equals("Blah")); getInventory().dropAllExcept(item -> item.getName().contains("fishing"), new NameFilter<>("Blah"));
October 23, 20178 yr Author 1 minute ago, Explv said: ???? Look at the API bro https://osbot.org/api/org/osbot/rs07/api/Inventory.html#dropAllExcept-org.osbot.rs07.api.filter.Filter...- It can take more than one filter as a parameter, or you can just add an OR condition to your existing filter. getInventory().dropAllExcept(item -> item.getName().contains("fishing") || item.getName().equals("Blah")); getInventory().dropAllExcept(item -> item.getName().contains("fishing"), new NameFilter<>("Blah")); Fuck i missed that >_> Thanks fam. /close
Create an account or sign in to comment