Jump to content
Sign in to follow this  
jackyyll

Help with finding coords

Recommended Posts

jackyyll

I wanna add finding coords to my program. So when someone presses F10 it will get the coords where they're mouse is and input them into my x,y input boxes that are called $x and $y. (I want it to automatically put it into the input boxes) I also only want it to find the coords relative to the game.

Thanks in advance,

~jack

Edited by jackyyll

Share this post


Link to post
Share on other sites
fastnick1oo

Try this:

Opt("MouseCoordMode", 2)
HotKeySet("{F9}", "FindCoord")

Func FindCoord()
$pos = MouseGetPos()
$x = $pos[0];I'm not sure about it.
$y = $pos[1];I'm not sure about it.
EndFunc


SciTE - much better than notepad. ; ]

Share this post


Link to post
Share on other sites
SmOke_N

Hmm, your nicer than I am today fastnick... I don't think I would of answered this one without at least seeing his effort first.

But it works good... try this, I just added a while and a msgbox so you can see it works good B)

Opt("MouseCoordMode", 2)
HotKeySet("{F9}", "FindCoord")

While 1
    Sleep(10)
WEnd

Func FindCoord()
$pos = MouseGetPos()
$x = $pos[0];I'm not sure about it.
$y = $pos[1];I'm not sure about it.
MsgBox(0, "", "X = " & $pos[0] & " Y = " & $pos[1])
EndFunc

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.