Jump to content

Area class (with plane)


Recommended Posts

Posted

the osbot 2 area class does not support planes, so i made my own

package data;

import org.osbot.rs07.api.map.Position;
import org.osbot.rs07.api.model.Entity;
import org.osbot.rs07.utility.Area;

public class RS2Area {

	public final Area area;
	public final int plane;
	
	public RS2Area(Area area, int plane) {
		this.area = area;
		this.plane = plane;
	}
	
	public boolean contains(Position pos) {
		return area.contains(pos) && pos.getZ() == plane;
	}
	
	public boolean contains(Entity entity) {
		return area.contains(entity) && entity.getPosition().getZ() == plane;
	}
	
}
Posted

 

the osbot 2 area class does not support planes, so i made my own

package data;

import org.osbot.rs07.api.map.Position;
import org.osbot.rs07.api.model.Entity;
import org.osbot.rs07.utility.Area;

public class RS2Area {

	public final Area area;
	public final int plane;
	
	public RS2Area(Area area, int plane) {
		this.area = area;
		this.plane = plane;
	}
	
	public boolean contains(Position pos) {
		return area.contains(pos) && pos.getZ() == plane;
	}
	
	public boolean contains(Entity entity) {
		return area.contains(entity) && entity.getPosition().getZ() == plane;
	}
	
}

 

 

Yea why areas dont have planes in osb api is beyond me. :P

  • 3 weeks later...
Posted (edited)

i've worked with a few api's now and i found that i've had better success with my scripts when i separated the plane and the area, especially in my rooftop agility script. speaking of rooftop agility, look for the beta release in the near future! i just have to convert it from the api it is currently written for. long live mirror mode!

Edited by shiny greninja
Posted

i've worked with a few api's now and i found that i've had better success with my scripts when i separated the plane and the area, especially in my rooftop agility script. speaking of rooftop agility, look for the beta release in the near future! i just have to convert it from the api it is currently written for. long live mirror mode!

 

pls

 

78772cc4737f8f817de274fdc61552a9.png

 

all courses supported.  look for release soon

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