I have written a script here with GUI that should start when the "Start" button is pressed and should be interrupted with the "Stop" button.
The script works the first time I press the "Start" button.
When I press "Stop" the script stops.
But when I press "Start" again, nothing happens.
What am I doing wrong?
I appreciate your answer!
Code: Select all
#SingleInstance, Force
Gui, Add, Button, x0 y21 w121 h29 gagain, Start
Gui, Add, Button, x130 y21 w121 h29 gstop, St&op
Gui, Add, Button, x260 y21 w121 h29 gover, E&xit
gui, show, w381 h50
stop:
Pause
again:
MouseMove, 20, 30, 50, R
sleep, 2000
MouseMove, -20, -30, 50, R
sleep, 2000
goto again
over:
ExitApp
GuiClose:
GuiEscape:
ExitApp