Jump to content

Area class (with plane)


Novak

Recommended Posts

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

 

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

Link to comment
Share on other sites

  • 3 weeks later...

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

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

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