I made a (working) auto clicker and I wanted to add a little modification to it. I want the code to grab the mouse's current position when you call the AutoClick function. Now when it calls the ClickClick function it gets the now current position of the mouse. After that, it snaps the mouse back to the original position (oX, oY) and clicks. After clicking, it jumps to the position the mouse was just at (x, y). The clicking part works, but the mouse doesn't move at all. I have no idea what to do to try to fix it.
^h::AutoClick()
^j::ExitApp
AutoClick(Interval=100){
MouseGetPos, xpos, ypos
oX = %xpos%
oY = %ypos%
static Toggler
Toggler := !Toggler
TPer := Toggler ? Interval : "off"
SetTimer, ClickClick, %TPer%
return
ClickClick:
BlockInput On
MouseGetPos, x, y
MouseMove, %oX%, %oY%, 0
Click
MouseMove, %x%, %y%, 0
BlockInput Off
return
}