bobbybill123 Posted December 4 Share Posted December 4 I'm having trouble obtaining RS2Objects around my character which contain the Examine action. I use the following line to try to do so, yet its size is always 0. I am trying to examine things like trees and whatnot. List<RS2Object> objectsNearby = mp.getObjects().filter(o -> o.hasAction("Examine")); Quote Link to comment Share on other sites More sharing options...
Czar Posted December 5 Share Posted December 5 It will be something like: RS2Object nearestExaminableObject = getObjects().closest(a -> a.hasAction("Examine") && a.getPosition().distance(myPosition()) <= 7); if (nearestExaminableObject != null) { nearestExaminableObject.interact("Examine"); } else { log("Waiting until an examinable object is nearby"); } Quote Link to comment Share on other sites More sharing options...
bobbybill123 Posted December 5 Author Share Posted December 5 (edited) 1 hour ago, Czar said: It will be something like: RS2Object nearestExaminableObject = getObjects().closest(a -> a.hasAction("Examine") && a.getPosition().distance(myPosition()) <= 7); if (nearestExaminableObject != null) { nearestExaminableObject.interact("Examine"); } else { log("Waiting until an examinable object is nearby"); } Thanks! I see you've called .closest() which only returns a single RS2Object. I was hoping to obtain a List of them all. Do you know if such a thing is possible? Edited December 5 by bobbybill123 Quote Link to comment Share on other sites More sharing options...
bobbybill123 Posted December 5 Author Share Posted December 5 Oddly enough, even the simple call getObjects().closest(a -> a.hasAction("Examine")); returns null despite being surrounded by trees with examine text. Quote Link to comment Share on other sites More sharing options...
DCHILLING Posted December 6 Share Posted December 6 On 12/5/2024 at 4:38 AM, bobbybill123 said: Oddly enough, even the simple call getObjects().closest(a -> a.hasAction("Examine")); returns null despite being surrounded by trees with examine text. To get a list you need to collect the objects like so List<RS2Object> objectsNearby = mp.getObjects().stream().filter(o -> o.hasAction("Examine")).collect(Collectors.toList()); Quote Link to comment Share on other sites More sharing options...
bobbybill123 Posted December 6 Author Share Posted December 6 13 hours ago, DCHILLING said: To get a list you need to collect the objects like so List<RS2Object> objectsNearby = mp.getObjects().stream().filter(o -> o.hasAction("Examine")).collect(Collectors.toList()); I have tried List<RS2Object> nearbyObjects = mp.getObjects().getAll().stream().filter(o -> o.hasAction("Examine")).collect(Collectors.toList()); but this too returns an empty list. Quote Link to comment Share on other sites More sharing options...
bobbybill123 Posted December 6 Author Share Posted December 6 Solved this. It looks like "Examine" is not an action found in RS2Objects. Quote Link to comment Share on other sites More sharing options...