Joseph Posted April 28, 2014 Posted April 28, 2014 You could also use that. Which return a rs2Object at the specific location. client.getCurrentRigion.getObjectAtLocal(id, x, y, z);
Botre Posted April 28, 2014 Author Posted April 28, 2014 You could also use that. Which return a rs2Object at the specific location. client.getCurrentRigion.getObjectAtLocal(id, x, y, z); Not a huge fan of using IDs for doors and gates, used it in the past and they seem to change once in a while..
Precise Posted May 29, 2014 Posted May 29, 2014 should check if the door is already openit does? It checks whether it is at the same location as the closed door. 1
thepecher Posted May 29, 2014 Posted May 29, 2014 i just use this public boolean gateIsOpen() { RS2Object gate = closestObjectForName("Gate"); if(Arrays.asList(gate.getDefinition().getActions()).contains("Open")){ return false; } else {return true;} }
Botre Posted May 29, 2014 Author Posted May 29, 2014 i just use this public boolean gateIsOpen() { RS2Object gate = closestObjectForName("Gate"); if(Arrays.asList(gate.getDefinition().getActions()).contains("Open")){ return false; } else {return true;} } You might start opening doors you don't need/want to open.
thepecher Posted May 29, 2014 Posted May 29, 2014 You might start opening doors you don't need/want to open. I usually walk up to the tile next to the door and then closestObjectforName does the trick
Botre Posted May 29, 2014 Author Posted May 29, 2014 I usually walk up to the tile next to the door and then closestObjectforName does the trick What if a tile is next to 2 doors and the client returns the other one instead of the one you want when you request the closest? Rare situation, but I had to change mine because of one >< 1
Dog_ Posted June 6, 2014 Posted June 6, 2014 How about osbot creates a decent pathgenerator that handles doors. SMH. Huge lack of skills in this dev team. inb4 ban because devs are butthurt. If they are professional they give me a reply why they haven't done anything useful to this bot since it's release. No decent web, no door handling, no decent equipment loading, grounditems have the wrong height, and the list goes on. Pretty sure they correctly calculate the height of the items in osbot 2.
Precise Posted June 6, 2014 Posted June 6, 2014 How about osbot creates a decent pathgenerator that handles doors. SMH. Huge lack of skills in this dev team. inb4 ban because devs are butthurt. If they are professional they give me a reply why they haven't done anything useful to this bot since it's release. No decent web, no door handling, no decent equipment loading, grounditems have the wrong height, and the list goes on. i can agree with some but http://osbot.org/osbot2_api/org/osbot/rs07/api/DoorHandler.html
Khaleesi Posted June 18, 2014 Posted June 18, 2014 (edited) I use the folowing code. If returns null: Means the door is open, else just interact with it. public static RS2object getobjectAt(String name, Postion pos, Script script){ return script.objects.closest(New Filter<RS2Object>(){ boolean match(RS2object d){ If(d != null && d.getPosition() == pos && d.getName().equals("Door") && d.getDefinition() != null && Arrays.asList(d.getDefinition().getActions()).contains("Open")) return true; } }); } Don't mind if I made some mistakes, just typed that in notepad at my work xD Khaleesi x3 Edited June 18, 2014 by Khaleesi
Botre Posted June 18, 2014 Author Posted June 18, 2014 use this method: public static RS2object getobjectAt(String name, Postion pos, Script script){ return script.objects.closest(New Filter<RS2Object>(){ boolean match(RS2object d){ If(d != null && d.getPosition() == pos && d.getName().equals("Door")) return door; } }); } Don't mind if I made some mistakes, just typed that in notepad at my work xD Khaleesi x3 Yh this is rather old :p
Khaleesi Posted June 18, 2014 Posted June 18, 2014 Yh this is rather old I just realized that... sorry about that -_-