Jump to content

Whitelisting more than 1 item?


Recommended Posts

Posted
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"));

  • Like 2
Posted
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

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...