Jump to content

Mouse Position Grabber


Munky
 Share

Recommended Posts

Tried creating a script that uses a hotkey to grab the current mouse position then write it to a file, but all attempts failed, for some reason FileWrite and FileWriteLine werent working properly? even tried writing "BLAH" instead of the mouse positions, but that failed too...

just wondering if anyone has any ideas?

Link to comment
Share on other sites

CODE

HotKeySet("{Enter}", "Write")

HotKeySet("{Escape}", "Kill")

;sets fileopen

$file = FileOpen("test.txt", 1)

;writes

Func Write()

$pos = MouseGetPos()

FileWrite($file, $pos[0] & " , " & $pos[1] & @CRLF)

EndFunc

;kills

Func Kill()

Exit

EndFunc

Link to comment
Share on other sites

maybe...

HotKeySet("{F9}", "Write")
HotKeySet("{ESC}", "Kill")

;sets fileopen
$file = FileOpen( @ScriptDir & "\test.txt", 1)

While 1
    Sleep(20)
WEnd

;writes
Func Write()
    $pos = MouseGetPos()
    FileWrite($file, $pos[0] & " , " & $pos[1] & @CRLF)
EndFunc   ;==>Write

;kills
Func Kill()
    FileClose($file)
    Exit
EndFunc   ;==>Kill

8)

NEWHeader1.png

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...