Hi i have problem with this script for buffing. I want it when i press F2 to fire buffs ( send keys ) and then put timers "on" for next buffing. So to do like this :
- run script
- script do nothing untill i press F2
- when i press F2 send keys ( cast time is Sleep() )
- put timers "on" and when buff cooldown time ends send only that key where timer is reached cooldown time and put timer "on" again
F2 pause/start script
EDIT :
i correct some of code and now it works, so when i press F2 it send keys but wont send again when cooldown time reach time given in array
Thanks in advance
- run script
- script do nothing untill i press F2
- when i press F2 send keys ( cast time is Sleep() )
- put timers "on" and when buff cooldown time ends send only that key where timer is reached cooldown time and put timer "on" again
F2 pause/start script
EDIT :
i correct some of code and now it works, so when i press F2 it send keys but wont send again when cooldown time reach time given in array
Code:
Opt("SendKeyDelay", 5) ;5 milliseconds
HotKeySet("{F2}", "_Start")
Global $Run
Global $keys[7] = [3, 4, 5, 6, 7, 8, 9] ; keys
Global $cast[7] = [2000, 2000, 2000, 2000, 2000, 2000, 2000] ; cast
Global $cooldown[7] = [140000, 100000, 440000, 495000, 480000, 360000, 360000] ; cooldown
While 1
Sleep(100)
WEnd
Func _Start()
$Run = NOT $Run
While $Run
For $i=0 To UBound($keys)-1
If TimerDiff($cast[$i]) > $cooldown[$i] Then
Send($keys[$i])
$cooldown[$i]=TimerInit()
Sleep($cast[$i])
EndIf
Next
WEnd
EndFunc