You dont report if
Code: Select all
Tilde:= "{~}"
Send, % Tilde
Code: Select all
Tilde:= "{~}"
Send, % Tilde
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:= "Shadow Warrior 2 ahk_exe ShadowWarrior2.exe",, 30
IfWinNotActive, % Title
WinActivate, % Title
WinWaitActive, % Title,, 30
;Sleep, 5000 ; you said 30 sec. ???
Sleep, 5000 ; 30 sec. ; unclear!!!
Send, {Enter}
sleep 300
Tilde:= "^{~}"
Send, % Tilde
Sleep, 300 ; some time betwixt the entries (may vary form 0 to 500 ms or more)
Send, r_weapon_fov 65
sleep 300
Send, {Enter}
Sleep, 300 ; some time betwixt the entries (may vary form 0 to 500 ms or more)
Send, r_fog_local_lights 0
Send, {Enter}
sleep, 300
Send, a_lods 0
Send, {Enter}
sleep, 300
Send, % Tilde
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.
St:= ["^{~}", "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, 5000
Send, {Enter}
#Persistent
SetTimer, InputData, 300
Return
InputData:
WinActivate, % Title
KeyWait, Alt
KeyWait, Ctrl
KeyWait, LButton
BlockInput, On
If WinActive(Title) {
Sleep, 300
Send, % St[++n]
if (n>=St.Length())
ExitApp
Send % "{Enter " (n=1? 0: 1) "}"
}
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_FadeDelay 60000"
, "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_maxdecalgroupingradius 400.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_detailFadeDistMax 24000"
, "r_flaresQuality 0", "r_foliageStartFadeDist 20000", "r_foliageSmallFadeDistMax 25000"
, "r_foliageBigFadeDistMax 25000", "r_lightDistanceFadeMultiplier 7", "r_shadowFadeRangeScale 7"
, "r_shadowLODProjectionSizeFactor 0.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
@echo OFF
set VK_LAYER_PATH="" "DOOM;%VK_LAYER_PATH%"
set VK_INSTANCE_LAYERS=VK_LAYER_reshade
@start "" "DOOMx64vk.exe" +devMode_Enable 1 +com_skipIntroVideo 1 +exec DOOMConfig.cfg +com_skipKeyPressOnLoadScreens 1
::========= Set cpuThreshold [%] and memThreshold [according to displayed value in Cmd window] =========
set /a cpuThreshold=19 & set /a memThreshold=1350000
::initialize vars and set process_name:
set /a low=0 & setlocal enableDelayedExpansion & set process_name=DOOMx64vk.exe
set pn=%process_name:.exe=%
::==================================================================
::Launch the App
tasklist | findstr /i %process_name% > nul && start /min "" "easy access to campaign.ahk"
::Get NumberOfCores
for /f "tokens=*" %%f in ('wmic cpu get NumberOfCores /value ^| find "="') do set %%f
:CheckCpuAndMem
set /a process_snapshot=0 & set /a memUsg=0
::CPU
for /f skip^=2^ tokens^=3^ delims^=^" %%p in (
'typeperf "\Process(%pn%)\%% Processor Time" -sc 1') do for /f "tokens=1 delims=." %%a in (
"%%p") do set /a process_snapshot=%%a/%NumberOfCores%
if %process_snapshot% LSS %cpuThreshold% (set /a low+=1) else (set /a low=0)
::Mem
for /f "tokens=5" %%p in (
'tasklist ^|findstr %process_name%') do for /f "tokens=1,2,3 delims=." %%a in ("%%p") do set /a memUsg=%%a%%b%%c/1000
if %memUsg% lss %memThreshold% (set /a low+=1) else (set /a low=0)
::echo feedback
@echo process_snapshot: %process_snapshot%, memUsage: %memUsg%; LowCpuAndMem: %low%
::12 checks (Cpu & Mem) times 3 sec timeout plus processing delay yields ca 30 sec
if %low% GEQ 12 taskkill /F /T /IM %process_name% & goto RUNNING
timeout /t 3
tasklist|findstr %process_name% > nul && GOTO CheckCpuAndMem
:RUNNING
tasklist|findstr %process_name% > nul && (
taskkill /F /T /IM cheatengine-x86_64.exe) & taskkill /F /T /IM Werfault.exe &
exit /b
timeout /t 1
GOTO RUNNING
Wrong! Since we are using the same variable "low" for both thresholds, the game will exit only if both preset values are greater then retrieved values for memory and CPU usage. If you want the game to exit at only one of them fulfilling the condition then you have to separate the variables to e.g.: "lowMem" for memory and "lowCPU" for CPU.tobsto occupied wrote: ↑07 Aug 2020, 08:01from what i understand is if either both or one or the other are below said threshold itll exit the game
Code: Select all
@echo off
cd C:\Program Files\NVIDIA Corporation\NVSMI\
nvidia-smi
pause
Exit /b
Code: Select all
@echo OFF
cd "C:\Program Files\NVIDIA Corporation\NVSMI\"
:GPU
for /f skip^=8^ tokens^=1-3^ delims^=^| %%a in ('"nvidia-smi.exe"') do (
for /f "tokens=1-6 delims= " %%g in ("%%a") do set u=%%g & set v=%%h) & set w=%%j) & (
for /f "tokens=1-3 delims= " %%g in ("%%b") do set x=%%g & set y=%%i) & (
for /f "tokens=1-2 delims= " %%g in ("%%c") do set z=%%g) & goto :breakForLoop
:breakForLoop
rem set /a u+=0 & set /a v+=0 & set /a w+=0 & set /a x+=0 & set /a z+=0
set /a u=u & set /a v=v & set /a w=w & set /a x=x & set /a z=z
echo %u%, %v%, %w%, %x%, %y%, %z%
rem pause
timeout /t 5
goto GPU
Users browsing this forum: No registered users and 29 guests