Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off

Ask gaming related questions
User avatar
tobsto occupied
Posts: 114
Joined: 20 Feb 2020, 09:34
GitHub: washingleavesandthen

Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off

19 Jul 2020, 12:16

yeah nope , that definitely dont work , wont even callup the console, but will random hit enter 3 times

meaning its missing the console part
rommmcek
Posts: 1050
Joined: 15 Aug 2014, 15:18

Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off

20 Jul 2020, 11:29

I edited the last script on previous page and the one in the link of the same post.
User avatar
tobsto occupied
Posts: 114
Joined: 20 Feb 2020, 09:34
GitHub: washingleavesandthen

Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off

20 Jul 2020, 19:11

shall check it out thanks man, gettin there
User avatar
tobsto occupied
Posts: 114
Joined: 20 Feb 2020, 09:34
GitHub: washingleavesandthen

Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off

21 Jul 2020, 10:21

nope that dont work either , still only the 3 enters but no console being activated and commands entered, you can see this for yourself testing on any game with dev console enabled

this is the ahk youve updated>

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

maybe you should do it without clipboard
User avatar
tobsto occupied
Posts: 114
Joined: 20 Feb 2020, 09:34
GitHub: washingleavesandthen

Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off

22 Jul 2020, 10:36

no , ive used the one with blockinput and works ,this is a ahk script the steam launcher one>

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

tust when i say im not a fan of clipboard usage , if possible refrain from its use
rommmcek
Posts: 1050
Joined: 15 Aug 2014, 15:18

Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off

22 Jul 2020, 13:05

This now uses the same method as the script you reported that works:

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
User avatar
tobsto occupied
Posts: 114
Joined: 20 Feb 2020, 09:34
GitHub: washingleavesandthen

Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off

25 Jul 2020, 08:35

shall try , thanks as usual and sorry for the headache as usual
User avatar
tobsto occupied
Posts: 114
Joined: 20 Feb 2020, 09:34
GitHub: washingleavesandthen

Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off

27 Jul 2020, 05:51

this "~" is not being used meaning all the other shit is entered but the console "~" is NOT being called upon still needs some polish


you can try this yourself with pretty much any game using a dev console
rommmcek
Posts: 1050
Joined: 15 Aug 2014, 15:18

Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off

27 Jul 2020, 13:41

Have no game, hence no dev console!

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())
….
Good luck!
User avatar
tobsto occupied
Posts: 114
Joined: 20 Feb 2020, 09:34
GitHub: washingleavesandthen

Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off

28 Jul 2020, 02:04

wtf..no games? damn son..ok well guess well have to keep on tryin till we get there -.- and thanks luck is what we need
User avatar
tobsto occupied
Posts: 114
Joined: 20 Feb 2020, 09:34
GitHub: washingleavesandthen

Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off

30 Jul 2020, 16:23

ok so not quite there yet , issue with this is that it inputs all the commands in one full string not one command then enter then the next one and enter again and so on till all commands are done . this is how it currently looks>

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
as well do i not know where to put the second Send, {~} to close the console after the last enter as well it still does hit enter afterwards i dont want that, been trying out some control send as well as you can tell to prevent commands etc being sent to anything else than the game
rommmcek
Posts: 1050
Joined: 15 Aug 2014, 15:18

Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off

31 Jul 2020, 17:53

This should be identical to other script with the same feature as script above:

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
User avatar
tobsto occupied
Posts: 114
Joined: 20 Feb 2020, 09:34
GitHub: washingleavesandthen

Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off

02 Aug 2020, 10:47

ok so ive tried that but it dont do the following>

hit Enter , then call up the console , then enter one command for example : fov 65
and then hits Enter then the next commmand and so on till all are entered and then exits the console , finished

heres an example of a compressed ahk im testing on another game which uses the following combo to call up the console: Ctrl+~

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

it doesnt work , it hits enter , then enter again , no console ..no commands entered one after another no console close .....-.-
rommmcek
Posts: 1050
Joined: 15 Aug 2014, 15:18

Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off

03 Aug 2020, 07:39

Your feedback is vague (in general not just the last one)!
Does this script work if you run it and don't try to change the focus?
Last edited by rommmcek on 03 Aug 2020, 11:34, edited 1 time in total.
User avatar
tobsto occupied
Posts: 114
Joined: 20 Feb 2020, 09:34
GitHub: washingleavesandthen

Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off

03 Aug 2020, 09:26

yep , but as stated that one doesnt have the feature: instant pause on focus loss and instant continue from pause state on refocus irregardless of how many times this occurs


p.s sorry if my feedback isnt always clear to you :(
rommmcek
Posts: 1050
Joined: 15 Aug 2014, 15:18

Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off

03 Aug 2020, 11:33

Now explain what in my last script doesn't work as expected.
You've been talking about calling up the console. How do you this manually? What is console? Is this a Cmd window or some game Interface. You should give me some screen shots! I'm blindfolded!

So the tilde ~ calls the consol, but form where?
Does sending tilde like this:

Code: Select all

Send, {~}
call it properly?
What about this:

Code: Select all

Tilde:= "{~}"
Send, % Tilde
Your last code almost probably cannot work because after forth entry hits three times Enter! Just look in the code if n=4 { ...
User avatar
tobsto occupied
Posts: 114
Joined: 20 Feb 2020, 09:34
GitHub: washingleavesandthen

Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off

04 Aug 2020, 10:47

latest code posted by me is a different game it calls the console by doing the keycombo of : Ctrl + ~
this calls the ingame console, as per your example this code calls console, yes :

Send, ^{~}

or


Tilde:= "^{~}"
Send, % Tilde


yes, and as said i need the actual commands entered one after another and after each command the Enter key to be executed as explained above, as such:


Send, ai_death_FadeDelay 60000
Send, {enter}
sleep, 300
Send, r_weapon_fov 65
Send, {enter}
sleep, 300
Send, r_fog_local_lights 0
Send, {enter}
sleep, 300
Send, a_lods 0
Send, {enter}
sleep, 300


and no i dont want 3 times the Enter key to be executed after the console commands are done being entered , just want the console being exited by entering the following code again at the end then :

Send, ^{~}

or


Tilde:= "^{~}"
Send, % Tilde

finished , and of course as said for the script to be able to instant pause on game focus loss and continue from the console command it paused at on refocus and exit itself once finished successfully

Return to “Gaming”

Who is online

Users browsing this forum: No registered users and 17 guests