dokato Posted March 15, 2015 Share Posted March 15, 2015 for example, there are multiple objects with the same id in a certain location. But I only want to interact with the object that has a specific position x,y,z. What code could i use for this? Because it will automatically interact with all he objects... something i dont want Quote Link to comment Share on other sites More sharing options...
Precise Posted March 15, 2015 Share Posted March 15, 2015 for example, there are multiple objects with the same id in a certain location. But I only want to interact with the object that has a specific position x,y,z. What code could i use for this? Because it will automatically interact with all he objects... something i dont want here: getObjects().closest(new Filter<RS2Object>() { @Override public boolean match(RS2Object o) { if(o != null && o.getName().equals("NAME HERE") && o.getPosition().equals(new Position(X,Y,Z))) return true; return false; } }); 1 Quote Link to comment Share on other sites More sharing options...
Khaleesi Posted March 15, 2015 Share Posted March 15, 2015 here: getObjects().closest(new Filter<RS2Object>() { @Override public boolean match(RS2Object o) { if(o != null && o.getName().equals("NAME HERE") && o.getPosition().equals(new Position(X,Y,Z))) return true; return false; } }); This 1 Quote Link to comment Share on other sites More sharing options...
Joseph Posted March 15, 2015 Share Posted March 15, 2015 This here: getObjects().closest(new Filter<RS2Object>() { @Override public boolean match(RS2Object o) { if(o != null && o.getName().equals("NAME HERE") && o.getPosition().equals(new Position(X,Y,Z))) return true; return false; } }); Why don't you just use the position filter that is now in the api? Quote Link to comment Share on other sites More sharing options...
Precise Posted March 15, 2015 Share Posted March 15, 2015 Why don't you just use the position filter that is now in the api? if i knew about it, i would utilise it ;) Quote Link to comment Share on other sites More sharing options...
Khaleesi Posted March 15, 2015 Share Posted March 15, 2015 Why don't you just use the position filter that is now in the api? Since Osbot api breaks every time now and then, I prefer you to use custom make mehods ;) and there are way too many option too choose from in the API xD They should delete atleast 50% and fix the rest what is left. Thats why Khaleesi Quote Link to comment Share on other sites More sharing options...
Joseph Posted March 15, 2015 Share Posted March 15, 2015 Since Osbot api breaks every time now and then, I prefer you to use custom make mehods and there are way too many option too choose from in the API xD They should delete atleast 50% and fix the rest what is left. Thats why Khaleesi its a simple interface. Interfaces dont break. What break more are like methods. Yes way to many option but its better then before with have almost no option. 1 Quote Link to comment Share on other sites More sharing options...
Khaleesi Posted March 15, 2015 Share Posted March 15, 2015 its a simple interface. Interfaces dont break. What break more are like methods. Yes way to many option but its better then before with have almost no option. Basic options + Fitler would be more then enough. Instead they gave the scripters 50 options -_- i've a lot breaking and failing -_- rather make all myself Quote Link to comment Share on other sites More sharing options...
dokato Posted March 15, 2015 Author Share Posted March 15, 2015 could u guys pls give an example on how to use the PositionFilter? Quote Link to comment Share on other sites More sharing options...
Twin Posted March 15, 2015 Share Posted March 15, 2015 could u guys pls give an example on how to use the PositionFilter? Entity door = objects.closest(new Area(3207,3214,3208,3214),"Door"); This will interact with the door at those certain points and only that door. Quote Link to comment Share on other sites More sharing options...
Joseph Posted March 15, 2015 Share Posted March 15, 2015 http://osbot.org/api/org/osbot/rs07/api/filter/PositionFilter.html getObjects().closest(new PositionFilter<RS2Object>(new Position(0,0,0))); could u guys pls give an example on how to use the PositionFilter? if not use this one same shit here: getObjects().closest(new Filter<RS2Object>() { @Override public boolean match(RS2Object o) { if(o != null && o.getName().equals("NAME HERE") && o.getPosition().equals(new Position(X,Y,Z))) return true; return false; } }); Quote Link to comment Share on other sites More sharing options...
dokato Posted March 15, 2015 Author Share Posted March 15, 2015 thx alot Quote Link to comment Share on other sites More sharing options...