Jump to content

[Help Request] Get dynamic Area + Hover next Object?


Recommended Posts

Posted

I have an area I want to use in my script however it is instanced in-game. My best idea has been to capture the area using getArea(int radius) however I'd like to capture a rectangle if possible.

 

Within the aforementioned area, I want to get all of the non-null objects matching an ID. Then I would like to interact with the first object , and hover over the second object.

 

 

Any help appreciated tongue.png

Posted (edited)

Find yourself a static object that doesnt change its position in any instance created and map out the areas from its position.

For getting all objects you could use

RS2Object[] objc = getObjects().getAll().stream().filter(o -> o != null && o.getId() == id && areaVar.contains(o));
Edited by Vilius
Posted

Find yourself a static object that doesnt change its position in any instance created and map out the areas from its position.

For getting all objects you could use

RS2Object[] objc = getObjects().getAll().stream().filter(o -> o != null && o.getId() == id && areaVar.contains(o));

 

Hmm any way I can sort those objects by distance to player? This topic talks about comparators but I'm not sure how to implement it.

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