Jump to content
LaunchBox Community Forums

Auto Hotkey for loading xpadder profile


drewjbx
 Share

Recommended Posts

Anyone know how I can use a script to load a default xpadder profile for Daphne for example, then once exiting the game load a blank xpadder profile. This does work with the 'add application' feature on a per game basis like in the pic below. But obviously wanted to see if I can save some time here as there are a couple other situations like this that will take a lot of time doing per game...

 

 

example.png

Link to comment
Share on other sites

The only way I've found to do what you're asking to create a new 'emulator' based off a script.  Something like:

Run, xpadder-load-commandline
RunWait, "path_to_Daphne.exe" %1
Run, blank-load-commandline

And have that Platforms default emulator be the script.

I've only tried something to that affect with Mame and it worked great.  'Worked' (past tense)... actually it still does, but with Mame I can't seem to properly pass "-keyboardprovider" to get the LB Pause Screen to work via the scripted-emu. I think LB need to get that argument 1st hand and it (sorta) can't through a script in this manner.  I have not tested this with any other emulator.  

Link to comment
Share on other sites

1 hour ago, JoeViking245 said:

The only way I've found to do what you're asking to create a new 'emulator' based off a script.  Something like:


Run, xpadder-load-commandline
RunWait, "path_to_Daphne.exe" %1
Run, blank-load-commandline

And have that Platforms default emulator be the script.

I've only tried something to that affect with Mame and it worked great.  'Worked' (past tense)... actually it still does, but with Mame I can't seem to properly pass "-keyboardprovider" to get the LB Pause Screen to work via the scripted-emu. I think LB need to get that argument 1st hand and it (sorta) can't through a script in this manner.  I have not tested this with any other emulator.  

Not sure if I follow create new emulator based off script. Are you putting this script under the emulator auto hotkey option. So in this case wouldn't I need to point to the specific xpadder profile. Also I have profiles associated with the xpadder program (p1.xpadderprofile). So essentially I am not launching xpadder.exe directly.... I'm pointing to the profile, which obviously opens xpadder. In the emulator options there is a tab for 'Running AutoHotKey Script' and 'Exit AutoHotKey Script'

Link to comment
Share on other sites

1 hour ago, drewjbx said:

Are you putting this script under the emulator auto hotkey option.

No.  The "Exit AutoHotkey Script" is only for closing (shutting down) the emulator.  Not sure what the other one does. ?

The alternative to editing each and every game to have a 'launch before' and 'launch after' like what you show in your pict. is to write an AutoHotkey script (or a batch file) that will send the commands that will: 

  • load your xpadder profile
  • run the game (** see note)
  • (then when you exit the game) load the blank profile

Then in LaunchBox go to:

  • Tools
  • Manage Emulators
  • Add

image.thumb.png.63cf354920756f24a324afe20e16ce82.pngGive it a name (like maybe Daphne Xpadder)

Under Application Path, Browse to were you have the AHK or batch file that you created.

Put a check in "Don't use quotes.."

In Associated Platforms tab, add Daphne.

 

**note:  LaunchBox will pass the games name (rom file name) as %1 to the script or batch file.  So if you write an AHK script, this line might look like

RunWait, "D:\Emulators\Daphne\Daphne.exe" %1

Or in a batch file

start /w "" "D:\Emulators\Daphne\Daphne.exe" %1

 

Link to comment
Share on other sites

4 hours ago, JoeViking245 said:

Run, xpadder-load-commandline

RunWait, "path_to_Daphne.exe" %1

Run, blank-load-commandline

Ok so for the script is this the correct syntax for pointing to the profiles needed?

Run, D:\RocketLauncher\Profiles\Xpadder\Daphne\_Default\p1.xpadderprofile

RunWait, D:\Hyperspin\Emulators\Daphne\Daphne.exe %1

Run, D:\RocketLauncher\Profiles\Xpadder\_Default\blank.xpadderprofile

Not at my cabinet at the moment so cant test. Also I have Daphne as an emulator using a Batch file method to launch games. Not sure how this will jive with another script...

Daphne.exe %1 vldp -fullscreen -x 1920 -y 1080 -framefile "D:\Hyperspin\Emulators\Daphne\framefile\%1.txt"

 

Link to comment
Share on other sites

I really don't know anything about the Daphne emu or xpadder.  A quick search looks like to load the profile you need:

"D:\<path_to>\xpadder.exe" "D:\RocketLauncher\Profiles\Xpadder\Daphne\_Default\p1.xpadderprofile" /M

....just reread your comment about using a batch file..... why didn't you say so.. lol

Edit your batch file to read...

start /w "" "D:\<path_to>\xpadder.exe" "D:\RocketLauncher\Profiles\Xpadder\Daphne\_Default\p1.xpadderprofile" /M
start /w "" Daphne.exe %1 vldp -fullscreen -x 1920 -y 1080 -framefile "D:\Hyperspin\Emulators\Daphne\framefile\%1.txt"
start "" "D:\<path_to>\xpadder.exe" "D:\RocketLauncher\Profiles\Xpadder\Daphne\_Default\blank.xpadderprofile" /M

This is assuming that is indeed the command line to apply a profile for xpadder (including the /M).

The "/w" after "start" just says 'wait for it to finish it's thing before going to the next line'.  We put it on the 1st line because without it, line 1 and 2 will load virtually simultaneously and Daphne might kick in before 'it was told' we're using p1'.  Line 3, load profile "blank", won't start until Daphne closes.    For the 2nd line, adding in     start /w ""    you may need to put Daphne.exe in quotes. But nothing else on that line changes.

If that all works, we (or you) can figure out how to hide xpadder command-prompt windows that'll pop up. :) 

Link to comment
Share on other sites

On 6/25/2019 at 5:34 PM, JoeViking245 said:

start /w "" "D:\<path_to>\xpadder.exe" "D:\RocketLauncher\Profiles\Xpadder\Daphne\_Default\p1.xpadderprofile" /M

start /w "" Daphne.exe %1 vldp -fullscreen -x 1920 -y 1080 -framefile "D:\Hyperspin\Emulators\Daphne\framefile\%1.txt"

start "" "D:\<path_to>\xpadder.exe" "D:\RocketLauncher\Profiles\Xpadder\Daphne\_Default\blank.xpadderprofile" /M

Ok so I did try this and at first got an error saying couldn't find Daphne, so I put the full path.

 

start /w "" "D:\RocketLauncher\Profiles\Xpadder\Daphne\_Default\p1.xpadderprofile" /M

start /w "" D:\Hyperspin\Roms\Daphne\Daphne.exe %1 vldp -fullscreen -x 1920 -y 1080 -framefile "D:\Hyperspin\Roms\Daphne\framefile\%1.txt"

start "" "D:\RocketLauncher\Profiles\Xpadder\_Default\blank.xpadderprofile" /M

 

Got an syntax error from Daphne. Want to thankyou thus far but I should have used the emulator AAE as a better example. I tried the following it looks like the games load but just loses focus to command window and when try to bring game up its blank screen. I think I am getting close. If you have suggestions for the one I'm trying below I would appreciate it. Perhaps AHK works better then batch files? or works the same?

AAE doesn't require any command lines to launch... I just need to load a controller profile as the emulator has only default keyboard inputs. 

start /w "" "D:\RocketLauncher\Profiles\Xpadder\AAE\_Default\p1.xpadderprofile" /M

start /w "" D:\Hyperspin\Emulators\AAE\aae.exe %1 "D:\Hyperspin\Roms\AAE\%1.zip"

start "" "D:\RocketLauncher\Profiles\Xpadder\_Default\blank.xpadderprofile" /M

 

Default emulator 

Untitled.png

Batch file emulator

Untitled1.thumb.png.bb9e3d35d3729ffd40532cb113bb0bd7.png

Edited by drewjbx
Link to comment
Share on other sites

Assuming "xpadder.exe" is located in "D:\RocketLauncher\Profiles\Xpadder\", to load a profile you need the run the program and tell it the profile name.  (Also the "/w" might be causing the blank screen issue. So take it out.)

start "" D:\RocketLauncher\Profiles\Xpadder\xpadder.exe "D:\RocketLauncher\Profiles\Xpadder\AAE\_Default\p1.xpadderprofile" /M

 

Did you already have a batch file to start AAE that looked like...? :
D:\Hyperspin\Emulators\AAE\aae.exe %1 "D:\Hyperspin\Roms\AAE\%1.zip"
If it works, great!  But it doesn't need the last part.  The 1st  "%1"  tells it the roms path and filename already.  (On this line, keep "/w" in.)

start /w "" D:\Hyperspin\Emulators\AAE\aae.exe %1

The 'Batch file emulator' pict you show looks fine.  So "AAE Batch.bat" would look like

start "" D:\RocketLauncher\Profiles\Xpadder\xpadder.exe "D:\RocketLauncher\Profiles\Xpadder\AAE\_Default\p1.xpadderprofile" /M
start /w "" D:\Hyperspin\Emulators\AAE\aae.exe %1
start "" D:\RocketLauncher\Profiles\Xpadder\xpadder.exe "D:\RocketLauncher\Profiles\Xpadder\AAE\_Default\blank.xpadderprofile" /M

 

For Daphne, you said you already use a batch file to load/run the games that looked like:
Daphne.exe %1 vldp -fullscreen -x 1920 -y 1080 -framefile "D:\Hyperspin\Emulators\Daphne\framefile\%1.txt"
Adding       start /w ""      in front of it shouldn't (wouldn't?) cause a syntax error.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...