I am using the caps lock key instead of alt or shift, before pressing w to walk, f to interact, or q to toggle the anti-kick. That works, including some of the anti-kick features.
With the anti-kick or stay-online part of the script, what happens is that it effectively moves, minimizes, activates, the window, and the robot voice says "sending", but unless I click around windows to get it to send the F1 key in Star Citizen, the script actually presses F1 on whichever other window is open at the time.
For example, I have notepad++ open, the F1 key was pressed to open the About window for that program as a result of the script.
I should also mention that Star Citizen has 3 window modes:
1. Windowed
2. Fullscreen
3. Borderless
I tested this with "Windowed" and "Borderless" and the script responded the same way with both settings.
Here's the sequence of what I did and what happened:
1. Pressed caps lock q while in Star Citizen
2. Star Citizen window disappeared
3. "Sending" voice, notepad++ About window opened
The script had to be paused to make it stop. I tested it again after I clicked between more programs, like the web browser, and then it made my web browser disappear after opening the About tab with the F1 key for the browser.
I wonder if I will need to be more specific in the script to prevent it from affecting other programs. Other than that, it is almost working as intended. It's not fully functioning yet, but this is progress, and that is great!
Here's the current draft, I have not set auto-walk and auto-hold interact to toggles yet but that can be done later, right now the focus is on that Stay Online feature:
Code: Select all
#Requires AutoHotkey v2.0
#SingleInstance Force
DetectHiddenWindows 1 ; added this line in case star citizen tries to use hidden windows
; Stay Online
; Press tab q to toggle
CapsLock & q:: {
Static on := false
if on := !on {
SetTimer(Fn1, 15000) ; 15 seconds for testing, set to 900000 (15 minutes) when script is ready
WinActivate "Star Citizen"
WinMove A_ScreenWidth, A_ScreenHeight, , , "Star Citizen"
WinMinimize "Star Citizen"
} Else {
SetTimer(Fn1, 0)
WinActivate "Star Citizen"
WinMaximize "Star Citizen"
}
}
Fn1() {
ComObject("SAPI.SpVoice").Speak("Sending")
WinActivate "Star Citizen"
Send "{F1}"
WinMinimize "Star Citizen"
}
; Auto-Walk
; Press tab w to toggle
#HotIf WinActive("Star Citizen")
CapsLock & w:: {
Loop {
Send("{w down}")
Sleep 100
KeyWait "w"
Break
}
} ;
; Auto-Hold Interact
; Press tab f to toggle
CapsLock & f:: {
Loop {
Send("{f down}")
Sleep 100
KeyWait "f"
Break
}
}