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

Post your working scripts, libraries and tools
Trex187
Posts: 3
Joined: 18 Mar 2018, 17:26

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

Post by Trex187 » 09 Jun 2018, 20:35

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
Qysh
Posts: 143
Joined: 24 Apr 2018, 09:16

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

Post by Qysh » 15 Jun 2018, 10:29

:think:

Code: Select all

Loop
{
	Send, {F5}
	Sleep, 12000
}
StefOnSteroids
Posts: 40
Joined: 08 Aug 2015, 10:22

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

Post by StefOnSteroids » 20 Jun 2018, 21:22

@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.
Post Reply

Return to “Scripts and Functions”