Jump to content

Getting the Position in a Position


Juggles

Recommended Posts

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 :)

Link to comment
Share on other sites

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();
}

 

Edited by k9thebeast
  • Like 1
Link to comment
Share on other sites

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

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!

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