Jump to content

Getting the Position in a Position


Recommended Posts

Posted

Hello all, hope your day is going great. 

I am wondering if it is possible to get the coordinates inside of a position.

For example, you have 

Position pos  = new Position (x,y,z);

Now I do

pos.hover(bot); 

This will hover randomly within the position. I was wondering if there is a way to hover a specific point or range within the position. 

Thanks for your help :)

Posted (edited)

adding on to what k9thebeast suggested


aSCvzNS.png  black is Rectangle, white is Polygon (more accurate)

if you choose to use the Rectangle, clicking inside it will not always take you to the original position (could be adjacent positions).

 

https://docs.oracle.com/javase/8/docs/api/java/awt/Polygon.html#npoints

https://docs.oracle.com/javase/8/docs/api/java/awt/Polygon.html#xpoints

https://docs.oracle.com/javase/8/docs/api/java/awt/Polygon.html#ypoints

if you want to mess around with the points

 

Edited by Stimpack
  • Like 1
Posted
6 hours ago, k9thebeast said:

Something around this I would say. You can either use the Poly or the Rectangle, I would suggest the Poly but your call.

 


Position pos  = new Position (1,2,3);

if(pos.isVisible(bot)){
	Polygon p = pos.getPolygon(bot);
	Rectangle bounds = p.getBoundingBox();
}

 

 

5 hours ago, Stimpack said:

adding on to what k9thebeast suggested


aSCvzNS.png  black is Rectangle, white is Polygon (more accurate)

if you choose to use the Rectangle, clicking inside it will not always take you to the original position (could be adjacent positions).

 

https://docs.oracle.com/javase/8/docs/api/java/awt/Polygon.html#npoints

https://docs.oracle.com/javase/8/docs/api/java/awt/Polygon.html#xpoints

https://docs.oracle.com/javase/8/docs/api/java/awt/Polygon.html#ypoints

if you want to mess around with the points

 

Thank you both!

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