Page 1 of 1

Auto clicker that moves cursor to a location then returns to previous location

Posted: 09 Jun 2018, 20:35
by Trex187
I just finished a script (with a little help from the community) that auto clicks the left mouse button at 2 minute intervals. It goes to a preset coordinate, clicks on the location and returns the mouse cursor to the original position. You can toggle it on/off with control-M. Thought I'd share since I didn't find anything like it on the forums. I made it for websites that time-out after a certain period. If there are any embellishments that anyone would like to add please share.

Code: Select all

CoordMode,Mouse,Screen
SetMouseDelay, 10

Click := 0
^m:: ;toggles Clicker on/off
MouseGetPos, xpos, ypos
If Click := !Click
    SetTimer, Clicker, 120000
Else
    SetTimer, Clicker, Off
return

Clicker:
mousemove, 74, 46
Click Left
MouseMove, %xpos%, %ypos%
Sleep, 100
return
^End::ExitApp ;exit the script

Re: Auto clicker that moves cursor to a location then returns to previous location

Posted: 15 Jun 2018, 10:29
by Qysh
:think:

Code: Select all

Loop
{
	Send, {F5}
	Sleep, 12000
}

Re: Auto clicker that moves cursor to a location then returns to previous location

Posted: 20 Jun 2018, 21:22
by StefOnSteroids
@Trex187
Thanks for sharing. I needed something very similar to shift focus to the tree sidebar of a programm, trigger shortcuts there, then put the prompt back to where I was before. Your snippet helped me to pull it off.

It didn't help me to avoid time-outs on my online-banking site, though. Seems like it expects clicks that actually trigger something on their server, some kind of action or actual change of data, submittimg a form, or advancing to the next page, something like that.

@Qysh
If sending F5 is supposed to reload the website, this didn't work for me, either. It tells me the page is no longer vaild, and I have to start over filling out the form or whatever else I was doing.

Guess I must incrase the time-out setting on each of those websites. No easy way out it seems. Have to log on to each separately and find that setting.