another way it could be done without even editing the source script is this
Code:
#NoEnv
#SingleInstance, Force
SetTitleMatchMode, 2
gosub LoopIt
Return
; do the loop stuff you can trigger this manually using
; the Alt-L hotkey.
!L::
LoopIt:
Gosub LoadIni
Loop, %TimesToLoop%
{ WinActivate Warcraft
Send, 1
Sleep 1000
}
Return
; What this does is: If the ini file doesn't exist it is created
; with a default value of 100 for the times to loop.
; This ini file can be edited with notepad and saved. Reload the new
; data using the hotkey and the script will pick up the new value
; and use that. Now you don't need to stop the script and rerun it
; just reload the ini with the new value.
LoadIni:
!I::
If (!FileExist(MyIni.ini))
{ IniWrite, 100, MyIni.ini, Defaults, TimesToLoop
}
IniRead, TimesToLoop, MyIni.ini, Defaults, TimesToLoop, 100
run, MyIni.ini
Return