Hi, so in one of my previous scripts people mentioned I should try and use filters more:
The commented out code is what i was trying to do but was refusing to 'loot' the arrows.
The non-commented code works fine and i wondered if anyone new why the commented code didn't work?
// Filter<Item> arrows = item -> item.getName().contains("arrows");
//GroundItem arrows1 = getGroundItems().closest(arrows.toString());
GroundItem arrows1 = getGroundItems().closest("Bronze arrow","Iron arrow","Steel arrow","Mithril arrow","Adamant arrow");
Below is current version of my *arrows1*
GroundItem arrows1 = getGroundItems().closest(gi -> gi != null && getMap().canReach(gi) && gi.getName().contains("arrow"));
This one does work but is not using a filter (although it is kinda filtering by the contains name) but i wondered what would cause the toString() to not work as i wanted.
is arrows toString basically just writing down arrows. I though it should be writing down the whole Bronze arrow for example