Munky Posted December 27, 2006 Posted December 27, 2006 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?
Munky Posted December 27, 2006 Author Posted December 27, 2006 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
Outshynd Posted December 27, 2006 Posted December 27, 2006 Looks good to me. Test to see if $file = -1 after the FileOpen call, maybe? Don't really know why it would be but I can't think of anything else.
Valuater Posted December 27, 2006 Posted December 27, 2006 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)
Valuater Posted December 27, 2006 Posted December 27, 2006 Looks good to me. Test to see if $file = -1 after the FileOpen call, maybe? Don't really know why it would be but I can't think of anything else.missing a While/Wend loop8)
Munky Posted December 27, 2006 Author Posted December 27, 2006 There we go must have been the while loop.... Thanx
Outshynd Posted December 27, 2006 Posted December 27, 2006 Ha. Word to the wise: answering support questions while too sick to leave bed because you can't find anything else to do isn't always the best idea.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now