#include <Misc.au3>
Opt("WinTitleMatchMode",3)
;Globals
$CtrlRight = "A3"
$Spacebar = "20"
While 1
WinWait("Warhammer 40,000: Darktide")
While WinActive("Warhammer 40,000: Darktide")
Sleep(100)
;---------------------------------------Movement Tech--------------------------------------------------------------------
If _IsPressed($CtrlRight) and _IsPressed($Spacebar) then
Send("{SPACE DOWN}")
Send("{LSHIFT DOWN}")
Sleep (200)
Send("{SPACE UP}")
Send("{LSHIFT UP}")
If _IsPressed($CtrlRight) then
Send("{LSHIFT DOWN}")
Sleep (101)
Send("{LSHIFT UP}")
EndIf
If _IsPressed($CtrlRight) then
Send("{LSHIFT DOWN}")
Sleep (91)
Send("{LSHIFT UP}")
EndIf
If _IsPressed($CtrlRight) then
Send("{LSHIFT DOWN}")
Sleep(87)
Send("{LSHIFT UP}")
EndIf
If _IsPressed($CtrlRight) then
While _isPressed($CtrlRight)
Send("{LCTRL DOWN}")
Sleep(30)
WEnd
Send("{LCTRL UP}")
EndIf
Sleep(20)
If Not _IsPressed($CtrlRight) Then
Send("{SPACE UP}")
Send("{LSHIFT UP}")
Send("{LCTRL UP}")
EndIf
EndIf
;---------------------------------------------------------------------------------------------------------------------
WEnd
If Not WinExists("Warhammer 40,000: Darktide") then
Exit
EndIf
Wend
Heres my current thing. The problem begins at line 34, which is the "If _IsPressed($CtrlRight) then While _isPressed"... etc.
What I want to happen is for spacebar to be pressed first, then a bit of left shift spamming, this part works fine. then i'd like the script to be locked in a loop of holding left control UNTIL right control is let go, where it should let go of left control (LCTRL UP). i added a space up and lshift up just to be sure those dont remain clicked. however this portion of the script never runs, it gets to holding down lctrl and thats where it stays.
Any help is appreciated.