Jump to content
Sign in to follow this  

Getting Coords From A Game Window

Recommended Posts


I mean from inside a game which cannot be windowed and thus I cannot use autoit window spy.. Any suggestions as to how i could get coords on a button inside a game.

Share this post

Link to post
Share on other sites

maybe I wasnt clear. I was wanting to know how to figure out the coords of a point on the screen so I could add it to a script.

Share this post

Link to post
Share on other sites

Which OS?

Set a HotKey to call a function. In the function, you record the mouse position from MouseGetPos. Write the values in a file.

Hmm, maybe something like this would work.

$fn = FileOpen("C:\MyLog.txt", 1)  ; This is the log file that the positions will be written.
HotKeySet("#0", "record"); Windows-0  set your own key
HotKeySet("#9", "done")  ; Windows-9   set your own key
Sleep(86400000); Run for up to a day

Func Record()
    Local $desc, $pos
    Global $fn

    $pos = MouseGetPos()
   ; InputBox may cause your program to return to windowed mode. 
   ; Click on the application in the task bar to return to full-screen.  
   ; If that does not work, press Ctrl-Enter to get back to full-screen mode.
    $desc = InputBox("What do you want to call this point?", "Save point")
    if @Error = 0 Then
        FileWriteLine($fn, $pos[0] & ", " & $pos[1] & " - " & StringStripWS($desc,7))

Func Done()
Edited by Nutster

David Nuttall
Nuttall Computer Consulting

An Aquarius born during the Age of Aquarius

AutoIt allows me to re-invent the wheel so much faster.

I'm off to write a wizard, a wonderful wizard of odd...

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.