jjk73 Posted January 18, 2018 Share Posted January 18, 2018 I have a UCR profile that turns my I-PAC joysticks/buttons into xbox controllers for steam games, and another profile that returns the IPAC to all keyboard commands. UCR has a command line function, and i've tested that I can switch between the 2 profiles with the command X:\ucr\UCR.exe CLI.ahk xbox12 or X:\ucr\UCR.exe CLI.ahk default. I want the first command to run whenever I start a windows game. I found the feature for "Edit AHK Script for windows game", and that seemed to be the answer. I put the following command in there.... run, x:\ucr\startxbox12.bat, x:\ucr . (That bat file just has X:\ucr\UCR.exe CLI.ahk xbox12 in it). I can confirm that this ahk works when I run in directly, and the .bat file works when I run it directly, but the when I launch a game through LaunchBox or BigBox it won't fire. Any thoughts? Quote Link to comment Share on other sites More sharing options...
DOS76 Posted January 19, 2018 Share Posted January 19, 2018 you should try running the .bat as an additional app before the game to do so right click on the game and go to edit then go to the additional apps tab and add the .bat you will see check box options to run before or after you launch the actual game you can also probably set an additional app to run the other .bat to change it back whenever you close out of the game. Quote Link to comment Share on other sites More sharing options...
jjk73 Posted January 19, 2018 Author Share Posted January 19, 2018 I had same thought at first. I just added the .bat to run before each steam game - I have about 15 so not a big deal. Problem is, I can't get the other default.bat to run on exiting the game. The setting for 'automatically run after main application' seems to run at the beginning, not when closing the steam game. so, if I want the default .bat file to run, I'll need to manually add that to the additional applications setting for every other game I run. With MAME and consoles, thats just too many to do. That seems to be the purpose of the emulator based AHK ability. But for some reason, it's not working for me. Quote Link to comment Share on other sites More sharing options...
jjk73 Posted January 19, 2018 Author Share Posted January 19, 2018 Update: I can get the AHK script feature to work for the Retroarch Emulator. It will launch the default.bat file, and restore me to keyboard mode. So, that saves me from needing to find a way to have that .bat run on exiting of steam games. Still not sure why that AHK feature won't work for me running windows/steam games, but so be it. Now on to next issue with this setup. I have the UCR launch with this bat when I first start windows, and run in background. Problem is, first time I launch a steam game through BigBox, it runs the bat and ends up re-launching UCR from scratch. This only happens the first time. Every subsequent time the .bat switches profiles without relaunching UCR. Relaunching is an issue because by the time it finishes loading, the game has loaded, and the game loses focus to the newly relaunched UCR. I think it has something to do with the CLI.AHK that is used by UCR. Code: /* UCR Command line tool The recommended editor for UCR is AHK Studio https://autohotkey.com/boards/viewtopic.php?t=300 */ ; GUID used to control remote instance of UCR UCRguid := "{E97F3D9C-47D5-47EA-92FB-2974647DB131}" ; Get an existing running instance of UCR try remoteUCR := ComObjActive(UCRguid) try parentProfileName = %1% ; First passed parameters defines a root profile name, this can alternatively be a GUID try childProfileName = %2% ; The second parameter is the name of a child profile under the system profile if remoteUCR { ; Change profile if script is already running remoteUCR.ChangeProfileByName(parentProfileName, childProfileName, 0) } else { Run UCR.exe UCR.ahk "%parentProfileName%" "%childProfileName%" } ExitApp I don't know code, but it seems to have something in there that detects if ucr is running or not. so, if I launch UCR myself, first time I run this through BigBox it doesn't realize that UCR is already running. But, after BigBox (re)launches it for me, NOW it will recognize that it is running and just execute the profile switch without a full reload. Thoughts on how to handle? FWIW, this is why I started playing around with the .bat files in the first place - I figured if UCR launched through a .bat on windows startup, and then BigBox launched the same .bat to execute the profile switch, that somehow it would recognize that the UCR was already loaded and not try to reload. That didn't work. 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.