Jump to content

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


m6P9aRdAb4Z0

Recommended Posts

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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