right now i'm facing a problem when, i press start, it will not send the key yet as it will wait the certain delay then only it will press the key
what i really need u guys help is, when i press start, it will send the key first, then it count the delay to repeat the key
here is the script
Code:
Global $timer_1, $timer_2, $timer_3, $timer_4, $timer_5, $timer_6, $timer_7
Global $script_running=0
Global $sleep=100 ;how long of a delay between running the script (100 = 10x / second)
Global $Delay_1 = 1000
Global $Delay_2 = 5000
WinActivate("Untitled - Notepad");
; Hotkeys
HotKeySet("{INSERT}", "start_script")
HotKeySet("{END}", "stop_script")
Func start_script()
$timer_1=TimerInit()
$timer_2=$timer_1
$script_running = 1
EndFunc
Func stop_script()
$script_running = 0
EndFunc
While 1
If $script_running Then
;do stuff here
If(TimerDiff($timer_1) >= $Delay_1) Then
Send ("2") ; 1 sec
$timer_1=TimerInit()
ElseIf(TimerDiff($timer_2) >= $Delay_2) Then
Send ("3") ; 5 sec
$timer_2=TimerInit()
Else
;Send ("1")
EndIf
EndIf
Sleep($sleep)
WEnd






if u want to have a "function" who send the keycodes and call the function by a defined time.