First problem: When releasing the Lbutton, it takes around 3 seconds until its being registered as pressed. So only then i can run the two loops again. I suspect the second set timer loop to trigger a global cooldown of sorts. I only want the "cooldown" to apply to the second loop while the first loop is fired as soon as i press the lbutton again.
Second problem: The second loop doesnt remember where it has been left off and restarts as soon as I release the Lbutton. I want it to remember that it has, for example, pressed button 2 so it can than press button 3 etc. I tried cycle, but cycle seem to not be able to be held down, so i need physically press the lbutton for it to cycle through the keys.
Third problem: The loop randomly stops after some presses. Sometimes, but it still happens.
PS: I frankensteined this together and as such, have little to no understanding anythign concerning the scripting itself, so clear examples (of the code i posted preferably) would be appretiated.
Heres the code:
Code: Select all
#SingleInstance Force
Suspend, on
mbutton::
Suspend
ToolTip % A_IsSuspended ? "XXX" : "OOO", 1400, 100
return
; This puts a 30ms pause between each character when using SendEvent
SetKeyDelay, 30
; End of AES
Exit
; Pressing XB1 starts up everything
Lbutton::
state := 0
; Run Shift+E one time
GoSub, SendShift1
; Then set a timer to run it again every 60 seconds
SetTimer, SendShift1, 200
; Then send the other stuff
GoSub, SendStuff
Return
SendStuff:
SendEvent, 2
Sleep 3000
if(state)
return
SendEvent, 3
Sleep 4000
if(state)
return
SendEvent, 4
Sleep 5000
if(state)
return
; Check to see if XB1 is still being held
If GetKeyState("Lbutton", "P")
; If yes, run this sub again in 50ms
SetTimer, % A_ThisLabel, -50
GoSub, SendShift1
Return
; Shift+e gets its own subroutine so we can keep it on a 1 min loop
SendShift1:
SendEvent, +1
Return
Lbutton Up::
SetTimer, SendStuff, off
SetTimer, SendShift1, Off
state := 1
return
WheelUp::
send q
WheelDown:
send q