Munky Posted December 27, 2006 Share 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? Link to comment Share on other sites More sharing options...
Outshynd Posted December 27, 2006 Share Posted December 27, 2006 First step: posting your script. Link to comment Share on other sites More sharing options...
Munky Posted December 27, 2006 Author Share 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 Link to comment Share on other sites More sharing options...
Outshynd Posted December 27, 2006 Share 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. Link to comment Share on other sites More sharing options...
Valuater Posted December 27, 2006 Share 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) Link to comment Share on other sites More sharing options...
Valuater Posted December 27, 2006 Share 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) Link to comment Share on other sites More sharing options...
Munky Posted December 27, 2006 Author Share Posted December 27, 2006 There we go must have been the while loop.... Thanx Link to comment Share on other sites More sharing options...
Valuater Posted December 27, 2006 Share Posted December 27, 2006 Welcome 8) Link to comment Share on other sites More sharing options...
Outshynd Posted December 27, 2006 Share 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. Link to comment Share on other sites More sharing options...
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