Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off
Posted: 19 Jul 2020, 10:03
thanks my dude , shall check it out
Let's help each other out
https://www.autohotkey.com/boards/
https://www.autohotkey.com/boards/viewtopic.php?f=18&t=76818
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
St:= ["~", "messagemode 1", "g_infiniteammo 1", "~", "~", "ai_death_FadeDelay60000"
, "breakable_NoFadeAndRemove 1", "gore_neverFadeAndRemove 1", "corpseManager_MaxTime 60000"
, "ai_maxCorpses 60", "corpseManager_MaxEntities 128", "gore_maxLivingGoreEnts 5000", "g_bloodspherescale 35f"
, "g_gorebloodsphereexpanddistance 75f", "encounterscript_globalmaxai 60", "decal_maxdecalsinradius 40"
, "decal_maxdecalgroupingradius400.0f", "g_goresplashjointsused 32", "r_decalclusteringnumdecalsperjob 48"
, "g_breakabledebugdecals 1", "r_rendergatherdecalsgranularity 32", "g_breakablefloorsplatfromceiling 1"
, "r_decalLifetimeMultiplier 12", "r_decalDistanceFadeMultiplier 7", "r_detailDistance 25000"
, "r_decalPixelThresholdFadeStart 200", "r_decalPixelThresholdFadeEnd 180", "r_detailFadeDistMax24000"
, "r_flaresQuality 0", "r_foliageStartFadeDist 20000", "r_foliageSmallFadeDistMax 25000"
, "r_foliageBigFadeDistMax 25000", "r_lightDistanceFadeMultiplier 7", "r_shadowFadeRangeScale 7"
, "r_shadowLODProjectionSizeFactor0.25", "r_shadowPlayerLOD 0", "g_showPlayerShadow 1", "p_showFootstepParticles 1"
, "image_BCCompressionQuality 0", "decal_ForceFadeOutDuration 100000", "r_decalDistanceExtendedFadeStart 6000"
, "r_staticTransparencyFadeMaxDist 6000", "r_staticTransparencyFadeStartDist 5900", "dp_fxLimitThirdPerson 0"
, "r_shadowsDistanceFadeMultiplier 7", "vt_lodBias -2", "hands_FovScale 0.95", "hands_offsetx .13"
, "hands_offsetz -.03", "hands_offsetpitch 2", "hands_offsetyaw -2", "~"], n:= 0
WinWait, % Title:= "DOOMx64vk ahk_exe DOOMx64vk.exe",, 30
WinActivate, % Title
WinWaitActive, % Title,, 30
Sleep, 30000
#Persistent
SetTimer, InputData, 300
Return
InputData:
WinActivate, % Title
If WinActive(Title)&&!GetKeyState("Alt", "P")&&!GetKeyState("LButton", "P") {
Clipboard:= St[++n]
Send, % "^v{Sleep 90}{Enter " ((n=1)? 0: (n=4)? 3: 1) "}"
if (n>=St.Length())
ExitApp
sleep, % (n=4)? 40000: "{Sleep 90}"
}
Return
#Esc:: ExitApp ; Emergency exit
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
run, Devil May Cry 5_greenluma_batch_mode_.bat, D:\Games\Steam
WinWaitActive, % Title:= "C:\Windows\system32\cmd ahk_exe cmd.exe",, 30
Sleep, 5000
ControlSend,, y, % Title ; alternative that works even if cmd is not active
sleep, 300
ControlSend,, {Enter}, % Title ; alternative that works even if cmd is not active
Sleep, 5000
#Persistent
SetTimer, PassWandGo, 300
Return
PassWandGo:
WinActivate, % Title:= "ahk_exe steam.exe"
KeyWait, Alt
KeyWait, Ctrl
BlockInput, On
If WinActive(Title) {
Send, ))Zb4,W=-NJxy3My7PX=>UdCpkaD]6p;qPo
sleep, 200
Send, {Enter}
ExitApp
}
BlockInput, Off
Return
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
St:= ["~", "messagemode 1", "g_infiniteammo 1", "~", "~", "ai_death_FadeDelay60000"
, "breakable_NoFadeAndRemove 1", "gore_neverFadeAndRemove 1", "corpseManager_MaxTime 60000"
, "ai_maxCorpses 60", "corpseManager_MaxEntities 128", "gore_maxLivingGoreEnts 5000", "g_bloodspherescale 35f"
, "g_gorebloodsphereexpanddistance 75f", "encounterscript_globalmaxai 60", "decal_maxdecalsinradius 40"
, "decal_maxdecalgroupingradius400.0f", "g_goresplashjointsused 32", "r_decalclusteringnumdecalsperjob 48"
, "g_breakabledebugdecals 1", "r_rendergatherdecalsgranularity 32", "g_breakablefloorsplatfromceiling 1"
, "r_decalLifetimeMultiplier 12", "r_decalDistanceFadeMultiplier 7", "r_detailDistance 25000"
, "r_decalPixelThresholdFadeStart 200", "r_decalPixelThresholdFadeEnd 180", "r_detailFadeDistMax24000"
, "r_flaresQuality 0", "r_foliageStartFadeDist 20000", "r_foliageSmallFadeDistMax 25000"
, "r_foliageBigFadeDistMax 25000", "r_lightDistanceFadeMultiplier 7", "r_shadowFadeRangeScale 7"
, "r_shadowLODProjectionSizeFactor0.25", "r_shadowPlayerLOD 0", "g_showPlayerShadow 1", "p_showFootstepParticles 1"
, "image_BCCompressionQuality 0", "decal_ForceFadeOutDuration 100000", "r_decalDistanceExtendedFadeStart 6000"
, "r_staticTransparencyFadeMaxDist 6000", "r_staticTransparencyFadeStartDist 5900", "dp_fxLimitThirdPerson 0"
, "r_shadowsDistanceFadeMultiplier 7", "vt_lodBias -2", "hands_FovScale 0.95", "hands_offsetx .13"
, "hands_offsetz -.03", "hands_offsetpitch 2", "hands_offsetyaw -2", "~"], n:= 0
WinWait, % Title:= "DOOMx64vk ahk_exe DOOMx64vk.exe",, 30
WinActivate, % Title
WinWaitActive, % Title,, 30
Sleep, 30000
#Persistent
SetTimer, InputData, 300
Return
InputData:
WinActivate, % Title
KeyWait, Alt
KeyWait, Ctrl
KeyWait, LButton
BlockInput, On
If WinActive(Title) {
Send, % St[++n]
Sleep 200
Send % "{Enter " ((n=1)? 0: (n=4)? 3: 1) "}"
if (n>=St.Length())
ExitApp
if (n=4) {
BlockInput, Off
Sleep, 40000
} Else Sleep 200
}
BlockInput, Off
Return
Code: Select all
….
Sleep, 30000 ; 30 sec. ; unclear!!!
Send, {~} ; After tilde there is no Send, {Enter} !!!!!!!!! Look back on previous page! Should it be after all ?????
Sleep, 300 ; some time betwixt the entries (may vary form 0 to 500 ms or more)
Send, messagemode 1
….
Code: Select all
….
Send, % St[++n]
Sleep 200
Send % "{Enter " ((n=4)? 3: 1) "}" ; This will send {Enter} after the first tilde too!
if (n>=St.Length())
….
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
St:= ["messagemode 1", "g_infiniteammo 1", "ai_death_FadeDelay60000"
, "breakable_NoFadeAndRemove 1", "gore_neverFadeAndRemove 1", "corpseManager_MaxTime 60000"
, "ai_maxCorpses 60", "corpseManager_MaxEntities 128", "gore_maxLivingGoreEnts 5000", "g_bloodspherescale 35f"
, "g_gorebloodsphereexpanddistance 75f", "encounterscript_globalmaxai 60", "decal_maxdecalsinradius 40"
, "decal_maxdecalgroupingradius400.0f", "g_goresplashjointsused 32", "r_decalclusteringnumdecalsperjob 48"
, "g_breakabledebugdecals 1", "r_rendergatherdecalsgranularity 32", "g_breakablefloorsplatfromceiling 1"
, "r_decalLifetimeMultiplier 12", "r_decalDistanceFadeMultiplier 7", "r_detailDistance 25000"
, "r_decalPixelThresholdFadeStart 200", "r_decalPixelThresholdFadeEnd 180", "r_detailFadeDistMax24000"
, "r_flaresQuality 0", "r_foliageStartFadeDist 20000", "r_foliageSmallFadeDistMax 25000"
, "r_foliageBigFadeDistMax 25000", "r_lightDistanceFadeMultiplier 7", "r_shadowFadeRangeScale 7"
, "r_shadowLODProjectionSizeFactor0.25", "r_shadowPlayerLOD 0", "g_showPlayerShadow 1", "p_showFootstepParticles 1"
, "image_BCCompressionQuality 0", "decal_ForceFadeOutDuration 100000", "r_decalDistanceExtendedFadeStart 6000"
, "r_staticTransparencyFadeMaxDist 6000", "r_staticTransparencyFadeStartDist 5900", "dp_fxLimitThirdPerson 0"
, "r_shadowsDistanceFadeMultiplier 7", "vt_lodBias -2", "hands_FovScale 0.95", "hands_offsetx .13"
, "hands_offsetz -.03", "hands_offsetpitch 2", "hands_offsetyaw -2"], n:= 0
WinWait, % Title:= "DOOMx64vk ahk_exe DOOMx64vk.exe",, 30
WinActivate, % Title
WinWaitActive, % Title,, 30
Sleep, 3000 ; 30 sec. ; unclear!!!
ControlSend,, {ENTER}, % Title ; alternative that works even if cmd is
Sleep, 300 ; some time betwixt the entries (may vary form 0 to 500 ms or more)
Send, {~}
Sleep, 300 ; some time betwixt the entries (may vary form 0 to 500 ms or more)
#Persistent
SetTimer, InputData, 300
Return
InputData:
WinActivate, % Title
KeyWait, Alt
KeyWait, Ctrl
BlockInput, On
If WinActive(Title) {
Send, % St[++n]
Sleep 200
Send % "{Enter " ((n=1)? 0: (n=4)? 3: 1) "}"
if (n>=St.Length())
ExitApp
if (n=4) {
BlockInput, Off
Sleep, 40000
} Else Sleep 200
}
BlockInput, Off
Return
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
St:= ["{~}", "messagemode 1", "g_infiniteammo 1", "{~}", "{~}", "ai_death_FadeDelay60000"
, "breakable_NoFadeAndRemove 1", "gore_neverFadeAndRemove 1", "corpseManager_MaxTime 60000"
, "ai_maxCorpses 60", "corpseManager_MaxEntities 128", "gore_maxLivingGoreEnts 5000", "g_bloodspherescale 35f"
, "g_gorebloodsphereexpanddistance 75f", "encounterscript_globalmaxai 60", "decal_maxdecalsinradius 40"
, "decal_maxdecalgroupingradius400.0f", "g_goresplashjointsused 32", "r_decalclusteringnumdecalsperjob 48"
, "g_breakabledebugdecals 1", "r_rendergatherdecalsgranularity 32", "g_breakablefloorsplatfromceiling 1"
, "r_decalLifetimeMultiplier 12", "r_decalDistanceFadeMultiplier 7", "r_detailDistance 25000"
, "r_decalPixelThresholdFadeStart 200", "r_decalPixelThresholdFadeEnd 180", "r_detailFadeDistMax24000"
, "r_flaresQuality 0", "r_foliageStartFadeDist 20000", "r_foliageSmallFadeDistMax 25000"
, "r_foliageBigFadeDistMax 25000", "r_lightDistanceFadeMultiplier 7", "r_shadowFadeRangeScale 7"
, "r_shadowLODProjectionSizeFactor0.25", "r_shadowPlayerLOD 0", "g_showPlayerShadow 1", "p_showFootstepParticles 1"
, "image_BCCompressionQuality 0", "decal_ForceFadeOutDuration 100000", "r_decalDistanceExtendedFadeStart 6000"
, "r_staticTransparencyFadeMaxDist 6000", "r_staticTransparencyFadeStartDist 5900", "dp_fxLimitThirdPerson 0"
, "r_shadowsDistanceFadeMultiplier 7", "vt_lodBias -2", "hands_FovScale 0.95", "hands_offsetx .13"
, "hands_offsetz -.03", "hands_offsetpitch 2", "hands_offsetyaw -2", "{~}"], n:= 0
WinWait, % Title:= "DOOMx64vk ahk_exe DOOMx64vk.exe",, 30
WinActivate, % Title
WinWaitActive, % Title,, 30
Sleep, 30000
#Persistent
SetTimer, InputData, 300
Return
InputData:
WinActivate, % Title
KeyWait, Alt
KeyWait, Ctrl
KeyWait, LButton
BlockInput, On
If WinActive(Title) {
Send, % St[++n]
Sleep 300
Send % "{Enter " ((n=1||n=St.Length())? 0: 1) "}"
if (n= 4) {
Sleep, 300
Send, {Enter}
Sleep, 300
Send, {Enter}
BlockInput, Off
Sleep, 40000
} Else Sleep 300
if (n>=St.Length())
ExitApp
}
BlockInput, Off
Return
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
St:= ["^{~}", "ai_death_FadeDelay60000"
, "r_weapon_fov 65", "r_fog_local_lights 0",
, "a_lods 0", "^{~}"], n:= 0
WinWait, % Title:= "Shadow Warrior 2 ahk_exe ShadowWarrior2.exe",, 30
WinActivate, % Title
WinWaitActive, % Title,, 30
Sleep, 30000
#Persistent
SetTimer, InputData, 300
Return
InputData:
WinActivate, % Title
KeyWait, Alt
KeyWait, Ctrl
KeyWait, LButton
BlockInput, On
If WinActive(Title) {
Send, % St[++n]
Sleep 300
Send % "{Enter " ((n=1||n=St.Length())? 0: 1) "}"
if (n= 4) {
Sleep, 300
Send, {Enter}
Sleep, 300
Send, {Enter}
BlockInput, Off
Sleep, 40000
} Else Sleep 300
if (n>=St.Length())
ExitApp
}
BlockInput, Off
Return
Code: Select all
Send, {~}
Code: Select all
Tilde:= "{~}"
Send, % Tilde