Sign in to follow this  
Followers 0
Munky

Mouse Position Grabber

9 posts in this topic

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?

Share this post


Link to post
Share on other sites



First step: posting your script.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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 loop

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

There we go :P must have been the while loop....

Thanx

Share this post


Link to post
Share on other sites

Welcome

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

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. :P

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  
Followers 0