jayjay Posted November 22, 2018 Share Posted November 22, 2018 This is for a per platform ahk script. I know we will get some additional app love at some point. In the mean time I made this simple plugin. It will start a compiled script on game starting event and will close it on game exited event. How to use: Drop the plugin into the plugins folder. Create a new script within Launhbox/Autohotkey/ and compile it. Name the script to exactly the same as you have the platform named in LB. (example: "Nintendo 64" in LB, "Nintendo 64.exe" in the Launchbox/autohotkey/ directory. Iv included the source because if you can compile it, its simple enough to make it work with other apps. Here's an example of loading xpadder: Create a shortcut to xpadder, rename the shortcut to the same as the platform and place it inside, Launchchbox/autohotkey/ directory. namespace PlatformAHK { public class Class1 : ISystemEventsPlugin { private static string selectedGamePlatform; public void OnEventRaised(string eventType) { if (eventType == "GameStarting") { IGame selectedGame = PluginHelper.StateManager.GetAllSelectedGames()[0]; selectedGamePlatform = selectedGame.Platform; string platformAHK = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "AutoHotkey", selectedGamePlatform + ".lnk"); if (File.Exists(platformAHK)) { Process process = new Process(); process.StartInfo.FileName = platformAHK; process.Start(); } } if (eventType == "GameExited") { Process[] Process = System.Diagnostics.Process.GetProcesses(); for (int i = 0; i < Process.Length; i++) { if (Process[i].ProcessName == "Xpadder") { Process[i].Kill(); } } } } } } You only need to change 2 lines: string platformAHK = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "AutoHotkey", selectedGamePlatform + ".lnk"); This line, change the .lnk at the end. if (Process[i].ProcessName == "Xpadder") Obviously change "Xpadder". Include the quotes. Don't add ".exe". PlatFormAHK.zip 1 Quote Link to comment Share on other sites More sharing options...
LegzRwheelz Posted November 14, 2019 Share Posted November 14, 2019 Brilliant alternative to using rocketlauncher Quote Link to comment Share on other sites More sharing options...
NNEMO Posted September 20, 2020 Share Posted September 20, 2020 (edited) What do you change .lnk to? examples This needs to made a feature, we need more additional app multi game editor. Edited September 20, 2020 by NNEMO Quote Link to comment Share on other sites More sharing options...
JoeViking245 Posted September 20, 2020 Share Posted September 20, 2020 With changes that have been made during LaunchBox's evolution since 2 years ago, that whole line of the code ("string platformAHK.....") won't work anyway. You may want to look under Help & Support - Request a Feature and see if there's already a request for this feature and UpVote it. If not, make a new request. 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.