Sorry for the necro, but after trying about 20 different similar scripts this was the ONLY one that compiled correctly. My problem is that the sleep timer seems to have no effect. As I understood this was supposed to pause for 100 milliseconds in between each loop, but even if I set them as high as 30000 I still get way too many loops per second. I estimate my slightly modified script is running 30 times per second, but I need it to be more like 5 times per second.
I just want a left click sent 5 times a second that can be toggled with a hotkey.
Here's a rough outline of what I need:
KEY::Toggle on/off
on=goto loop, else stop
loop{left click mouse, sleep 200}
Actual script that is running much too fast and ignore the sleep paremeter:
Global $Paused, $Runner
HotKeySet("{F10}", "TogglePause")
HotKeySet("{ESC}", "Terminate")
HotKeySet("{F9}", "ShowMe")
;;;; Body of program would go here ;;;;
While 1
Sleep(20000)
WEnd
;;;;;;;;
Func TogglePause()
$Paused = Not $Paused
While $Paused
Sleep(30000)
ToolTip('Script is "Paused"', 0, 0)
WEnd
ToolTip("")
EndFunc ;==>TogglePause
Func Terminate()
Exit 0
EndFunc ;==>Terminate
Func ShowMe()
$Runner = Not $Runner
While $Runner
MouseClick("left")
WEnd
EndFunc ;==>ShowMe