Jump to content

How to find object/graphic on a tile.


Recommended Posts

Posted

Alright, so i'm trying to make a simple combat script for easy bosses but i'm trying to find out how to find tiles that have 'stuff' on them. For example the Vorkath poison, Vet'ion lightning, Vitur spiderwebs etc. Is there a method to call that lists all the object ID's on a specific tile? So i can avoid these. 
Been looking through the API for a good while now, just can't find it. Any help is appreciated :).

Posted
16 hours ago, neonoxus9 said:

Alright, so i'm trying to make a simple combat script for easy bosses but i'm trying to find out how to find tiles that have 'stuff' on them. For example the Vorkath poison, Vet'ion lightning, Vitur spiderwebs etc. Is there a method to call that lists all the object ID's on a specific tile? So i can avoid these. 
Been looking through the API for a good while now, just can't find it. Any help is appreciated :).

Didn't look hard, and filters

List<RS2Object> objects = getObjects().get(x, y);

 

Position[] targetPositions = {new Position(0, 0, 0)};
List<RS2Object> objects = getObjects().getAll().stream()
                .filter(p -> Arrays.asList(targetPositions).contains(p.getPosition()))
                .collect(Collectors.toList());

 

EDIT: In case you also don't know how to loop through them to print out the ids...

objects.forEach(object -> log(object.getId()));

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