Jump to content

interaction with object using position


Recommended Posts

Posted

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 sad.png

 

 

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;
	}
});
  • Like 1
Posted

This <3

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?
Posted

Since Osbot api breaks every time now and then, I prefer you to use custom make mehods wink.png

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.

  • Like 1
Posted

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;
	}
});

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...