nice...shall give it a whirlrommmcek wrote: ↑29 Sep 2020, 15:12tobsto occupied wrote: ↑29 Sep 2020, 08:13not what i need , im talking about setting more than one watch processP.s.: I'm not sure. For that code to work Acm.exe must be running. Once it exits the "TaskKill" commands will be triggered as well as when Werfault.exe appears.Code: Select all
@echo OFF :: set process_name: set process_Acm=ACM.exe & set process_Wer=Werfault.exe ::================================================================== ::Launch the App start "" "Texmod and Game Autolauncher.exe" timeout /t 90 :RUNNING timeout /t 5 tasklist|findstr %process_Wer% > nul && Goto Terminate tasklist|findstr %process_Acm% > nul && Goto RUNNING :Terminate taskkill /F /T /IM "cheatengine-x86_64.exe" & taskkill /F /T /IM "Texmod.exe" & taskkill /F /T /IM "ACM.exe" taskkill /F /T /IM "Texmod and Game Autolauncher.exe" & taskkill /F /T /IM "Werfault.exe" & exit /b
Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off
- tobsto occupied
- Posts: 186
- Joined: 20 Feb 2020, 09:34
- Contact:
Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off
- tobsto occupied
- Posts: 186
- Joined: 20 Feb 2020, 09:34
- Contact:
Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off
update> dont work ...wont exit everything on acm.exe exit and wont on werfault.exe execution aka popup
- tobsto occupied
- Posts: 186
- Joined: 20 Feb 2020, 09:34
- Contact:
Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off
damn ...once i started to read into the batch the hype died instantly lols...but for real im lost as ever thought it was a base gpu batch with me just having to change variables ...goddamned it i aint gonna get nowhere with this , been hitting my head against a brick wall over here and it wont budgetobsto occupied wrote: ↑30 Sep 2020, 04:25finally !!! a starting point i can start to tinker with , wohoo!!! hype!rommmcek wrote: ↑29 Sep 2020, 15:20GPU:
Try to fix this batch (it has similar bug as in your code):Code: Select all
@echo OFF set /a CountDown=66 :RUNNING echo Hi Tobsto, are you free? TimeOut /t 3 set /a CountDown= %CountDown% - 20 echo No, I'm occupied (currently at %CountDown%%) TimeOut /t 3 GOTO RUNNING if %CountDown% Lss 30 GoTo FreeTobsto :FreeTobsto echo Ok, I'm free now, I think I get it! pause & exit /b
What did you not understand?
p.s those links werent helping me...you ok , but me to me the info contained was just mumbo jumbo tbh
- tobsto occupied
- Posts: 186
- Joined: 20 Feb 2020, 09:34
- Contact:
Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off
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_restarted 1 +com_gameMode 1 +com_skipIntroVideo 1 +exec DOOMConfig.cfg 1 +image_usecompression 0 +com_skipKeyPressOnLoadScreens 1
TIMEOUT /t 20
:: set process_name:
set process_name=DOOMx64vk.exe
::=================================================================
::Launch the App
tasklist | findstr /i %process_name% > nul && start /min "" "easy access to campaign.ahk"
cd /D "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
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%
pause
timeout /t 5
goto GPU
if %z% Lss 20 TaskKill /F /im %process_name% & goto RUNNING
set /a CountDown=66
timeout /t 3
GOTO RUNNING
if %CountDown% Lss 30 GoTo GPU
:RUNNING
tasklist|findstr %process_name% > nul &&
taskkill /F /T /IM "cheatengine-x86_64.exe" & taskkill /F /T /IM "Werfault.exe"
set /a CountDown= %CountDown% - 20
timeout /t 1
& exit /b
Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off
These two lines are for exiting.tobsto occupied wrote: ↑30 Sep 2020, 04:48update> dont work ...wont exit everything on acm.exe exit and wont on werfault.exe execution aka popup
Code: Select all
taskkill /F /T /IM "cheatengine-x86_64.exe" & taskkill /F /T /IM "Texmod.exe" & taskkill /F /T /IM "ACM.exe"
taskkill /F /T /IM "Texmod and Game Autolauncher.exe" & taskkill /F /T /IM "Werfault.exe" & exit /b
If it is not present in above lines then it cannot exit, so you have to add the command to do that.
May be there should be added some TimeOut after each TaskKill command...
I cannot test things like these for you!
Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off
tobsto occupied wrote: ↑30 Sep 2020, 07:23damn ...once i started to read into the batch the hype died instantly lols...
So do it and it will work!
why did you uncomment three lines? And note:
Be more precise! Which example was for you just "mumbo jumbo"?
- tobsto occupied
- Posts: 186
- Joined: 20 Feb 2020, 09:34
- Contact:
Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off
all of em wont exit ..none ..niente ..naddarommmcek wrote: ↑02 Oct 2020, 15:58These two lines are for exiting.tobsto occupied wrote: ↑30 Sep 2020, 04:48update> dont work ...wont exit everything on acm.exe exit and wont on werfault.exe execution aka popupWhich process does not exit?Code: Select all
taskkill /F /T /IM "cheatengine-x86_64.exe" & taskkill /F /T /IM "Texmod.exe" & taskkill /F /T /IM "ACM.exe" taskkill /F /T /IM "Texmod and Game Autolauncher.exe" & taskkill /F /T /IM "Werfault.exe" & exit /b
If it is not present in above lines then it cannot exit, so you have to add the command to do that.
May be there should be added some TimeOut after each TaskKill command...
I cannot test things like these for you!
lemme reiterate ...those mentioned lines are indeed bound to running
what i need is for everything in running to be killed IF : ACM.exe exits OR Werfault.exe window pops up
and the last script you posted dont do that matter of fact it wont kill anything , somethings bugged ...
p.s this has nothing to do with not being able to test it for me since you dont have said app
- tobsto occupied
- Posts: 186
- Joined: 20 Feb 2020, 09:34
- Contact:
Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off
all of it lols , but now honestly PLEASE !!!!!!!! help me out on this one shits not a joke no more , im serious h e l p me o u t here , im NOT as experienced nor do i code for shit you shouldve noticed this for months now lols , but serioulsy man help me the fuck out and i mean with a full batch , ive already posted one but that ones obviously containing garbage and dont do shit considering the gpu core threshold feature , fuck ill wait if i have to cause i REALLY need this functionrommmcek wrote: ↑02 Oct 2020, 16:01tobsto occupied wrote: ↑30 Sep 2020, 07:23damn ...once i started to read into the batch the hype died instantly lols...So do it and it will work!why did you uncomment three lines? And note:Be more precise! Which example was for you just "mumbo jumbo"?
- tobsto occupied
- Posts: 186
- Joined: 20 Feb 2020, 09:34
- Contact:
Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off
yep still need help on this my dude shall be waiting no rush but just letting you know im counting on ya , since i need your smarts to get this going , im just way to fucking stupid to figure this out aka a working script , thanks
- tobsto occupied
- Posts: 186
- Joined: 20 Feb 2020, 09:34
- Contact:
Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off
any news? really need this bad my dude , thanks
- tobsto occupied
- Posts: 186
- Joined: 20 Feb 2020, 09:34
- Contact:
- tobsto occupied
- Posts: 186
- Joined: 20 Feb 2020, 09:34
- Contact:
Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off
anybody able to help out here , please somebody
- tobsto occupied
- Posts: 186
- Joined: 20 Feb 2020, 09:34
- Contact:
Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off
common its almost christmas time and nobody wanna help out? please
- tobsto occupied
- Posts: 186
- Joined: 20 Feb 2020, 09:34
- Contact:
Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off
ok so after a long and tedious fiddling and searching this is what ive came up with for the gpu threshold function ...still dont work tho, damn it
also wont kill bottom processes either if game isnt running no more, yeah shits sooo easy to figure out ey
Code: Select all
@echo off
set "_ngpu=nvidia-smi.exe"
set "_prc_name=DevilMayCry5.exe"
set "_2kill=Steam,DMCVTrainer,cheatengine-x86_64,Werfault"
::============================================================
::Launch the App
start "" "steam://rungameid/601150"
TIMEOUT /t 30
tasklist | findstr /i "DevilMayCry5.exe" > nul && start /min "" "DMCVTrainer.exe"
%:^0
timeout/t 30 | echo/Starting Steam ...
tasklist/svc /fo list|find/i "%_prc_name%" >nul || goto %:^0
%:^V
echo/ & call start "" /min "DMCVTrainer.exe"
pushd "C:\Program Files\NVIDIA Corporation\NVSMI"
for /f eol^=^(usebackq^tokens^=10delims^=^|^ %%i in (`
%ComsPec% /v /c "nvidia-smi.exe|find "%%""`)do 2>nul (
.\nvidia-smi.exe ^| find "%%%")do if %%~i lss 20 (
2>nul taskkill/f /im "%_prc_name%">nul && goto %:^)
)else echo\Loop... %%:^^V |timeout/t 3 && goto %:^V
%:^)
popd && for %%i in (%_2kill%)do 2>nul taskkill/f /t /im "%%~i.exe" >nul & (
if /i "%%~i.exe"=="Werfault.exe" (echo\Lopp kill... |timeout /t 3 & goto %:^V )
Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off
Now you came with a whole new code! Why? You didn't provide source!, or is this completely your work?
Why do you try to solve all steps at once. I would go step by step!
We already had a working code for retrieving Gpu usage. It was bulky, because I asked you couple of times wich value is relevant and you answered only once it was written!, but it's easy to shirk it.
Nevertheless alternatives are always good, it inspired me with some new ideas.
Just at the first look of the For /f loop: line break after backquote is a bug! Should be only after opening bracket or after escape character ^. Further below I don't follow any more (I don't know much batch coding), but it seems to me it is unnecessarily complicated (once you have Gpu usage value, you already know what to do - it's the same as for Cpu usage value threshold).
bye!
Why do you try to solve all steps at once. I would go step by step!
We already had a working code for retrieving Gpu usage. It was bulky, because I asked you couple of times wich value is relevant and you answered only once it was written!, but it's easy to shirk it.
Nevertheless alternatives are always good, it inspired me with some new ideas.
Just at the first look of the For /f loop: line break after backquote is a bug! Should be only after opening bracket or after escape character ^. Further below I don't follow any more (I don't know much batch coding), but it seems to me it is unnecessarily complicated (once you have Gpu usage value, you already know what to do - it's the same as for Cpu usage value threshold).
bye!
- tobsto occupied
- Posts: 186
- Joined: 20 Feb 2020, 09:34
- Contact:
Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off
well tbh ive got someone from superuser thats trying to help out lols, but we both me and him are struggling to get a working script as you may see , his redone script actually made stuff worse? lols
as i said i need value Z which is Gpu usage
not sure if youve noticed but im desperate in getting a proper working script here lols...seriously tho
as i said i need value Z which is Gpu usage
not sure if youve noticed but im desperate in getting a proper working script here lols...seriously tho
Last edited by tobsto occupied on 02 Jan 2021, 11:08, edited 1 time in total.
- tobsto occupied
- Posts: 186
- Joined: 20 Feb 2020, 09:34
- Contact:
Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off
btw ive setup ...another thread for this over at it ninja as well
https://www.itninja.com/question/how-to-kill-a-app-once-gpu-usage-is-below-set-threshold-using-a-given-gpu-per-nvidia-smi-in-windows
im gathering all my internet powaz to finally solve this issue ... for someone to solve this issue lols, people dont believe me when i tell them im not a scripter ...well i hope ive proven myself by now
https://www.itninja.com/question/how-to-kill-a-app-once-gpu-usage-is-below-set-threshold-using-a-given-gpu-per-nvidia-smi-in-windows
im gathering all my internet powaz to finally solve this issue ... for someone to solve this issue lols, people dont believe me when i tell them im not a scripter ...well i hope ive proven myself by now
Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off
I don't see superuser link!
Oh, you do code, that's for sure, but if you'll stick with posts without code, seriously, I'm out!!
Oh, you do code, that's for sure, but if you'll stick with posts without code, seriously, I'm out!!
- tobsto occupied
- Posts: 186
- Joined: 20 Feb 2020, 09:34
- Contact:
- tobsto occupied
- Posts: 186
- Joined: 20 Feb 2020, 09:34
- Contact:
Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off
and heres the gpu threshold code that dont work >
which in turn essentially has to be made to work with this script replacing the mem and cpu threshold function with the gpu threshold one>
p.s no need to be so pissy about it , i need your assistance and aint gettin nowhere here, and not sure if youve noticed but YOU are pretty much the only one on the net thats able to make this work , as the links ive linked to should prove so PLEASE help me
Code: Select all
@echo OFF
@start "" "folding.exe"
TIMEOUT /t 20
:: set process_name:
set process_name=folding.exe
::=================================================================
cd /D "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
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%
pause
timeout /t 5
goto GPU
if %z% Lss 20 TaskKill /F /im %process_name% & goto RUNNING
timeout /t 3
:RUNNING
tasklist|findstr %process_name% > nul &&
taskkill /F /T /IM "Werfault.exe" & exit /b
timeout /t 1
GOTO RUNNING
which in turn essentially has to be made to work with this script replacing the mem and cpu threshold function with the gpu threshold one>
Code: Select all
@echo OFF
::========= Set cpuThreshold [%] and memThreshold [according to displayed value in Cmd window] =========
set /a cpuThreshold=10 & set /a memThreshold=450000
::initialize vars and set process_name:
set /a low=0 & setlocal enableDelayedExpansion & set process_name=DevilMayCry5
set pn=%process_name:.exe=%
::==================================================================
::Launch the App
start "" "steam://rungameid/601150"
TIMEOUT /t 30
tasklist | findstr /i %process_name% > nul && start /min "" "DMCVTrainer.exe"
tasklist | findstr /i %process_name% > nul && start /min "" "SSSiyanCollabTU5.CT"
::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 DMCVTrainer.exe & (
taskkill /F /T /IM Steam.exe) & taskkill /F /T /IM Werfault.exe & exit /b
timeout /t 1
GOTO RUNNING
Who is online
Users browsing this forum: Rohwedder and 22 guests