I would like Shift+F2 to record my mouse cursor position whenever it is pressed and store it as stored_pos3.
Also, when Alt+s is pressed, I want it to run the following sequence: Shift+F3, F2, move mouse to stored_pos3, left click, f, move mouse cursor 2cm west of stored_pos3, left click, f, move mouse cursor 2cm north of stored_pos3, left click, f, move mouse cursor 2.5cm northwest of stored_pos3, left click, f, F3.
The alt+s sequence should be uninterruptible, very rapid, and not miss any inputs or movements. I understand that AHK does not work with centimeters, but I didn't know anyway else to explain it. If someone could create a script where I can adjust the numbers as necessary, that would be much appreciated! Thank you!
Code: Select all
stored_pos1 := ""
stored_pos2 := ""
toggle := 0
+F4::
MouseGetPos, xpos, ypos
stored_pos2 := xpos "," ypos
return
!a::
BlockInput, MouseMove
SetTimer, EnableClickMove, 1000
toggle := !toggle
if (toggle = 1) {
Send, +{F3}
Send, {F4}
StringSplit, xy, stored_pos2, `,
MouseMove, %xy1%, %xy2%, 0
Send, {LButton}
Send, {F3}
} else {
Send, +{F3}
Send, {F4}
StringSplit, xy, stored_pos2, `,
MouseMove, %xy1%, %xy2%, 0
Send, {LButton}
Send, {F3}
}
BlockInput, MouseMoveOff
MouseMove, % A_ScreenWidth/2, % A_ScreenHeight/2, 0
return
EnableClickMove:
BlockInput, MouseMoveOff
return