All credit for the entire script goes to MPmoi, in fact you should just download his script.
The script was trying to click for me but it would switch back too fast for me so it wasn't actually clicking replay
I replaced the section labeled "Click" with this code: (Adding in a sleep delay)
Code:
Click:
MouseGetPos, theX, theY
WinGet, temp, PID, A
for i, pID in Pids{
WinActivate, ahk_pid %pID%
WinMove,ahk_pid %pID%,,0,0,576,432
WinWaitActive, ahk_pid %pID%
Sleep 100
MouseMove, X, Y
Sleep 50
ControlClick, x%X% y%Y%, ahk_pid %PID%
MouseMove, X+1, Y+1
Sleep 50
ControlClick, x%X% y%Y%, ahk_pid %PID%
}
WinActivate, ahk_pid %temp%
MouseMove, theX, theY
return
YMMV, 200 might work for you if not play around with it a little.
EDIT:
I changed it a little bit because i found that now instead of switching too fast the button wouldn't activate to be clicked. I used the X variable and Y variable +1 to cause it to move to the original point, click then move up and over 1 pixel causing the game to detect mouse movement before clicking again. This has been working for me for like 15 minutes with really high accuracy.