Upon clicking shortcut open game, and AHK scripts, as well as close upon App/Game closing.
Posted: 12 Jan 2022, 02:06
This script set will auto open game, peripherals, and autohotkey scripts. And close when Game Closes.
Im a wiki warrior, if you find an error, redundancy, or inefficiency, please let me know.
This code checks for the game Rainbow Six to have Closed every 10 seconds. If game closes, it sends "Pause" key, found in all AHK files that I want to close when the game closes.
Script I use for rainbow six that I want to auto open when game launches without a background app watching.
This I have Saved as .bat file. Second and third line, replace with autohotkeyscripts. Point first line to game shortcut. I save this bat file hidden away, and "send to desktop" as shortcut that way I can have a custom icon or add to steam library as replacement.
Im a wiki warrior, if you find an error, redundancy, or inefficiency, please let me know.
This code checks for the game Rainbow Six to have Closed every 10 seconds. If game closes, it sends "Pause" key, found in all AHK files that I want to close when the game closes.
Code: Select all
#Persistent
If ProcessExist("RainbowSix.exe")
{
Sleep 10000
}
Else
{
Send, Pause
Suspend,Off
ExitApp
}
ProcessExist(Name){
Process,Exist,%Name%
return Errorlevel
}
~F2::Suspend
return
~Pause::
Suspend,Off
ExitApp
Code: Select all
#Persistent
~RButton & 6::Return
~RButton & 5::Return
7::6
Return
~F3::Suspend
return
~Pause::
Suspend,Off
ExitApp
Code: Select all
Start "" "C:\Users\dower\Desktop\DESKTOP GAMES\Tom Clancy's Rainbow Six Siege.url"
Start "" "C:\Users\dower\Desktop\AutoScript\r6.ahk"
Start "" "C:\Users\dower\Desktop\AutoScript\r6 continuom.ahk"
Start "" "C:\Program Files\LGHUB\lghub.exe"