Jump to content

Whitelisting more than 1 item?


atoo

Recommended Posts

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
Link to comment
Share on other sites

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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