mrl72 Posted January 30, 2020 Share Posted January 30, 2020 I want to call a script every time a game is launched and exited, regardless of what the emulator is. When the game is run, I need the name of the game as an argument passed to the script ie %1 When the game ends I don't need any parameter, just to call a script. So this is not dependent on the actual game. By "script" it can be anything ie autohotkey, python, bat file etc. Can someone tell me how to do this? Note I'm using BigBox. Thanks! Quote Link to comment Share on other sites More sharing options...
Headrush69 Posted January 30, 2020 Share Posted January 30, 2020 LB has LedBlinky support which you can intercept with your AHK script, parse info as needed and do whatever you need to. LB will pass the platform and the game name and the event occurring. So in LB's options for LEDBlinky, set the application to your AHK. Quote Link to comment Share on other sites More sharing options...
mrl72 Posted January 30, 2020 Author Share Posted January 30, 2020 (edited) 32 minutes ago, Headrush69 said: LB has LedBlinky support which you can intercept with your AHK script, parse info as needed and do whatever you need to. LB will pass the platform and the game name and the event occurring. So in LB's options for LEDBlinky, set the application to your AHK. Cool, thanks! I tried that. I set the LEDBlinky path to my .bat file but it's not passing anything other than a number (3 for launch game 4 for exit) for param %1 and nothing for %2. Any ideas what I could be doing wrong? Edited January 30, 2020 by mrl72 Quote Link to comment Share on other sites More sharing options...
Headrush69 Posted January 30, 2020 Share Posted January 30, 2020 (edited) Was this after highlighting a game in LB or starting a game? I tried it yesterday using a compiled AHK and it did pass 3 arguments: command #, platform, and game. Edited January 30, 2020 by Headrush69 Quote Link to comment Share on other sites More sharing options...
mrl72 Posted January 30, 2020 Author Share Posted January 30, 2020 2 minutes ago, Headrush69 said: Was this after highlighting a game in LB or starting a game? I tried it yesterday using a compiled AHK and it did pass 3 arguments: command #, platform, and game. Hah, found it. Looks like LB doesn't like batch files for some reason. I created a small AHK script and pointed the LEDBlinky path to it and now I'm getting the correct params. Thanks again for your help! Quote Link to comment Share on other sites More sharing options...
mrl72 Posted January 30, 2020 Author Share Posted January 30, 2020 (edited) Okay I have this working for the most part with the exception that every time I navigate or click on a game it spawns a dos window which just looks terrible. I've tried with both a .bat and .ahk scripts but the same thing happens. I even tried compiling the AHK script to a .EXE and it does the same thing. Any suggestions? Feel like one step forward two steps back with this. Edited January 30, 2020 by mrl72 Quote Link to comment Share on other sites More sharing options...
Headrush69 Posted January 30, 2020 Share Posted January 30, 2020 Are you properly ending the AHK script? I'm away from my computer but I'm pretty sure I never got a command window opening when calling the AHK exe. I'll double check when I get home. Quote Link to comment Share on other sites More sharing options...
mrl72 Posted January 30, 2020 Author Share Posted January 30, 2020 1 minute ago, Headrush69 said: Are you properly ending the AHK script? I'm away from my computer but I'm pretty sure I never got a command window opening when calling the AHK exe. I'll double check when I get home. I figured it out. I needed to add the Hide parameter to the Run command in AHK. Doh! All looks good now. Cheers! Quote Link to comment Share on other sites More sharing options...
mrl72 Posted January 31, 2020 Author Share Posted January 31, 2020 (edited) The fruits of my labor: Launchbox dynamically controlling LED cabinet light colors based off the game's color scheme. Edited January 31, 2020 by mrl72 Quote Link to comment Share on other sites More sharing options...
Headrush69 Posted January 31, 2020 Share Posted January 31, 2020 Very nice mrl72. Do you have the MAME outputs working too? It's pretty cool being able to control lights based on in-game situations. I just have a few extra LED Buttons I use for pinball on the side of my cabinet, but having them flash blue and red for police lights in game like Chase HQ sure is a cool touch. Quote Link to comment Share on other sites More sharing options...
mrl72 Posted January 31, 2020 Author Share Posted January 31, 2020 (edited) 26 minutes ago, Headrush69 said: Very nice mrl72. Do you have the MAME outputs working too? It's pretty cool being able to control lights based on in-game situations. I just have a few extra LED Buttons I use for pinball on the side of my cabinet, but having them flash blue and red for police lights in game like Chase HQ sure is a cool touch. Thanks! Right now it's just based on the bezels provided by the Bezel Project. So LB/BB passes the info to my script (thanks again for helping me with that). The script reads in the bezel.png and a function determines the dominant color (Ms Pac Man=pink, DigDug=yellow etc). It then passes that color to the LED strip on the back of the cab. Pretty simple really. Next I'll get it working with Steam games, even though they don't have bezels I'll just grab the color palette from some of the artwork in the LB folders. I'd like to see what other in-game things I can do with it though. I have it flashing red whenever a credit is added but I'm using Joy2Key at the moment. I should really use Mame Outputs which I may look at next. What is the best tool for capturing that? MameHooker is the only one I've looked at so far. Edited January 31, 2020 by mrl72 Quote Link to comment Share on other sites More sharing options...
Headrush69 Posted January 31, 2020 Share Posted January 31, 2020 LEDBlinky has a MAMEOutput tester as well. It's quite easy to use. Quote Link to comment Share on other sites More sharing options...
mrl72 Posted January 31, 2020 Author Share Posted January 31, 2020 33 minutes ago, Headrush69 said: LEDBlinky has a MAMEOutput tester as well. It's quite easy to use. Good tip, 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.