Jump to content
LaunchBox Community Forums

Countdown to launch a program in the additional Launchbox


daniel6984

Recommended Posts

Posted (edited)

does demulshooter actually care if it is launched before or after a game loads? I literally just used it for the first time the other weekend but for getting two light guns working with The House of the Dead Remake so I'm not sure if it even matters

but to answer your question (in)directly, no, and yes....lol

LB offers a couple options.

1) Run before the main application. So the main application will launch immediately after launching demulshooter. Not what you want

2) Run after the main application exits. Def not what you want.

3) Wait for exit using option #1. Also not really helpful here

 

So the built in options aren't gonna get you there. You would need to use scripting to automate when you want the program to run. For ex

 

SetWorkingDir, C:\Path\to\directory\of\DemulShooterX64	; change this accordingly
WinWait, <GAME WINDOW / WINTITLE HERE>			; enter appropriate window title or AHK WinTitle to detect when game/emulator window exists
Sleep, 10000						; Wait 10 secs to run
Run, DemulShooterX64.exe -target=rpcs3 -rom=de4d	; change "de4d" to proper ROM target if needed
WinWaitClose, <GAME WINDOW / WINTITLE HERE>		; enter appropriate window title or AHK WinTitle to detect when game/emulator window closes
DetectHiddenWindows, On
SetTitleMatchMode, 2
WinClose, ahk_exe DemulShooterX64.exe
Process, Close, DemulShooterX64.exe

 

 

I noticed using the detect hidden windows will make the DemulShooter tray icon go away when using WinClose. Without this and only killing the process leaves a ghost tray icon that only disappears when you hover the mouse pointer over it

Oddly though, WinClose doesn't actually kill the process despite removing the tray icon. So still need to kill the process after closing its non-existent window. Quirky behavior but this is a good workaround

 

Make sure to change to using the right working directory (location of DemulShooterX64.exe), ROM target if that isn't the right game, and use the window title of the game/emulator or it's process. For ex if it's "rpcs3.exe" then you could use (don't  include the quotes) "ahk_exe rpcs3.exe"

 

I just noticed on their GitHub it says it must run in Admin mode?! I sure as hell did not do any extra steps to launch it with admin privileges and it works fine with The House of the Dead Remake. Maybe not required for all games or systems or who knows.  If you do need to run with admin privileges then change the Run line to this. It's just adding that "*RunAs" bit to make it run with admin privileges.

Run, *RunAs DemulShooterX64.exe -target=rpcs3 -rom=de4d

 

when you have it all edited accordingly put it in a text file, save as with file extension .ahk and then use this file as an Additional Application for the game. Enable the checkbox for Run Before Main Application and that should do it

Edited by skizzosjt
Link to comment
Share on other sites

Posted (edited)

 

Hello,

Hello ! thank you very much for your help


@Echo off
timeout /t 10
start "" "C:\Path\to\directory\of\DemulShooter\ DemulShooterX64.exe -target=rpcs3 -rom=de4d

by choosing the option: Executed before the main application. I'm going to look for the .batch file and it worked

 

because if I launch the game first before demulshooter, there is a black screen, same thing if I launch at the same time, hence the fact that I have to wait 10 seconds for the game to load before launching demulshooter.

I keep your AHK on hand in case I have any problems with my .batch

Edited by daniel6984
Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...