bobbybill123 Posted December 4, 2024 Share Posted December 4, 2024 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, 2024 Share Posted December 5, 2024 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, 2024 Author Share Posted December 5, 2024 (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, 2024 by bobbybill123 Quote Link to comment Share on other sites More sharing options...
bobbybill123 Posted December 5, 2024 Author Share Posted December 5, 2024 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, 2024 Share Posted December 6, 2024 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, 2024 Author Share Posted December 6, 2024 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, 2024 Author Share Posted December 6, 2024 Solved this. It looks like "Examine" is not an action found in RS2Objects. Quote Link to comment Share on other sites More sharing options...