i want a script that every time i press a key (x) it inputs either 1, 2, 3, 4, 5, or 6. Each of these numbers have a different timer on them (9, 12, 16seconds, etc.
So each time i press (x), itll send either 1, 2, 3,... depending on which timers are up atm. For example with 3 keys
1 has 3second timer
2 has 6 second timer
3 has 9 second timer
I press X, X sends 1, i mouseclick, 1 is now on timer
I press X, X sends 2, i mouseclick, 2 is now on timer
I press X, X sends 3, i mouseclick, 2 is now on timer
1 is off timer
i press x, x sends 1, i mouseclick
1 is off timer again
i press x, xsends 1, i mouseclick
2 is off timer
etc....
this is what i have so far:
Code:
high_key = 6
second_multiplier := 1000
Action1_delay := second_multiplier * 13
Action2_delay := second_multiplier * 14
Action3_delay := second_multiplier * 6
Action4_delay := second_multiplier * 14
Action5_delay := second_multiplier * 9
Action6_delay := second_multiplier * 9
return
x::
Loop %high_key% {
;MsgBox, %A_Index% ; A_Index is the iteration number of loop
if ( Action%A_Index%_isset != true ) {
if IsLabel("Action" . A_Index){
Action%A_Index%_isset := true ;
SetTimer, Action%A_Index%, % Action%A_Index%_delay
break ;
}
}
}
Return
Action1:
SetTimer, %A_ThisLabel%, Off
Send, +{Numpad1}
KeyWait, Lbutton, d
KeyWait, LButton
%A_ThisLabel%_isset := false
Sleep 500
return
Action2:
SetTimer, %A_ThisLabel%, Off
Send, +{Numpad2}
KeyWait, Lbutton, d
KeyWait, Lbutton
%A_ThisLabel%_isset := false
Sleep 500
return
Action3:
SetTimer, %A_ThisLabel%, Off
Send, +{Numpad3}
KeyWait, Lbutton, d
KeyWait, Lbutton
%A_ThisLabel%_isset := false
Sleep 500
return
Action4:
SetTimer, %A_ThisLabel%, Off
Send, +{Numpad4}
KeyWait, Lbutton, d
KeyWait, Lbutton
%A_ThisLabel%_isset := false
Sleep 500
return
Action5:
SetTimer, %A_ThisLabel%, Off
Send, +{Numpad5}
KeyWait, Lbutton, d
KeyWait, Lbutton
%A_ThisLabel%_isset := false
Sleep 500
return
Action6:
SetTimer, %A_ThisLabel%, Off
Send, +{Numpad6}
KeyWait, Lbutton, d
KeyWait, Lbutton
%A_ThisLabel%_isset := false
Sleep 500
return