Sign in to follow this  
Followers 0
qazwsx

Position of Mouse

6 posts in this topic

Is it possible to record the position of the mouse when a hot key is pressed then have autoit move the mouse and then return the mouse to the original position? If so how?

Share this post


Link to post
Share on other sites



Is it possible to record the position of the mouse when a hot key is pressed then have autoit move the mouse and then return the mouse to the original position? If so how?

It's very much possible, and while I am as irked about this kind of question as the first person to reply, I'll at least give you the structure on how to do it and then let you go run off to the functions list to figure out what to use.

[define a hotkey to execute a function]

[here's the function]

$var = my current mouse position

move my mouse to a new position

move my mouse to $var

[end of my function]

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Hotkeyset("{f9}", "Record")
HotKeySet("{HOME}", "Play")
Global $count=0 ,$records[15][2];max number of records

While 1
$pos = MouseGetPos()
ToolTip("("&$pos[0]&", "&$pos[1]&")",0,0)
If $Count >= 14 then $count=0
Wend

Func Record()
$Pos = MouseGetPos()
$records[$count][0] = $pos[0]
$Records[$count][1] = $pos[1]
Tooltip("Recorded:  ("&$records[$count][0]&", "&$Records[$count][1]&")",0,0)
$count+=1
EndFunc

Func Play()
For $i = 0 to $count
MouseClick("Left", $records[$i][0], $Records[$i][1])
Sleep(100)
Next
EndFunc

Record a series of positions, then have autoit click them all.

Edited by Paulie

Share this post


Link to post
Share on other sites

Thank you very much for the help. Im sorry if this was a newbie question i just didn't see it in the help file.

Share this post


Link to post
Share on other sites

Thank you very much for the help. Im sorry if this was a newbie question i just didn't see it in the help file.

Mousemove

Mouseclick

Its like Prego, Its in there.

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