yeps works a charm ...thanks my dude, now onto the gpu issuerommmcek wrote: ↑06 Sep 2020, 10:52Oh, sorry again, superficial reading! Hope "game exits" is right (not "game crashes"). Try:tobsto occupied wrote: ↑30 Aug 2020, 12:51uhhhh no, its supposed to kill Texmod and Werfault ...which happens sometimes, once game exits not the game on startupP.s.: Have increased timeout to check every 5 sec. O.k.? Then be sure TIMEOUT /t 30Code: Select all
. . . TIMEOUT /t 30 :RUNNING timeout /t 5 tasklist|findstr DMC-DevilMayCry.exe > nul && Goto RUNNING taskkill /F /T /IM Texmod.exe & taskkill /F /T /IM Werfault.exe & exit /b
is long enough to load the game, otherwise script will trigger the TaskKill routine and exit!
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
the 66 is the gpu core usage that being the relevant variable, anyhow gimme a sec..rommmcek wrote: ↑06 Sep 2020, 11:05For GPU first just run the code:If the periodical output isn't something like: 41, 52, 181, 4874, 11264, 66, then repeat it with skip^=7^ and so on. Then you can set the condition.Code: Select all
@echo OFF cd /D "C:\Program Files\NVIDIA Corporation\NVSMI\" :GPU for /f skip^=6^ 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
P.s.: I still don't know for sure wich variable is relevant (Probably 4874 for your previous snapshot output)!
- 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 currently skip^=6^ only gives me 6 0s as output , skip^=7^ ...same, but with skip^=8^ i get a proper readout , except the 3rd readout is a 0 the sixth which is the gpu core and all others as well work and show like so :
41, 52, 0, 4874, 11264, 66
41, 52, 0, 4874, 11264, 66
- 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
Try this one (no guessing of load time):
Code: Select all
@echo OFF
:: set process_name:
set process_name=DMC-DevilMayCry.exe
::==================================================================
::Launch the App
start "" "Texmod and Game Autolauncher.exe"
:Loading
timeout /t 5
tasklist|findstr %process_name%> nul && Goto Running
Goto Loading
:RUNNING
timeout /t 5
tasklist|findstr %process_name > nul && Goto RUNNING
taskkill /F /T /IM Texmod.exe & taskkill /F /T /IM Werfault.exe & exit /b
Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off
Was the output really exactly 41, 52, 0, 4874, 11264, 66? Try to comment 10'th line to look like rem set /a u=u & set /a v=v & set /a w=w & set /a x=x & set /a z=z and let me know what is the output, so we can see which number the script grabs (although we actually don't need it, because relevant variable is the last one)!
If the relevant value is "66" then it corresponds with z variable. So you have to set the condition:
Code: Select all
if %z% Lss 40 TaskKill /F /im "My Game.exe"
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
rommmcek wrote: ↑09 Sep 2020, 14:18Try this one (no guessing of load time):Code: Select all
@echo OFF :: set process_name: set process_name=DMC-DevilMayCry.exe ::================================================================== ::Launch the App start "" "Texmod and Game Autolauncher.exe" :Loading timeout /t 5 tasklist|findstr %process_name%> nul && Goto Running Goto Loading :RUNNING timeout /t 5 tasklist|findstr %process_name > nul && Goto RUNNING taskkill /F /T /IM Texmod.exe & taskkill /F /T /IM Werfault.exe & exit /b
ohhhh ...nice , even better! shall try asap
- 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
yeah nope that dont work instant exits the game pretty much , looks like the good ol timer method will be required, ok so the old timer method works BUT it wont exit the Autoit script exe aka Texmod and Game Autolauncher.exe, ive tested this by stealing the focus from the autoit script exe and thus it stops then texmod gets exited but not the autoit exe , this is the current batchfile :
@echo OFF
::initialize vars and set process_name:
set /a low=0 & setlocal enableDelayedExpansion & set process_name=DMC-DevilMayCry.exe
set pn=%process_name:.exe=%
::==================================================================
::Launch the App
start "" "Texmod and Game Autolauncher.exe"
TIMEOUT /t 30
:RUNNING
timeout /t 5
tasklist|findstr DMC-DevilMayCry.exe > nul && (
taskkill /F /T /IM cheatengine-x86_64.exe) & taskkill /F /T /IM Texmod.exe & (
taskkill /F /T /IM Texmod and Game Autolauncher.exe) & exit /b
timeout /t 1
GOTO RUNNING
@echo OFF
::initialize vars and set process_name:
set /a low=0 & setlocal enableDelayedExpansion & set process_name=DMC-DevilMayCry.exe
set pn=%process_name:.exe=%
::==================================================================
::Launch the App
start "" "Texmod and Game Autolauncher.exe"
TIMEOUT /t 30
:RUNNING
timeout /t 5
tasklist|findstr DMC-DevilMayCry.exe > nul && (
taskkill /F /T /IM cheatengine-x86_64.exe) & taskkill /F /T /IM Texmod.exe & (
taskkill /F /T /IM Texmod and Game Autolauncher.exe) & exit /b
timeout /t 1
GOTO RUNNING
- 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
rommmcek wrote: ↑09 Sep 2020, 14:35Was the output really exactly 41, 52, 0, 4874, 11264, 66? Try to comment 10'th line to look like rem set /a u=u & set /a v=v & set /a w=w & set /a x=x & set /a z=z and let me know what is the output, so we can see which number the script grabs (although we actually don't need it, because relevant variable is the last one)!
- 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 am now getting the following output after replacing line 10>
38%, 45C, %j), 2028MiB, 11264MiB, 23%
38%, 45C, %j), 2028MiB, 11264MiB, 23%
- 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
if %z% Lss 40 TaskKill /F /im "My Game.exe"
where does this go? use my doom batchfile as example, thanks
where does this go? use my doom batchfile as example, thanks
Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off
Sorry there were at least two typos (one of them critical)! Try:Other things some other time!
Code: Select all
@echo OFF
:: set process_name:
set process_name=DMC-DevilMayCry.exe
::==================================================================
::Launch the App
start "" "Texmod and Game Autolauncher.exe"
:Loading
timeout /t 5
tasklist|findstr %process_name% > nul && Goto Running
Goto Loading
:RUNNING
timeout /t 5
tasklist|findstr %process_name% > nul && Goto RUNNING
taskkill /F /T /IM Texmod.exe & taskkill /F /T /IM Werfault.exe & exit /b
- 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 worked, but ill use the timer function since i would like for all the apps mentioned to autoclose should the game not be running after a certain amount of time , it works with my mentioned frankenhack that ive conjured up said hack as well autocloses the autoit script exe
, which autocloses any apps launched should mentioned app not be launched in 30 seconds, but i recon i can use this for certain usecases , thanks and no rush ill be lurking in the shadows for the gpu solution , thanks as usual my dude and stay healthy and take care ...till next time
, which autocloses any apps launched should mentioned app not be launched in 30 seconds, but i recon i can use this for certain usecases , thanks and no rush ill be lurking in the shadows for the gpu solution , thanks as usual my dude and stay healthy and take care ...till next time
- 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 i figured out why certain apps like ahk or autoit scripts wouldnt exit you need to add " at the start of the exe and at the end of the .exe as such :
--------------------------------------------------------------
so essentially apps should then by default always be encased with " "
for maximum compatibility for all , works, now all apps besides the game will autoexit if the game isnt running in 30 sec. or will autoexit on game exit ...same thing
of course you can add additional lines that wont even launch certain apps at all without the game running , but in this instance we only got texmod and the autoit autolauncher script exe which we need for the game , would you for example want only a app for example a trainer , Cheat Table etc . be run while the game is running youd add this under Launch App, example:
p.s : ive noticed with certain games that for example with doom 2016 when i launch it the very first time per batch which launches an AHK Script .. the AHK Script wont run BUT once i exit the game and relaunch it then the script works without issues , this is the ahk script:
----------------------------------------------------------
a solution to this odd behaviour for ahk scripts with some games maybe some kind of force flag or something or reloop? thanks in advance
Code: Select all
@echo OFF
:: set process_name:
set process_name=DMC-DevilMayCry.exe
::==================================================================
::Launch the App
start "" "Texmod and Game Autolauncher.exe"
timeout /t 30
:RUNNING
timeout /t 5
tasklist|findstr %process_name% > nul && Goto RUNNING
taskkill /F /T /IM "cheatengine-x86_64.exe" & taskkill /F /T /IM "Texmod.exe" &
taskkill /F /T /IM "Texmod and Game Autolauncher.exe" & taskkill /F /T /IM "Werfault.exe" & exit /b
so essentially apps should then by default always be encased with " "
for maximum compatibility for all , works, now all apps besides the game will autoexit if the game isnt running in 30 sec. or will autoexit on game exit ...same thing
of course you can add additional lines that wont even launch certain apps at all without the game running , but in this instance we only got texmod and the autoit autolauncher script exe which we need for the game , would you for example want only a app for example a trainer , Cheat Table etc . be run while the game is running youd add this under Launch App, example:
Code: Select all
tasklist | findstr /i %process_name% > nul && start "" "DMCVTrainer.exe"
tasklist | findstr /i %process_name% > nul && start "" "SSSiyanCollabTU5.CT"
p.s : ive noticed with certain games that for example with doom 2016 when i launch it the very first time per batch which launches an AHK Script .. the AHK Script wont run BUT once i exit the game and relaunch it then the script works without issues , this is the ahk script:
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
WinActivate, % Title
WinWaitActive, % Title,, 30
;Sleep, 3000 ; you said 30 sec. ???
Sleep, 30000 ; 30 sec. ; unclear!!!
ControlSend,, {Enter}, % Title ; alternative that works even if cmd is not
sleep, 300
ControlSend,, {Enter}, % Title ; alternative that works even if cmd is not
sleep 300
ControlSend,, {Enter}, % Title ; alternative that works even if cmd is not
ExitApp
a solution to this odd behaviour for ahk scripts with some games maybe some kind of force flag or something or reloop? thanks in advance
Last edited by gregster on 10 Sep 2020, 00:57, edited 1 time in total.
Reason: Added code tags to another wall of text... again. :-]
Reason: Added code tags to another wall of text... again. :-]
- 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
@Mod and yet again i thanks , my bad man gotta get used to abit of formatting i recon lols
Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off
To exit after 1 minute (60 sec) if game isn't loaded at all try:
Code: Select all
@echo OFF
:: set process_name:
set process_name=DMC-DevilMayCry.exe
::==================================================================
::Launch the App
start "" "Texmod and Game Autolauncher.exe"
:Loading
timeout /t 5 & set /a LoadTime+= 5
if LoadTime Geq 60 Goto Running
tasklist|findstr %process_name% > nul && Goto Running
Goto Loading
:RUNNING
timeout /t 5
tasklist|findstr %process_name% > nul && Goto RUNNING
taskkill /F /T /IM Texmod.exe & taskkill /F /T /IM Werfault.exe & exit /b
Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off
GPU:
1. Grab relevant variable value
2. Use the condition to exit the game or
3. Repeat this after small timeout
Write the code and post it!
P.s.: 38%, 45C, %j), 2028MiB, 11264MiB, 23% is pretty strange. To say more about it you should repeat the test and post the fresh GPU info snippet too (taken soon after first test).
1. Grab relevant variable value
2. Use the condition to exit the game or
3. Repeat this after small timeout
Write the code and post it!
P.s.: 38%, 45C, %j), 2028MiB, 11264MiB, 23% is pretty strange. To say more about it you should repeat the test and post the fresh GPU info snippet too (taken soon after first test).
Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off
The script waits up to 30 sec for DOOMx64vk ahk_exe DOOMx64vk.exe to exist, then once again 30 sec to become active. May be is this what's bothering you...tobsto occupied wrote: ↑09 Sep 2020, 23:06p.s : ive noticed with certain games that for example with doom 2016 when i launch it the very first time per batch which launches an AHK Script .. the AHK Script wont run BUT once i exit the game and relaunch it then the script works without issues , this is the ahk script:
- 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
nope ...instant exit after a few seconds of loading up ...game hasnt even started lolsrommmcek wrote: ↑15 Sep 2020, 13:11To exit after 1 minute (60 sec) if game isn't loaded at all try:Code: Select all
@echo OFF :: set process_name: set process_name=DMC-DevilMayCry.exe ::================================================================== ::Launch the App start "" "Texmod and Game Autolauncher.exe" :Loading timeout /t 5 & set /a LoadTime+= 5 if LoadTime Geq 60 Goto Running tasklist|findstr %process_name% > nul && Goto Running Goto Loading :RUNNING timeout /t 5 tasklist|findstr %process_name% > nul && Goto RUNNING taskkill /F /T /IM Texmod.exe & taskkill /F /T /IM Werfault.exe & exit /b
- 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
no what my issue is no matter how long i wait the ahk wont do what its supposed to do , only AFTER i exit the game and relaunch it again does the ahk script work proper thats my issue hererommmcek wrote: ↑15 Sep 2020, 13:27The script waits up to 30 sec for DOOMx64vk ahk_exe DOOMx64vk.exe to exist, then once again 30 sec to become active. May be is this what's bothering you...tobsto occupied wrote: ↑09 Sep 2020, 23:06p.s : ive noticed with certain games that for example with doom 2016 when i launch it the very first time per batch which launches an AHK Script .. the AHK Script wont run BUT once i exit the game and relaunch it then the script works without issues , this is the ahk script:
Who is online
Users browsing this forum: No registered users and 21 guests