Code: Select all
Clipboard:= "steam password" ; at the start of the script
;…
Send, ^v ; in place of Send, steam password
;...
Code: Select all
Clipboard:= "steam password" ; at the start of the script
;…
Send, ^v ; in place of Send, steam password
;...
Code: Select all
CheckWindow:
While !WinActive(Title)
Sleep, 100
sleep, 100
if !WinActive(Title)
goto CheckWindow
Return
Code: Select all
CheckWindow:
While !WinActive(Title) {
While !WinActive(Title)
Sleep, 50
sleep, 300 ; adjust to your liking
}
Return
Code: Select all
@echo OFF
start "" "Autolaunch DMC5 Steam, required for Playing.ahk"
TIMEOUT /t 20
start "" "steam://rungameid/601150"
TIMEOUT /t 30
tasklist | findstr /i "DevilMayCry5.exe" > nul && start /min "" "DMCVTrainer.exe"
tasklist | findstr /i "DevilMayCry5.exe" > nul && start /min "" "SSSiyanCollabTU5.CT"
for /f "tokens=*" %%f in ('wmic cpu get NumberOfCores /value ^| find "="') do set %%f
GetNumberOfCores.cmd
:Restart
:: starting and assigning your process(es)
set "process_name=DevilMayCry5.exe"
timeout /t 1
::remove .exe suffix if there is
set pn=%process_name:.exe=%
setlocal enableDelayedExpansion
:: this is threshold for 10% (percent)
set /a threshold=3
:CheckCpuLoad
set /a counter=0
:: getting three snapshots of CPU usage of the given process
for /f skip^=2^ tokens^=3^ delims^=^" %%p in ('typeperf "\Process(%pn%)\%% Processor Time" -sc 3') do (
set /a counter=counter+1
rem for /f "tokens=1,2 delims=." %%a in ("%%p") do set "process_snapshot_!counter!=%%a%%b"
for /f "tokens=1,2" %%a in ("%%p") do set "process_snapshot_!counter!=%%a"
)
:: convert to percentage
set /a process_snapshot_1/= %NumberOfCores%
set /a process_snapshot_2/= %NumberOfCores%
set /a process_snapshot_3/= %NumberOfCores%
:: comment three lines below when threshold is set correctly
@echo %process_snapshot_1%
@echo %process_snapshot_2%
@echo %process_snapshot_3%
TIMEOUT /t 1
rem I modified below condition check since I don't fathom the original one!
:: if all three snapshots are less than 0000010 (now threshold) process will be killed
if %process_snapshot_1% LSS %threshold% if %process_snapshot_2% LSS %threshold% if %process_snapshot_3% LSS %threshold% (
tskill %pn%
taskkill /F /T /IM %process_name%
) & goto RUNNING
timeout /t 1
GOTO CheckCpuLoad
:RUNNING
tasklist|findstr DevilMayCry5.exe > nul
if errorlevel 1 (
timeout /t 1
taskkill /F /T /IM cheatengine-x86_64.exe
taskkill /F /T /IM DMCVTrainer.exe
taskkill /F /T /IM Steam.exe
taskkill /F /T /IM Werfault.exe
taskkill /F /T /IM Autolaunch DMC5 Steam, required for Playing.ahk
) & GOTO ENDLOOP
timeout /t 1
GOTO RUNNING
:ENDLOOP
:: reduce to 1 for the final script!
timeout /t 1
:: optionally to restart again (remove 'rem' below)
rem goto Restart
exit /B
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_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
WinWait, % Title:= "Steam Login ahk_exe steam.exe"
Gosub CheckWindow
Send, my steam password
sleep, 300
Gosub CheckWindow
ControlSend,, {Enter}, % Title ; alternative that works even if cmd is not active
ExitApp
CheckWindow:
While !WinActive(Title) {
While !WinActive(Title)
Sleep, 50
sleep, 300 ; adjust to your liking
}
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.
run, Devil May Cry 5_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
WinWait, % Title:= "Steam Login ahk_exe steam.exe"
ControlSend,, steampassword{Enter}, % Title
ExitApp
Code: Select all
;...
WinWait, % Title:= "Steam Login ahk_exe steam.exe"
WinWaitActive, % Title
ControlSend,, steamPassword{Enter}, % Title
ExitApp
Code: Select all
;...
WinWait, % Title:= "Steam Login ahk_exe steam.exe"
WinWaitActive, % Title
ControlSend,, steamPassword, % Title
sleep, 300
ControlSend,, {Enter}, % Title
ExitApp
Code: Select all
SetTitleMatchMode, RegEx
SendMessage, 0x0C,, "steamPassword", .*, % Title
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_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
WinWait, % Title:= "Steam Login ahk_exe steam.exe"
SetTitleMatchMode, RegEx
SendMessage, 0x0C,, "steam password", .*, % Title
sleep, 300
ControlSend,, {Enter}, % Title ; alternative that works even if cmd is not active
ExitApp
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_batch_mode_.bat, D:\Games\Steam
WinWaitActive, % Title:= "C:\Windows\system32\cmd ahk_exe cmd.exe",, 30
Sleep, 5000
ControlSend,, y{Enter}, % Title ; alternative that works even if cmd is not active
#Persistent
SetTimer, PassWandGo, 300
Return
PassWandGo:
WinActivate, % Title:= "ahk_exe steam.exe"
If WinActive(Title)&&!GetKeyState("Alt", "P")&&!GetKeyState("LButton", "P") {
Clipboard:= "my password"
Send, ^v{Sleep 90}{Enter}
ExitApp
}
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.
;CoordMode, Mouse, Client ; not needed
WinWait, % Title:= "DOOMx64vk ahk_exe DOOMx64vk.exe",, 30
IfWinNotActive, % Title
WinActivate, % Title
WinWaitActive, % Title,, 30
;Sleep, 5000 ; you said 30 sec. ???
Sleep, 30000 ; 30 sec. ; unclear!!!
Send, {~} ; This should work!!!
Sleep, 300 ; some time betwixt the entries (may vary form 0 to 500 ms or more)
Send, messagemode 1
sleep 300
Send, {Enter}
Sleep, 300 ; some time betwixt the entries (may vary form 0 to 500 ms or more)
Send, g_infiniteammo 1
Send, {enter}
sleep, 300
Send, {~}
sleep, 300
Send, {Enter}
sleep, 300
Send, {Enter}
sleep 300
Send, {Enter}
sleep, 300
Sleep, 40000
Send, {~} ; This should work!!!
sleep, 300
Send, {enter}
sleep, 300
Send, ai_death_FadeDelay 60000
Send, {enter}
sleep, 300
Send, breakable_NoFadeAndRemove 1
Send, {enter}
sleep, 300
Send, gore_neverFadeAndRemove 1
Send, {enter}
sleep, 300
Send, corpseManager_MaxTime 60000
Send, {enter}
sleep, 300
Send, ai_maxCorpses 60
Send, {enter}
sleep, 300
Send, corpseManager_MaxEntities 128
Send, {enter}
sleep, 300
Send, gore_maxLivingGoreEnts 5000
Send, {enter}
sleep, 300
Send, g_bloodspherescale 35f
Send, {enter}
sleep, 300
Send, g_gorebloodsphereexpanddistance 75f
Send, {enter}
sleep, 300
Send, encounterscript_globalmaxai 60
Send, {enter}
sleep, 300
Send, decal_maxdecalsinradius 40
Send, {enter}
sleep, 300
Send, decal_maxdecalgroupingradius 400.0f
Send, {enter}
sleep, 300
Send, g_goresplashjointsused 32
Send, {enter}
sleep, 300
Send, r_decalclusteringnumdecalsperjob 48
Send, {enter}
sleep, 300
Send, g_breakabledebugdecals 1
Send, {enter}
sleep, 300
Send, r_rendergatherdecalsgranularity 32
Send, {enter}
sleep, 300
Send, g_breakablefloorsplatfromceiling 1
Send, {enter}
sleep, 300
Send, r_decalLifetimeMultiplier 12
Send, {enter}
sleep, 300
Send, r_decalDistanceFadeMultiplier 7
Send, {enter}
sleep, 300
Send, r_detailDistance 25000
Send, {enter}
sleep, 300
Send, r_decalPixelThresholdFadeStart 200
Send, {enter}
sleep, 300
Send, r_decalPixelThresholdFadeEnd 180
Send, {enter}
sleep, 300
Send, r_detailFadeDistMax 24000
Send, {enter}
sleep, 300
Send, r_flaresQuality 0
Send, {enter}
sleep, 300
Send, r_foliageStartFadeDist 20000
Send, {enter}
sleep, 300
Send, r_foliageSmallFadeDistMax 25000
Send, {enter}
sleep, 300
Send, r_foliageBigFadeDistMax 25000
Send, {enter}
sleep, 300
Send, r_lightDistanceFadeMultiplier 7
Send, {enter}
sleep, 300
Send, r_shadowFadeRangeScale 7
Send, {enter}
sleep, 300
Send, r_shadowLODProjectionSizeFactor 0.25
Send, {enter}
sleep, 300
Send, r_shadowPlayerLOD 0
Send, {enter}
sleep, 300
Send, g_showPlayerShadow 1
Send, {enter}
sleep, 300
Send, p_showFootstepParticles 1
Send, {enter}
sleep, 300
Send, image_BCCompressionQuality 0
Send, {enter}
sleep, 300
Send, decal_ForceFadeOutDuration 100000
Send, {enter}
sleep, 300
Send, r_decalDistanceExtendedFadeStart 6000
Send, {enter}
sleep, 300
Send, r_staticTransparencyFadeMaxDist 6000
Send, {enter}
sleep, 300
Send, r_staticTransparencyFadeStartDist 5900
Send, {enter}
sleep, 300
Send, dp_fxLimitThirdPerson 0
Send, {enter}
sleep, 300
Send, r_shadowsDistanceFadeMultiplier 7
Send, {enter}
sleep, 300
Send, vt_lodBias -2
Send, {enter}
sleep, 300
Send, hands_FovScale 0.95
Send, {enter}
sleep, 300
Send, hands_offsetx .13
Send, {enter}
sleep, 300
Send, hands_offsetz -.03
Send, {enter}
sleep, 300
Send, hands_offsetpitch 2
Send, {enter}
sleep, 300
Send, hands_offsetyaw -2
Send, {enter}
Send, {~}
ExitApp
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.
WinWait, % Title:= "DOOMx64vk ahk_exe DOOMx64vk.exe",, 30
Sleep, 30000
#Persistent
SetTimer, Part1, 300
Return
Part1:
WinActivate, % Title
KeyWait, Alt
KeyWait, Ctrl
BlockInput, On
If WinActive(Title) {
Send, {~}
Sleep, 300
Send, messagemode 1
sleep 300
Send, {Enter}
Sleep, 300
Send, g_infiniteammo 1
Send, {enter}
sleep, 300
Send, {~}
sleep, 300
Send, {Enter}
sleep, 300
Send, {Enter}
sleep 300
Send, {Enter}
SetTimer, Part1, Off
WinMinimize, % Title ; So you know when the first part is over
BlockInput, Off
sleep, 40000
SetTimer, Part2, 300
}
BlockInput, Off
Return
Part2:
WinActivate, % Title
KeyWait, Alt
KeyWait, Ctrl
BlockInput, On
If WinActive(Title) {
Send, {~}
sleep, 300
Send, {enter}
sleep, 300
Send, ai_death_FadeDelay 60000
Send, {enter}
sleep, 300
Send, breakable_NoFadeAndRemove 1
Send, {enter}
sleep, 300
Send, gore_neverFadeAndRemove 1
Send, {enter}
sleep, 300
Send, corpseManager_MaxTime 60000
Send, {enter}
sleep, 300
Send, ai_maxCorpses 60
Send, {enter}
sleep, 300
Send, corpseManager_MaxEntities 128
Send, {enter}
sleep, 300
Send, gore_maxLivingGoreEnts 5000
Send, {enter}
sleep, 300
Send, g_bloodspherescale 35f
Send, {enter}
sleep, 300
Send, g_gorebloodsphereexpanddistance 75f
Send, {enter}
sleep, 300
Send, encounterscript_globalmaxai 60
Send, {enter}
sleep, 300
Send, decal_maxdecalsinradius 40
Send, {enter}
sleep, 300
Send, decal_maxdecalgroupingradius 400.0f
Send, {enter}
sleep, 300
Send, g_goresplashjointsused 32
Send, {enter}
sleep, 300
Send, r_decalclusteringnumdecalsperjob 48
Send, {enter}
sleep, 300
Send, g_breakabledebugdecals 1
Send, {enter}
sleep, 300
Send, r_rendergatherdecalsgranularity 32
Send, {enter}
sleep, 300
Send, g_breakablefloorsplatfromceiling 1
Send, {enter}
sleep, 300
Send, r_decalLifetimeMultiplier 12
Send, {enter}
sleep, 300
Send, r_decalDistanceFadeMultiplier 7
Send, {enter}
sleep, 300
Send, r_detailDistance 25000
Send, {enter}
sleep, 300
Send, r_decalPixelThresholdFadeStart 200
Send, {enter}
sleep, 300
Send, r_decalPixelThresholdFadeEnd 180
Send, {enter}
sleep, 300
Send, r_detailFadeDistMax 24000
Send, {enter}
sleep, 300
Send, r_flaresQuality 0
Send, {enter}
sleep, 300
Send, r_foliageStartFadeDist 20000
Send, {enter}
sleep, 300
Send, r_foliageSmallFadeDistMax 25000
Send, {enter}
sleep, 300
Send, r_foliageBigFadeDistMax 25000
Send, {enter}
sleep, 300
Send, r_lightDistanceFadeMultiplier 7
Send, {enter}
sleep, 300
Send, r_shadowFadeRangeScale 7
Send, {enter}
sleep, 300
Send, r_shadowLODProjectionSizeFactor 0.25
Send, {enter}
sleep, 300
Send, r_shadowPlayerLOD 0
Send, {enter}
sleep, 300
Send, g_showPlayerShadow 1
Send, {enter}
sleep, 300
Send, p_showFootstepParticles 1
Send, {enter}
sleep, 300
Send, image_BCCompressionQuality 0
Send, {enter}
sleep, 300
Send, decal_ForceFadeOutDuration 100000
Send, {enter}
sleep, 300
Send, r_decalDistanceExtendedFadeStart 6000
Send, {enter}
sleep, 300
Send, r_staticTransparencyFadeMaxDist 6000
Send, {enter}
sleep, 300
Send, r_staticTransparencyFadeStartDist 5900
Send, {enter}
sleep, 300
Send, dp_fxLimitThirdPerson 0
Send, {enter}
sleep, 300
Send, r_shadowsDistanceFadeMultiplier 7
Send, {enter}
sleep, 300
Send, vt_lodBias -2
Send, {enter}
sleep, 300
Send, hands_FovScale 0.95
Send, {enter}
sleep, 300
Send, hands_offsetx .13
Send, {enter}
sleep, 300
Send, hands_offsetz -.03
Send, {enter}
sleep, 300
Send, hands_offsetpitch 2
Send, {enter}
sleep, 300
Send, hands_offsetyaw -2
Send, {enter}
Send, {~}
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
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
Users browsing this forum: No registered users and 66 guests