Code: Select all
#NoEnv
#SingleInstance Force
#MaxThreadsPerHotkey 2
CoordMode, Mouse, Screen ; CoordMode, ToolTip|Pixel|Mouse|Caret|Menu [, Screen|Window|Client]
toggle := 0
F8::
Toggle := !Toggle , starttime := A_TickCount
Random, RandomA, 1200000, 1800000
While Toggle{
Random, RandomT, 300, 600
Random, RandomX, 800, 1100
Random, RandomY, 400, 700
Click, %RandomX%, %RandomY%
sleep, %RandomT% ; msec*sec*min=msec
if ((A_TickCount-starttime) >= RandomA) ; 10min = 1000*60*10 = 600000 | 20min = 1000*60*20 = 1200000
{
Random, RandomA, 1200000, 1800000
Random, RandomB, 10000, 20000
Sleep RandomB ; delay between 10-20sec
starttime := A_TickCount ; reset start time
}
}
return
With expression syntax RandomA does not need to be wrapped in %'s Also Sleep command allows expressions so its not needed there either but its allowed to be either way.
Give this a try you should be good to go.