Chromelte Posted January 10, 2017 Share Posted January 10, 2017 boolean examined = false; List<RS2Object> allEntities = new ArrayList<RS2Object>(); allEntities = objects.getAll(); do { RS2Object obj = allEntities.get(random(0, allEntities.size() - 1)); if (obj != null && obj.hasAction("Examine")) { obj.interact("Examine"); examined = true; log(obj.getName() + " examined."); } } while (!examined); I am trying to get a list of all the entities around me and examine one at random. I seem to be able to get a random object just fine, but it never actually gets past this part. if (obj != null && obj.hasAction("Examine")) { Any ideas why? Link to comment Share on other sites More sharing options...
Team Cape Posted January 10, 2017 Share Posted January 10, 2017 ran into this awhile ago. I realized that if an object has a name, then it has the examine option, so you might want to try if(object.getName() != null) {}, because for whatever reason, it doesnt appear in the list of interact options (i checked this many times). if you want to interact and examine it, there is also a method for that - object.examine(). Hope this helped 1 Link to comment Share on other sites More sharing options...