Here is the script
Code: Select all
#SingleInstance Force
F1:: ;Hotkey that starts the magic.
{ WinGet Win, MinMax, Tester ;Gets the status of the targeted window or game.
IfEqual Win, 0, WinMinimize, Tester ;Minimize Testerwindow
SetTimer, Clicker, 100 ;Turns on the timerloop. 100*10 = 1 second.
SetTimer, 1sec, 1000 ;Turns on the timerloop. 1000 = 1 second.
} Return
Clicker:
{ IfWinExist, Tester
{ WinGet Win, MinMax, Tester
If (Win = -1) Or (Win = 1) Or (Win = 0) ;Makes sure if the window is Minimize/WinMaximize or somewhere in-between.
{
ControlClick, x121 y79, Tester ;The clicker command taht send the clicks to the targeted window.
CountingClicks += 1 ;records each click
If (CountingClicks = 10) ;When 10 clicks are sent it will trigger the code below.
{
SetTimer, Clicker, OFF ;turns off the timerloop
If (Win = -1) ;If WinMinimize
{ IfEqual Win, -1, Winrestore, Tester ;Restores Tester Window from being Minimized.
} CountingClicks := 0 ;resets the counder to 0
MsgBox, 10 Clicks in 1 second ;Tells you when finished.
}
}
}
Else,
{
SetTimer, Clicker, OFF
MsgBox, Tester Window Not Found!
}
} Return
1sec:
{ SoundBeep, 400, 50 ;Beeps after 1 second
SetTimer, 1sec, Off
} Return
~Esc::ExitApp ;Kills the script