atoo Posted October 23, 2017 Share Posted October 23, 2017 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")); Quote Link to comment Share on other sites More sharing options...
Deceiver Posted October 23, 2017 Share Posted October 23, 2017 getInventory().dropAllExcept(item -> item.getName().contains("fishing", "bait", "air rune")); Quote Link to comment Share on other sites More sharing options...
atoo Posted October 23, 2017 Author Share Posted October 23, 2017 1 minute ago, Deceiver said: getInventory().dropAllExcept(item -> item.getName().contains("fishing", "bait", "air rune")); lol, already tried that. contains() only take 1 argument. Quote Link to comment Share on other sites More sharing options...
Explv Posted October 23, 2017 Share Posted October 23, 2017 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")); 2 Quote Link to comment Share on other sites More sharing options...
atoo Posted October 23, 2017 Author Share Posted October 23, 2017 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 Quote Link to comment Share on other sites More sharing options...