This ahk script question

this ahk was workingfine, in tests , but once i loadwow , it wont work any more, any suggestions ?

#ifWinActive World of Warcraft ; Only run if window ‘World of Warcraft’ is active
{
$1:: ; If e is pressed
$^1:: ; If e+control is pressed
$+1:: ; If e+shift is pressed
$!1:: ; If e+alt is pressed
Loop ; If any of the above is true then loop below
{
if not GetKeyState(“1”, “P”) ; If E is not pressed then break the loop
break
if GetKeyState(“LCtrl”, “P”) ; If left control is pressed then send control+e
Send ^1
RandSleep(50,120)
if GetKeyState(“LShift”, “P”) ; If left shift is pressed then send shift+e
Send +1
RandSleep(50,120)
if GetKeyState(“LAlt”, “P”) ; If left alt is pressed then send alt+e
Send !1
RandSleep(50,120)
else
Send 1 ; If 1 is pressed with no other modifiers send 1
RandSleep(50,120) ; Time in milliseconds between key repeats
}
return
RandSleep(x,y) { ;creates a variable with an X and Y
Random, rand, %x%, %y% ;Uses the Random function to generate x and y
Sleep %rand% ;makes the %rand% value the sleep time
}

could try a variable timer macro

#Persistent
#MaxThreadsPerHotkey 1
#ifWinActive World of Warcraft ; Only run if window ‘World of Warcraft’ is active

; SET DEFAULT SPEED. LOWER = FASTER
sleeptime = 20

; PRESSING CTRL+NUMPAD-(NUMPAD MINUS) TOGGLES THE SCRIPT ON/OFF
<^NumpadSub::
toggle := !toggle

#if toggle

; SHOW IF SCRIPT IS ACTIVE | INACTIVE WHEN YOU PRESS CTRL+NUMPAD-(NUMPAD MINUS)
ToolTip % toggle ? “SCRIPT ON” : “SCRIPT OFF”
SetTimer, RemoveToolTip, 5000
return
RemoveToolTip:
SetTimer, RemoveToolTip, Off
ToolTip
return

; =============================================================
; ================= SETTING SLEEPTIME SECTION =================
; =============================================================

; PRESSING NUMPAD0 SETS THE SPEED TO 50ms
$Numpad0::
KeyWait, Numpad0
If errorlevel = 0
{
sleeptime = 50
ToolTip, SLEEPTIME ISn%sleeptime% ms SetTimer, Remove0, 5000 return Remove0: SetTimer, Remove0, Off ToolTip return } ; PRESSING NUMPAD1 SETS THE SPEED TO 75ms $Numpad1:: KeyWait, Numpad1 If errorlevel = 0 { sleeptime = 75 ToolTip, SLEEPTIME ISn%sleeptime% ms
SetTimer, Remove1, 5000
return
Remove1:
SetTimer, Remove1, Off
ToolTip
return
}
; PRESSING NUMPAD2 SETS THE SPEED TO 100ms
$Numpad2::
KeyWait, Numpad2
If errorlevel = 0
{
sleeptime = 100
ToolTip, SLEEPTIME ISn%sleeptime% ms SetTimer, Remove2, 5000 return Remove2: SetTimer, Remove2, Off ToolTip return } ; PRESSING NUMPAD3 SETS THE SPEED TO 150ms $Numpad3:: KeyWait, Numpad3 If errorlevel = 0 { sleeptime = 150 ToolTip, SLEEPTIME ISn%sleeptime% ms
SetTimer, Remove3, 5000
return
Remove3:
SetTimer, Remove3, Off
ToolTip
return
}
; PRESSING NUMPAD9 CHECKS THE CURRENT SPEED
~Numpad9::
KeyWait, Numpad9
If errorlevel = 0
{
ToolTip, CURRENT SLEEPTIME IS`n%sleeptime% ms
SetTimer, Remove, 5000
return
Remove:
SetTimer, Remove, Off
ToolTip
return
}

{
$q:: ; If q is pressed
$^q:: ; If q+control is pressed
$+q:: ; If q+shift is pressed
$!q:: ; If q+alt is pressed
Loop ; If any of the above is true then loop below
{
if not GetKeyState(“q”, “P”) ; If q is not pressed then break the loop
break
if GetKeyState(“LCtrl”, “P”) ; If left control is pressed then send control+q
Send ^q
else if GetKeyState(“LShift”, “P”) ; If left shift is pressed then send shift+q
Send +q
else if GetKeyState(“LAlt”, “P”) ; If left alt is pressed then send alt+q
Send !q
else
Send q ; If q is pressed with no other modifiers send q
sleep 50 ; Time in milliseconds between key repeats
}
return
}