Hollowyearz

MousePosHKS

Nov 28th, 2013
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 0.41 KB | None | 0 0
  1. #include <File.au3>
  2. HotKeySet("{F2}", "_MousePos")
  3.  
  4. While 1
  5.     Sleep(1000)
  6. WEnd
  7.  
  8. Func _MousePos()
  9.  
  10.     Local $file = FileOpen("test.txt", 1) ;file to write to
  11.     If $file = -1 Then
  12.         MsgBox(0, "Error", "Unable to open file.")
  13.         Exit
  14.     EndIf
  15.     Local $pos = MouseGetPos()
  16.     MsgBox(0, "Mouse x,y:", $pos[0] & "," & $pos[1], 1)
  17.     FileWriteLine($file, $pos[0] & $pos[1])
  18.  
  19.     FileClose($file)
  20. EndFunc   ;==>_MousePos
Advertisement
Add Comment
Please, Sign In to add comment