ckp Posted December 1, 2016 Share Posted December 1, 2016 well that's good news. although i suspect there are others like castle crashers. you can easily handle with a script like i suggested. Quote Link to comment Share on other sites More sharing options...
Massivebasset Posted December 1, 2016 Author Share Posted December 1, 2016 Well if you write it, Id be happy to have it =D Quote Link to comment Share on other sites More sharing options...
ckp Posted December 1, 2016 Share Posted December 1, 2016 one last thing. jut to prove if castle.exe is running twice, can you change the batch file to this below to run before and after to see if the process id matches what see see in task manager a few seconds after starting the game? so, launch the games, wait a few seconds, look at the castle.exe process id and note it down, exit the game, look at log.txt for the first process id that ran and see if they differ. echo %time% >> c:\temp\log.txt tasklist /FI "IMAGENAME eq castle.exe" >> c:\temp\log.txt Quote Link to comment Share on other sites More sharing options...
ckp Posted December 1, 2016 Share Posted December 1, 2016 15 minutes ago, Massivebasset said: Well if you write it, Id be happy to have it =D yeah i'll write in ahk script so you'll need to install free autohotkey. i think it's better that i post it on LB in ahk file form rather than converting to exe because people would need to modify the name of the exe in it, or other settings, to suit what they may need it for. then each user can convert it to exe with their ahk install if they'd rather use it in exe form. Quote Link to comment Share on other sites More sharing options...
ckp Posted December 1, 2016 Share Posted December 1, 2016 tell me the exact full before and after commands to use because they are chopped in the screenshots. Quote Link to comment Share on other sites More sharing options...
Massivebasset Posted December 1, 2016 Author Share Posted December 1, 2016 Yep, different ID. Log.txt shows PID 3176 at the start run of the batch file, and the end batch file run, 1.7s later, shows no tasks. With game up, it was PID 5860 Quote Link to comment Share on other sites More sharing options...
ckp Posted December 1, 2016 Share Posted December 1, 2016 ok, good that this is 100% confirmed the problem. i figured it had to be. that means LB isn't broken Quote Link to comment Share on other sites More sharing options...
Massivebasset Posted December 1, 2016 Author Share Posted December 1, 2016 For what Im trying to do with castle crashers its: Application path: C:\Program Files (x86)\VJoy\VJoy.exe Command line Parameters: -enable 1 -file "c:\program files (x86)\vjoy\castlecrashers.ini" On exit: -enable 0 or -exit Exit kills the program, and is what led me to see that it was executing early as opposed to just not working. Enable 0 leaves Vjoy running but just turns it off, either one works I guess. Quote Link to comment Share on other sites More sharing options...
ckp Posted December 1, 2016 Share Posted December 1, 2016 ok, let me play with it friday or saturday and i'll give you a copy to test out. Quote Link to comment Share on other sites More sharing options...
ckp Posted December 1, 2016 Share Posted December 1, 2016 (edited) Can you try this real quick? Paste the code into notepad and save it as a vbscript file, so like aftercastle.vbs You shouldn't need to install anything for this script. Add this script as your AFTER app. Still keep your existing BEFORE app. I haven't been able to test it, but I think it should work. Let me know. Const strProcessName = "castle.exe" ' line below is set to wait 5 seconds before start checking for process WScript.Sleep 5000 Set oWMISvc = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2") boolRunning = True ' Loop while the process is running Do While boolRunning Set colProc = oWMISvc.ExecQuery("SELECT * FROM Win32_Process WHERE Name='" & strProcessName & "'") boolRunning = False For Each oProc In colProc boolRunning = True Next Set colProc = Nothing WScript.Sleep 500 Loop Set objShell = WScript.CreateObject("WScript.Shell") objShell.Run """C:\Program Files (x86)\VJoy\VJoy.exe""" & "-exit", 1, True Set objShell = Nothing Edit: I meant to say add this vbscript as another BEFORE app (although it would also probably work for your game as an after script too. You might need to add a couple seconds if it doesn't work. Edited December 1, 2016 by ckp Quote Link to comment Share on other sites More sharing options...
Massivebasset Posted December 1, 2016 Author Share Posted December 1, 2016 Looks like that works perfect. Or at least, best I can tell remoting into the arcade machine. Thanks again for all the help! Quote Link to comment Share on other sites More sharing options...
ckp Posted December 2, 2016 Share Posted December 2, 2016 (edited) Here is an autohotkey script to do it. Save the file with .ahk extension and you need to have autohotkey installed. I'll probably use this if I hit your issue. The vbscript is pretty ugly. Note, you could also run your BEFORE app command as the first line of this script if you just want to add one BEFORE app in the game's additional apps tab. Sleep 5000 ; dont start checking for 5 seconds Loop { Process,Exist, castle.exe ; find if the process exists If ( ErrorLevel = 0 ) ; If ErrorLevel is equal to 0 here, this means the process did not exist { Run, C:\Program Files (x86)\VJoy\VJoy.exe -exit Break } Else ; if the process existed when we first checked, restart the loop and check again Sleep 1000 ; you need this so autohotkey does not use up cpu Continue } Edit: You "might" need to wrap the launch of vjoy in quotes like this: "C:\Program Files (x86)\VJoy\VJoy.exe" Edited December 2, 2016 by ckp 1 Quote Link to comment Share on other sites More sharing options...
Smyken Posted May 3, 2017 Share Posted May 3, 2017 Just wanted to say big thanks for clearing this up. Solved all my problems with setting up Street Fighter 5 which starts with 1 exe and then kills it and starts another 3 exe's. The VB script works like a charm Quote Link to comment Share on other sites More sharing options...
8Bitvillain Posted July 20, 2017 Share Posted July 20, 2017 I need to do the for MKX. Can you please tell me what to write? I don't understand scripts. Please, I'd appreciate it! Quote Link to comment Share on other sites More sharing options...
banditdude Posted February 4, 2018 Share Posted February 4, 2018 wanted to reply to this thread saying thats exactly my issue right now as well, launching path of exile makes a few different processes before settling into the final one. it makes having a script killer setup for after closing the game impossible, and unfortunately one of the applications will open several instances of itself if I dont kill the scripts afterwards. Quote Link to comment Share on other sites More sharing options...
danxmanly Posted February 11, 2021 Share Posted February 11, 2021 After trying over and over again to get an ultrastik config file to load AFTER I closed out a Steam game, using the script ckp posted solved my issue. Using the additional app on program start works fine and runs the necessary .ugc file to set my joysticks to act as a mouse, but using the app section within LB to run a .ugc file upon exit to reset my joysticks back to 8-way never would. Old threads do help! Thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.