Spacious Posted June 29, 2014 Share Posted June 29, 2014 Well, I have the rest of my ess miner working fine, but I've run into a problem. Apparently there are two types of portals used to exit the mine. (I'm not talking about how it switches from "Use Portal" to "Exit Portal") The first type of portal is detected fine, but I can't seem to get the second one. The real ID and the object ID both do not work, nor does trying to use it via a string method. When using the Entity Hover Debug its string name comes up as "<col=00ffff>Portal</col>" (which I found odd because it doesn't do that for any other objects that I've seen), with the ID next to it, and the realID has generally been around 2660 (with the object IDs being somewhere a little above that) Not sure how to go about getting this object. any help would be appreciated. Link to comment Share on other sites More sharing options...
Botre Posted June 29, 2014 Share Posted June 29, 2014 Search for entities for actions Link to comment Share on other sites More sharing options...
Single Core Posted June 29, 2014 Share Posted June 29, 2014 Try npc. Link to comment Share on other sites More sharing options...
arm2 Posted June 29, 2014 Share Posted June 29, 2014 Iirc it's an NPC Link to comment Share on other sites More sharing options...
Spacious Posted June 29, 2014 Author Share Posted June 29, 2014 Search for entities for actions How would I go about that? lol (thank you btw) Link to comment Share on other sites More sharing options...
Botre Posted June 29, 2014 Share Posted June 29, 2014 How would I go about that? lol (thank you btw) You will have to write a custom method for it. Add all RS2 objects and NPCs to a list and then go through that list by checking for all entities that have either Exit or Use in their actions then return the closest of that subset. I would give you the method but I'm releasing an ess miner myself, no hard feelings :p Link to comment Share on other sites More sharing options...
Spacious Posted June 29, 2014 Author Share Posted June 29, 2014 Thank you everyone, I got it figured out! You will have to write a custom method for it. Add all RS2 objects and NPCs to a list and then go through that list by checking for all entities that have either Exit or Use in their actions then return the closest of that subset. I would give you the method but I'm releasing an ess miner myself, no hard feelings Haha I appreciate the help, thank you, I'm not planning on releasing mine though. It's much more just for a learning experience, I haven't scripted in a few years since rsbot so I'm just trying to refresh myself. Link to comment Share on other sites More sharing options...
Extreme Scripts Posted June 29, 2014 Share Posted June 29, 2014 How would I go about that? lol (thank you btw) public RS2Object filterPortal(String action){ for(RS2Object o: objects.getAll()){ if(o != null && o.getDefinition().getActions()[0].equals(action)){ return o; } } return null; } The getActions()[0] will return the action in the first index of the list aka the First interaction option. Link to comment Share on other sites More sharing options...
Khaleesi Posted June 29, 2014 Share Posted June 29, 2014 A portal can be a NPC or a RS2object. Also the name can be null. Link to comment Share on other sites More sharing options...