Auto click in 5 minute intervals

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Very Funny
Posts: 1
Joined: 24 Mar 2018, 21:04

Auto click in 5 minute intervals

24 Mar 2018, 21:11

I'm trying to create a script that will, when toggled, click the specified areas of the screen at 5 minute intervals. I have got the 'mouseclick' functions working fine, but I am struggling to utilise the loop function (if I need it it all) and am not sure if the SetTimer function is being used properly. Also, I have no idea how to create a toggle to exit the script. Thanks in advance

Here is what I have so far:

Code: Select all

x := 600
y := 850
a := 850
b := 850

^j:: {
Loop {
 {
   SetTimer, Clicker, 300000
   Clicker:
      mouseclick, left, %x%, %y%, 1, 0
      mouseclick, left, %a%, %b%, 1000, 0
   return
 }
return
}
return
Rohwedder
Posts: 7614
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Auto click in 5 minute intervals

25 Mar 2018, 02:06

Hallo,
try:

Code: Select all

x := 600
y := 850
a := 850
b := 850
^j:: ;toggles Clicker on/off
If Clicker := !Clicker
	SetTimer, Clicker, 300000
Else
	SetTimer, Clicker, Off
return
Clicker:
mouseclick, left, %x%, %y%, 1, 0
mouseclick, left, %a%, %b%, 1000, 0
return
^End::ExitApp ;exit the script
Sas

Re: Auto click in 5 minute intervals

25 Mar 2018, 03:59

Rohwedder wrote:Hallo,
try:

Code: Select all

x := 600
y := 850
a := 850
b := 850
^j:: ;toggles Clicker on/off
If Clicker := !Clicker
	SetTimer, Clicker, 300000
Else
	SetTimer, Clicker, Off
return
Clicker:
mouseclick, left, %x%, %y%, 1, 0
mouseclick, left, %a%, %b%, 1000, 0
return
^End::ExitApp ;exit the script
Fixed it for you. You didn't give clicker a value!

Code: Select all

x := 600
y := 850
a := 850
b := 850
Click := 0
^j:: ;toggles Clicker on/off
If Click := !Click
	SetTimer, Clicker, 300000
Else
	SetTimer, Clicker, Off
return
Clicker:
mouseclick, left, %x%, %y%, 1, 0
mouseclick, left, %a%, %b%, 1000, 0
return
^End::ExitApp ;exit the script

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Giresharu, Google [Bot], haomingchen1998 and 265 guests