AceEsCloud Posted September 7 Share Posted September 7 I have been having issues with Retro arch picking up the wrong controls because the Mayflash Dolpin bar is always active as a game controller. I only need this device active when I play Wii games though. I created a .bat file that enables the Mayflash Dolphin bar and I want to launch this when I launch any Wii title. Also, when I exit the Wii title I want to launch another .bat file that disables the Mayflash Dolphin bar. I have done this before with a pinball device (pinscape controller) and use a script when launching pinball tables that enables / disables my pinscape controller so I believe I would modify this script to work for this new purpose. I linked this script below. If anyone has any insight on how I would implement something similar for my new purpose please let me know. This is the script I used for visual pinball; *****VP script below***** Run, "C:\Users\Arcade\LaunchBox\Tools\Pinscape disabler\Pinscape_enable.bat - Shortcut.lnk" Sleep, 2000 Run, "C:\Visual Pinball\VPinballX.exe" -minimized -exit -play "%1%" Sleep, 10000 While WinExist("ahk_exe VPinballX.exe") sleep 700 Process, WaitClose, VPinballX.exe Run, "C:\Users\Arcade\LaunchBox\Tools\Pinscape disabler\Pinscape_disable.bat - Shortcut.lnk" WinActivate, ahk_exe LaunchBox.exe WinActivate, ahk_exe BigBox.exe ExitApp *****End script**** If anyone is curious here are the two .bat files I am planning to launch when I launch Wii Games. I created .bat files of these, then created shortcuts of the .bat files and in the shortcut properties I checked "run as administrator". These work GREAT every time, just need to figure out the best way to run when I run Wii titles.... *****Disable Mayflash***** PNPUTIL /disable-device /deviceid "HID\VID_057E&PID_0306&REV_0100&MI_00" PNPUTIL /disable-device /deviceid "HID\VID_057E&PID_0306&REV_0100&MI_01" PNPUTIL /disable-device /deviceid "HID\VID_057E&PID_0306&REV_0100&MI_02" PNPUTIL /disable-device /deviceid "HID\VID_057E&PID_0306&REV_0100&MI_03 *****End .bat file***** *****Enable Mayflash***** PNPUTIL /enable-device /deviceid "HID\VID_057E&PID_0306&REV_0100&MI_00" PNPUTIL /enable-device /deviceid "HID\VID_057E&PID_0306&REV_0100&MI_01" PNPUTIL /enable-device /deviceid "HID\VID_057E&PID_0306&REV_0100&MI_02" PNPUTIL /enable-device /deviceid "HID\VID_057E&PID_0306&REV_0100&MI_03 *****End .bat file***** Quote Link to comment Share on other sites More sharing options...
JoeViking245 Posted September 7 Share Posted September 7 2 hours ago, AceEsCloud said: These work GREAT every time, just need to figure out the best way to run when I run Wii titles.... From what I can see, your VPX 'emulator' is your above AutoHotkey script. So the Emulators Application Path is "path\to\your\VPXscript.ahk". Why not use a modified version of that script to Run Dolphin.exe with its respective parameters and set that as your Nintendo Wii emulator? Though I'm not sure how you're running that elevated. I believe the AHK script needs to be started elevated to Run the batch files shortcut, elevated. I could be wrong. If it doesn't need to be elevated, that makes things a lot easier. Run, "C:\Users\Arcade\LaunchBox\Tools\Mayflash disabler\Mayflash_enable.bat - Shortcut.lnk" Sleep, 2000 RunWait, "C:\Users\Arcade\LaunchBox\Emulators\Dolphin\Dolphin.exe" -b -e "%1%" Run, "C:\Users\Arcade\LaunchBox\Tools\Mayflash disabler\Mayflash_disable.bat - Shortcut.lnk" WinActivate, ahk_exe LaunchBox.exe WinActivate, ahk_exe BigBox.exe ExitApp I removed the Sleep, While WinExist and Process, WaitClose lines and used "RunWait" instead. Less lines. Same outcome. Just change your paths and batch file names, accordingly. 1 Quote Link to comment Share on other sites More sharing options...
AceEsCloud Posted September 7 Author Share Posted September 7 I'll check this out when I get home, thanks for the help. Quote Link to comment Share on other sites More sharing options...
AceEsCloud Posted September 7 Author Share Posted September 7 This works but I need to add an exit command to the script. I used almost exactly what JoeViking245 suggested (with some minor path edits). I compiled the .ahk script to an .exe using the AutoHotkey script compiler. When I compiled I used "v1.1.36.02 U64 Unicode 64-bit.bin" as the base file (in the hotkey script compiler tool). This specific version gives me the elevated permissions and therefore allows the .bat files to run on my system. I figured this out via trial and error working on the Visual Pinball stuff a couple months back. I believe JoeViking helped me with this before as well! Anyways, after compiling I went into launchbox and added a new emulator. Named the new emulator "dolphin with mayflash". I set the application path to be the script file that I compiled (in my case; "C:\Users\Arcade\LaunchBox\Tools\Wii Mayflash Loader\Wii Games Load Script.exe). I also checked the box for "attempt to hide console window on startup/shutdown". I then went to one of my Wii games and changed the emulator to be the new emulator "dolphin with mayflash". Later I will bulk edit all of the Wii games to use this emulator once I get it 100% working. This properly launches the game and enables the Mayflash controller!!! The only issue I now have is that when I hit press escape it does not exit the game so I have to add something to close the game. On a good note when I force close the Wii game it does run the other .bat file and disables the mayflash as it should. What would be the best way to edit this script to allow ESC to exit whatever Wii game I launched? Quote Link to comment Share on other sites More sharing options...
AceEsCloud Posted September 7 Author Share Posted September 7 I believe I got it working by changing it to this; Run, "C:\Users\Arcade\LaunchBox\Tools\Mayflash disabler\Mayflash enabler.bat - Shortcut" Sleep, 2000 RunWait, "C:\Users\Arcade\LaunchBox\Emulators\Dolphin-x64\Dolphin.exe" -b -e "%1%" $Esc:: $vk07:: Send, !{F4} Process, Close, dolphin.exe Run, "C:\Users\Arcade\LaunchBox\Tools\Mayflash disabler\Mayflash disabler.bat - Shortcut" ExitApp Thank JoeViking245 for the help!! 1 Quote Link to comment Share on other sites More sharing options...
JoeViking245 Posted September 7 Share Posted September 7 46 minutes ago, AceEsCloud said: The only issue I now have is that when I hit press escape it does not exit the game Just a guess, maybe Exit is not mapped to Escape in Dolphin. Regardless, your script looks great. And it lets you use the 'Xbox' button (or whatever it's called) to exit as well. To 'play nice' with the emulator, I suggest changing "Process, Close," to "WinClose, ahk_exe dolphin.exe". It's less of an unnecessary brute-force method. But either way will "work". Quote Link to comment Share on other sites More sharing options...
AceEsCloud Posted September 8 Author Share Posted September 8 cant believe I didn't see that, lol. I had tunnel vision. ill check it out 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.