Jump to content
LaunchBox Community Forums

Auto Hotkey Scripts


Lordmonkus

Recommended Posts

Also for example, i have all ps3 games on an external hard drive, i would like that when starting a ps3 game you would see a screen that says, insert this device and press a key to continue, how can this be done? Need to change the startup screen?

Link to comment
Share on other sites

41 minutes ago, Sbaby said:

Need to change the startup screen?

You can do that as a sort of reminder, but it won't (can't) keep the game from continuing to load.

As for "the best way", that's a loaded question. lol  It sounds like you need it based on your emulators for Wii and PS3.  The Running AutoHotkey Script in the emu's setup only run 'in conjunction' with loading a game.  So like the Startup Screens, it can't keep the game from loading.

(unless someone has a better idea [which happens a lot]) To accomplish what you want, you could could create an AHK script as your emulator(s).  You'd need to create a new emulator in LB and point to this new script as the executable.

The script would 1st popup a splash screen saying something like "Dude! Don't forget to turn on your Wiimote!! Press a button when you're ready."

Then when it detects a button press, it passes the command for the actual emulator and the game [to load] it got from LB.

But I don't know if AHK can "detect" a button press from a Wiimote.  I know it can from an Xbox 360 controller (and of course, a keyboard).

 

If it's only needed on a game-game-basis, something quick and dirty, fairly crude, but affective... is to create a batch file and add it as an additional app to the game.  Set it to Automatically Run Before Main Application, and also, Wait for exit.  The issue is you'll need to also turn off the loading (startup) screen for the game because the message will get lost behind it.

@echo off
start "" /w cmd /c "echo Dude! Don't forget to turn on your Wiimote!!.!&echo(&pause"

image.thumb.png.a60b5160cc9544c2ea7bf07c6738f4b0.png

But again, not sure it can detect a Willmote button press, either.

Link to comment
Share on other sites

3 hours ago, JoeViking245 said:

But I don't know if AHK can "detect" a button press from a Wiimote.  I know it can from an Xbox 360 controller (and of course, a keyboard).

Wii Motes on the PC are acting as a mouse, so should be able to use mouse functions.

There was an app called somthing like wiihotkey, it should still be on the autohotkey forums somewhere, that enabled a lot of functions to be mapped to the wiimote, not sure if its still about, but that may work if you can find it, and would be easy to run from an ahk before the emu is run.. (don't quote me on it, its been a long time since i used that app, and may not do exactly as you want.)

Link to comment
Share on other sites

@Sbaby  To add a "new Emulator" that uses an AutoHotkey script, first you need the script. (this is a bit better method than the silly batch file above ;)) I'll use Nintendo Wii as an example and Dolphin as the emulator. 

#SingleInstance force
MsgBox, , Hey you..., Plug in your Wiimote, then hit Enter
Run, "D:\Emulators\Dolphin\Dolphin.exe" -b -e "%1%"

The only lame thing is you still have to hit Enter on the keyboard because I don't have a Wiimote to test @MadK9's suggestion.  (which maybe pointing the 'mote at "OK" and pressing a button will work like a mouse click.?.)

image.png.2967ddbc961dc629608df44423e36e03.png

Creating the script:

Create a new text file and copy\paste the above code into it. On the last line, adjust the path to "Dolphin.exe" accordingly.  Keep the quotes at the beginning and end of the full_path.  Save the file to somewhere convenient (in the Dolphin folder might be a good place).  Name the file to whatever you want, but change the file extension from ".txt" to ".ahk".    i.e. "WiiMessage.ahk"  Be sure that it's not "WiiMessage.ahk.txt".

Add the "new" Emulator:

  • In LaunchBox, click Tools and select Manage Emulators.     
  • Click Add...   
  • Under Emulator Name:, give it a name.  Say something like "Wii Message".    
  • Where it says Emulator Application Path: click Browse and navigate to and select  ../LaunchBox/ThirdParty/AutoHotkey/AutoHotkey.exe 
  • Where it says Default Command-Line Parameters:, type in the full path to where you saved the file you created above. And put quotes around it.    
    • i.e.  "D:\Emulators\Dolphin\WiiMessage.ahk"    
  • Leave all boxes unchecked.
  • The Sample Command-Line should look like    
    • AutoHotkey.exe "D:\Emulators\Dolphin\WiiMessage.ahk" "FULL\PATH\TO\ROM\FILE"    
  • Click on the Associated Platforms tab.    
  • In the Associated Platform cell, type in the name of your Platform EXACTLY as spelled, including upper and lowercase letters. As you start to type, you should see a combobox in which you can select the proper Platform.        
  • Check the box for Default Emulator.  It'll ask something like 'You sure?' and 'Do you want to make this the default for games in this Platform'.  Yes.    
    • This will make all games in that Platform  (Nintendo Wii) use this "new" emulator.
  • Click on the Startup Screen tab
  • Uncheck Enable Game Startup Screen  (otherwise the message box gets lost behind it)
  • Click OK.  Click Close.    

Play games.

For your PS3, follow the same steps, changing the path to the emulator and its command line parameters in the script.  Oh ya, probably change the message too. ;) 

 

Alternative to a Message Box (and a bit more stylish)

If you want to display an image [file] instead of the message box (such as an image of the Wiimote [hint, hint]), you can alter the script to something like this:

#SingleInstance force
Image = D:\LaunchBox\Images\Platforms\Nintendo Wii\Device\WiiController.png
Emulator = "D:\Emulators\Dolphin\Dolphin.exe" -b -e

SplashImage,%Image%,b
Input, SingleKey, L1
SplashImage,off
Run, %Emulator% "%1%"
ExitApp

1Joy1::
SplashImage,off
Run, %Emulator% "%1%"
ExitApp

Change the path to the Image and to the Emulator.  Note: NO quotes for the Image path.  But DO ADD quotes for the emulator path (but not any command line parameters after the path)

Using this script, you can keep the games Startup Screens enabled as this image will stay on top.

This script will display the Image until you hit a key on the keyboard OR press "A" on your Xbox controller (or whatever Xinput controller you have and whatever Button "1" is on it).  After hitting the anykey or pressing A, it will THEN run the emulator/game.

Link to comment
Share on other sites

thanks to @MadK9 and thanks to @JoeViking245. I tried with the splash image and it works. It's really great and you were really kind to explain so well. Thank you very much. :)

I only have this request:

An option to go back to the launchbox or to choose between real wiimote and emulated wiimote, during the splashscreen, that is: if you have connected the wiimote press this button to start the game, if you do not have the wiimote press this other to start game with joypad, press this to return to launchbox without starting the game.


I have already created two scripts that can start the config files for dolphin with a WiimoteNew.ini file for the real wiimote and another WiimoteNew.ini file for the emulated wiimote.

Edited by Sbaby
Link to comment
Share on other sites

1 hour ago, Sbaby said:

Thank you very much.

You welcome.

1 hour ago, Sbaby said:

An option to go back to the launchbox or to choose between real wiimote and emulated wiimote

So, you want to use LaunchBox to launch a Menu that will either launch game_config-A, or game_config-B, or exit back to LB?  Almost sounds counterintuitive for LB's intended purpose. 

How about just setup a couple "new" emulators?

Have one load your "WiimoteNew[real].ini" configuration and another that loads "WiimoteNew[emulated].ini".  Assuming you're doing this with a command line parameter (I don't know how to do that with Dolphin).  Set your default emulator to the one that loads the real Wiimote.  Then in LaunchBox, double click the game to load [real], or right click and select Launch With and choose  [emulated].

 

Otherwise, you can always add whatever you want to happen, into the above script.

Spoiler


#SingleInstance force
Image = D:\LaunchBox\Images\Platforms\Nintendo Wii\Device\WiiController.png
EmulatorReal = "D:\Emulators\Dolphin\Dolphin.exe" -b -e -LoadReal.ini
EmulatorEmulated = "D:\Emulators\Dolphin\Dolphin.exe" -b -e -LoadEmulated.ini

SplashImage,%Image%,b
Input, SingleKey, L1
SplashImage,off
Run, %EmulatorReal% "%1%"
ExitApp


1Joy1::
$r::
{
  SplashImage,off
  Run, %EmulatorReal% "%1%"
  ExitApp
}

1Joy2::
$e::
{
  SplashImage,off
  Run, %EmulatorEmulated% "%1%"
  ExitApp
}

1Joy3::
$x::
{
  SplashImage,off
  ExitApp
}

Here, pressing [Xbox controller] button "A" OR "r" on your keyboard will run whatever the command you put for "EmulatorReal" (line #3)

Pressing button "B" or "e" on your keyboard will run "EmulatorEmulated".

Pressing button "X" or "x" on your keyboard will return you back to LB.

And then whatever image you use for your splash screen will need to explain what's, what.  May want a functioning command line as well. ;) 

 

Link to comment
Share on other sites

11 minutes ago, JoeViking245 said:

You welcome.

So, you want to use LaunchBox to launch a Menu that will either launch game_config-A, or game_config-B, or exit back to LB?  Almost sounds counterintuitive for LB's intended purpose. 

How about just setup a couple "new" emulators?

Have one load your "WiimoteNew[real].ini" configuration and another that loads "WiimoteNew[emulated].ini".  Assuming you're doing this with a command line parameter (I don't know how to do that with Dolphin).  Set your default emulator to the one that loads the real Wiimote.  Then in LaunchBox, double click the game to load [real], or right click and select Launch With and choose  [emulated].

 

Otherwise, you can always add whatever you want to happen, into the above script.

  Reveal hidden contents

 

 

#SingleInstance force
Image = D:\LaunchBox\Images\Platforms\Nintendo Wii\Device\WiiController.png
EmulatorReal = "D:\Emulators\Dolphin\Dolphin.exe" -b -e -LoadReal.ini
EmulatorEmulated = "D:\Emulators\Dolphin\Dolphin.exe" -b -e -LoadEmulated.ini

SplashImage,%Image%,b
Input, SingleKey, L1
SplashImage,off
Run, %EmulatorReal% "%1%"
ExitApp


1Joy1::
$r::
{
  SplashImage,off
  Run, %EmulatorReal% "%1%"
  ExitApp
}

1Joy2::
$e::
{
  SplashImage,off
  Run, %EmulatorEmulated% "%1%"
  ExitApp
}

1Joy3::
$x::
{
  SplashImage,off
  ExitApp
}

Here, pressing [Xbox controller] button "A" OR "r" on your keyboard will run whatever the command you put for "EmulatorReal" (line #3)

Pressing button "B" or "e" on your keyboard will run "EmulatorEmulated".

Pressing button "X" or "x" on your keyboard will return you back to LB.

And then whatever image you use for your splash screen will need to explain what's, what.  May want a functioning command line as well. ;) 

 

yes, I know the "right click and select Launch With" option but unfortunately it's only in launchbox and not in bigbox.

I like your autohotkey script but, considering that I am forced to disable the pause screen, how can I continue the script inside the game to make pressing a joypad key for quit dolphin?

Usually in the emulator configuration I can use this:

 

; for exit with one press of XBOX Guide Button
$ vk07 ::
Process, Close, {{{StartupEXE}}}

Process, Close, Dolphin.exe

 

I tried to insert it in the script, or in the configuration of the launchbox emulator but in no way it works

Link to comment
Share on other sites

9 minutes ago, Sbaby said:

it's only in launchbox and not in bigbox.

Ahhh... that's a whole 'nother story.  For BigBox, I think you need to select the game, and THEN choose Launch With... .  

 

13 minutes ago, Sbaby said:

I am forced to disable the pause screen

Ya. Didn't think about that.  In that regards, you're out'a luck. (more below)  But if you ONLY needed the splash screen as your "reminder" to plug in your controller, before actually launching the game and didn't need to assign any Buttons as hotkeys, you could use RunWait.  This would keep the "emulator" running, thus making the Pause menu and the Running Script active/available.

Spoiler


#SingleInstance force
Image = D:\LaunchBox\Images\Platforms\Nintendo Wii\Device\WiiController.png
Emulator = "D:\Emulators\Dolphin\Dolphin.exe" -b -e

SplashImage,%Image%,b
Input, SingleKey, L1
SplashImage,off
RunWait, %Emulator% "%1%"
ExitApp

 


14 minutes ago, Sbaby said:

how can I continue the script inside the game to make pressing a joypad key for quit dolphin?

Because you're assigning Buttons for your 'menu' that are also used in game, you can't.  You'll need to have another script.  Otherwise when you press "A" to jump,  it would also try to start another instance of the emulator.  Putting the Exit script code in the Running Script for your "WiiMessage.ahk" Emulator doesn't work because the script exits right after launching the game.

Another script:

"ExitDolphin.ahk"

$ vk07::
{
  WinClose, ahk_exe dolphin.exe
  ExitApp
}

And then in the prior script under the Button presses that launch the game, add in 2nd "Run" line:

1Joy1::
SplashImage,off
Run, %Emulator% "%1%"
Run, "D:\LaunchBox\ThirdParty\AutoHotkey\AutoHotkey.exe" "D:\Emulators\Dolphin\ExitDolphin.ahk"
ExitApp

This still doesn't help with the Pause menu.  But I'm confident that with enough scripts calling each other, I KNOW it can be made to look like "it was all part of the plan". lol  

Link to comment
Share on other sites

Could't you use #IfWinExist to limit the hotkey to only working when the splashscreen was showing? - and then it will jump in game and select on splashimage?

That way could use RunWait and not have to call another ahk, and in theory the pause screens would work as well

https://www.autohotkey.com/docs/commands/_IfWinActive.htm is the documentation for it - Sorry not able to actually look at it or try it myself this end for a few days, and knowing @JoeViking245 skill level I imagine it will be sorted before I get to look at it.

However if it won't work then feel free to ignore it.

Cheers

Edited by Kiinkyfoxx
  • Like 1
Link to comment
Share on other sites

5 hours ago, Kiinkyfoxx said:

limit the hotkey to only working when the splashscreen was showing?

As Homer J. Simpson would say, DOH!!!

#SingleInstance force
Image = D:\LaunchBox\Images\Platforms\Nintendo Wii\Device\WiiController.png
EmulatorReal = "D:\Emulators\Dolphin\Dolphin.exe" -b -e -LoadReal.ini
EmulatorEmulated = "D:\Emulators\Dolphin\Dolphin.exe" -b -e -LoadEmulated.ini

SplashImage,%Image%,b,,,MySplash

$vk07::
{
  WinClose, ahk_exe dolphin.exe
  Return
}

#IfWinExist MySplash
{
   1Joy1::
   $r::
   {
     SplashImage,off
     RunWait, %EmulatorReal% "%1%"
     ExitApp
   }

   1Joy2::
   $e::
   {
     SplashImage,off
     RunWait, %EmulatorEmulated% "%1%"
     ExitApp
   }

   1Joy3::
   $x::
   {
     SplashImage,off
     ExitApp
   }
}

Thank you @Kiinkyfoxx!!  Sad thing is, I use that in my daily script that runs in the background.  But you know.. Out of sight. Out of mind.  lol

Link to comment
Share on other sites

5 hours ago, JoeViking245 said:

As Homer J. Simpson would say, DOH!!!

#SingleInstance force
Image = D:\LaunchBox\Images\Platforms\Nintendo Wii\Device\WiiController.png
EmulatorReal = "D:\Emulators\Dolphin\Dolphin.exe" -b -e -LoadReal.ini
EmulatorEmulated = "D:\Emulators\Dolphin\Dolphin.exe" -b -e -LoadEmulated.ini

SplashImage,%Image%,b,,,MySplash

$vk07::
{
  WinClose, ahk_exe dolphin.exe
  Return
}

#IfWinExist MySplash
{
   1Joy1::
   $r::
   {
     SplashImage,off
     RunWait, %EmulatorReal% "%1%"
     ExitApp
   }

   1Joy2::
   $e::
   {
     SplashImage,off
     RunWait, %EmulatorEmulated% "%1%"
     ExitApp
   }

   1Joy3::
   $x::
   {
     SplashImage,off
     ExitApp
   }
}

Thank you @Kiinkyfoxx!!  Sad thing is, I use that in my daily script that runs in the background.  But you know.. Out of sight. Out of mind.  lol

Now I can reactivate pause screen and I don't need to enter $vk07 as it is the key that already takes me to the default launchbox exit menu, i only put keyboard esc for convenience.

Now my configuration is this:

 

SplashImage,%Image%,b,,,MySplash

$Esc::
{
  WinClose, ahk_exe dolphin.exe
  Return
}

#IfWinExist MySplash
{
   1Joy1::
   $1::
   {
     SplashImage,off
     RunWait, %EmulatorReal% "%1%"
     ExitApp
   }

   1Joy4::
   $2::
   {
     SplashImage,off
     RunWait, %EmulatorEmulated% "%1%"
     ExitApp
   }

   1Joy2::
   $3::
   {
     SplashImage,off
     ExitApp
   }
}
 

Works but I only have two problems:

Problem n.1: if the configured buttons are the same as in the launchbox, a conflict occurs, they give input to ahk and also to launchbox. That's why I didn't enter 1joy3, this key starts launchbox's first dolphin emulator together with the second one which is dolphinahk.

Problem n.2: I don't know how to enter the command line to start the two different configurations of dolphin to change the boot between EmuWiimote and RealWiimote, than what changes is the Dolphin \ User \ Config \ WiimoteNew.ini file. Inside the string if Source = 1 is EmuWiimote, if Source = 2 RealWiimote. How can I start one or the other with Dolphin? what is the exact command line?

 

 

thanks and

ps: sorry for my bad english, google translator XD

Link to comment
Share on other sites

1 hour ago, Sbaby said:

I don't need to enter $vk07 as it is the key that already takes me to the default launchbox exit menu

Ah. Good point!. :) And now that you mention it, the $Esc method could go in the Running Script tab for this "emulator" now.

1 hour ago, Sbaby said:

Problem n.1: if the configured buttons are the same as in the launchbox

And BigBox too. ;)  The issue here is the AHK script, though is 'running', it doesn't have actual "focus". The SplashImage does, but not the script (which is the "Emulator" BigBox is looking out for).  So (I think) what happens is, if you wait until after the Startup Screen goes away (like the time it takes to plug in a different controller) to press a button, the script 'catches' the button press (and acts accordingly).  But so does BB.  So ya, you'll want to chose a different button.

1 hour ago, Sbaby said:

Problem n.2: I don't know how to enter the command line to start the two different configurations of dolphin

On 10/6/2021 at 2:44 PM, JoeViking245 said:

(I don't know how to do that with Dolphin).

I don't think there's a way to do that with Dolphin.  I assumed you had that figured out for us already. lol

 

So... didn't this start out as something like 'before a game starts, show a message to remind you to do something. Then press a button to continue.'?  lol

 

You might try looking for where Dolphin saves 'the default controller config to load' info if the game doesn't specify a specific configuration.  (possibly WiimoteNew.ini?? under /User/Config/ ??).  Then once you find that file(?), Run Dolphin, set you controller settings for "real" and quit Dolphin.  Copy that file you found to something like wiiReal.ini (or whatever).  Run Dolphin again, set it up for "emulated", and exit.  Copy and save that same file to wiiEmulated.ini (or whatever).  So now you have  3  4 files:

  1. WiimoteNew.ini (if that is truly the correct file)
  2. wiiReal.ini (or whatever)
  3. wiiEmulated.ini (or whatever)
  4. WiimoteNew.ini.backup (back up the original just in case ;)

Then in your script, right before RunWait, add in a command that will (if you want "Real") Copy wiiReal.ini to WiimoteNew.ini, and overwrite it.

FileCopy, D:\myFileLocation\wiiReal.ini, D:\myFileLocation\WiimoteNew.ini, 1

("1" tells it "YES" to overwrite)

Again, I have no idea if that's the correct file or not!  Also, if your game(s) have a 'default' controller profile to load, you will need to remove that.  (Right click the game, select Properties, click on the Editor tab, and under User Config.

image.png.6c03d7d26aaeba8bb11cc90e48512a49.png

Placing a pound symbol ( # ) at the beginning on the line (as shown) will comment it out (so it won't load). Or you can just delete the whole line.  If you set it up for more than one player, do that for each "WiimoteProfile" line.

Good luck. :D

Link to comment
Share on other sites

21 hours ago, JoeViking245 said:

Ah. Good point!. :) And now that you mention it, the $Esc method could go in the Running Script tab for this "emulator" now.

And BigBox too. ;)  The issue here is the AHK script, though is 'running', it doesn't have actual "focus". The SplashImage does, but not the script (which is the "Emulator" BigBox is looking out for).  So (I think) what happens is, if you wait until after the Startup Screen goes away (like the time it takes to plug in a different controller) to press a button, the script 'catches' the button press (and acts accordingly).  But so does BB.  So ya, you'll want to chose a different button.

I don't think there's a way to do that with Dolphin.  I assumed you had that figured out for us already. lol

 

So... didn't this start out as something like 'before a game starts, show a message to remind you to do something. Then press a button to continue.'?  lol

 

You might try looking for where Dolphin saves 'the default controller config to load' info if the game doesn't specify a specific configuration.  (possibly WiimoteNew.ini?? under /User/Config/ ??).  Then once you find that file(?), Run Dolphin, set you controller settings for "real" and quit Dolphin.  Copy that file you found to something like wiiReal.ini (or whatever).  Run Dolphin again, set it up for "emulated", and exit.  Copy and save that same file to wiiEmulated.ini (or whatever).  So now you have  3  4 files:

  1. WiimoteNew.ini (if that is truly the correct file)
  2. wiiReal.ini (or whatever)
  3. wiiEmulated.ini (or whatever)
  4. WiimoteNew.ini.backup (back up the original just in case ;)

Then in your script, right before RunWait, add in a command that will (if you want "Real") Copy wiiReal.ini to WiimoteNew.ini, and overwrite it.

FileCopy, D:\myFileLocation\wiiReal.ini, D:\myFileLocation\WiimoteNew.ini, 1

("1" tells it "YES" to overwrite)

Again, I have no idea if that's the correct file or not!  Also, if your game(s) have a 'default' controller profile to load, you will need to remove that.  (Right click the game, select Properties, click on the Editor tab, and under User Config.

image.png.6c03d7d26aaeba8bb11cc90e48512a49.png

Placing a pound symbol ( # ) at the beginning on the line (as shown) will comment it out (so it won't load). Or you can just delete the whole line.  If you set it up for more than one player, do that for each "WiimoteProfile" line.

Good luck. :D

Great, almost everything works :) The two ini files overwrite perfectly and start correctly. WiimoteNew.ini decides between real and emulated, while Dolphin.ini decides the autodetection of the wiimote controller and works as on the real wii

 

Some things that don't work are:

1) Splashimage, despite being 1920x1080 does not cover part of the Windows toolbar. The horizontal toolbar disappears but you see that the image doesn't cover that part of the bigbox

2) I tried to insert a confirmation of choice with another loading image that works as a startup over the startup of Dolphin for 3 seconds but unfortunately it does not work, what should I do? Emulator start after

3) Most of the buttons conflict with those of bogbox, I would like to replace 1Joy1 and 1Joy4 with the left and right directional buttons of the joystick but I can't find the command line, what is it?

This is my current script:

 

#SingleInstance force
Image = M:\Giochi\Utility\Launchbox\ThirdParty\AutoHotkey\Scripts\Wii-Dolphin-Scripts\wiihotkey_image.png
EmulatorReal = "M:\Giochi\Emulatori\Nintendo Wii\Dolphin.exe" -b -e
EmulatorEmulated = "M:\Giochi\Emulatori\Nintendo Wii\Dolphin.exe" -b -e

SplashImage,%Image%,b,,,MySplash

#IfWinExist MySplash
{
   1Joy1::
   $Left::
   {
    FileCopy, M:\Giochi\Emulatori\Nintendo Wii\User\Config\WiimoteNew.in#real, M:\Giochi\Emulatori\Nintendo Wii\User\Config\WiimoteNew.ini, 1
    FileCopy, M:\Giochi\Emulatori\Nintendo Wii\User\Config\Dolphin.in#_scan_true, M:\Giochi\Emulatori\Nintendo Wii\User\Config\Dolphin.ini,1
     SplashImage,off
SplashImage, M:\Giochi\Utility\Launchbox\ThirdParty\AutoHotkey\Scripts\Wii-Dolphin-Scripts\ImageRealWiimote.png, on
Sleep 3000
SplashImage,off
MouseMove, 1920, 1080
     RunWait, %EmulatorReal% "%1%"
     ExitApp
   }

   1Joy4::
   $Right::
   {
    FileCopy, M:\Giochi\Emulatori\Nintendo Wii\User\Config\WiimoteNew.in#360emu, M:\Giochi\Emulatori\Nintendo Wii\User\Config\WiimoteNew.ini,1
   FileCopy, M:\Giochi\Emulatori\Nintendo Wii\User\Config\Dolphin.in#_scan_false, M:\Giochi\Emulatori\Nintendo Wii\User\Config\Dolphin.ini,1
     SplashImage,off
SplashImage, M:\Giochi\Utility\Launchbox\ThirdParty\AutoHotkey\Scripts\Wii-Dolphin-Scripts\ImageEmuWiimote.png, on
Sleep 3000
SplashImage,off
MouseMove, 1920, 1080
     RunWait, %EmulatorEmulated% "%1%"
     ExitApp
   }

   1Joy2::
   $Esc::
   {
     SplashImage,off
     ExitApp
   }
}
 

 

 

Edited by Sbaby
Link to comment
Share on other sites

16 hours ago, Sbaby said:

The two ini files overwrite perfectly and start correctly.

Nice job on finding out the files to use!!  I'll be sure to add that to my Dolphin notes.  Awesome. Thank you!

16 hours ago, Sbaby said:

Splashimage, despite being 1920x1080 does not cover

And it's not going to be able to. You can manually set (force) the width and height, but it will never cover the Windows Taskbar. That's a limitation of SplashImage. The closest you'll get is with something like: (will fill the screen with any image size, but still not cover the Taskbar)

SplashImage,%Image%, b H%A_ScreenHeight% W%A_ScreenWidth%,,, spl

 

16 hours ago, Sbaby said:

2) I tried to insert a confirmation of choice with another loading image that works as a startup over the startup of Dolphin for 3 seconds but unfortunately it does not work, what should I do?

The script is running in sync vs async.  So it won't go to the next line until it's done with the previous line. (mostly)  Also since we're starting the emulator with "RunWait", we can't really say.... "while the emu's loading, show this image for 3 seconds".  

Also, your Option "on" after the Image path is not an available 'option'. ;) But if it's not even showing at all, double check the path and file spelling.

It may be easier (?) to declare another Image, and then use it.  (Well, it makes the code look prettier :D )

Image2 = M:\Giochi\Utility\Launchbox\ThirdParty\AutoHotkey\Scripts\Wii-Dolphin-Scripts\ImageRealWiimote.png

SplashImage, $Image2%, b

If you MUST HAVE the 2nd SplashImage show while the emu is loading you'll have to change RunWait to Run then do some 'while emu is running, show the Image once for 3 secs, then wait for the emu to stop running...'.  

 

16 hours ago, Sbaby said:

I would like to replace 1Joy1 and 1Joy4 with the left and right directional buttons of the joystick

If you mean the joystick button-clicks (press down click, as opposed to moving the joystick left/right/up/down), for me, the Left joy-click is 1Joy9 and the right is 1Joy10.

 

I have (mostly) something 'up my sleeve' that will make %Image% go completely full screen.  But it will add in at least as much code to your script as you have right now.  So you're approximately 45 lines will become about 90 lines. lol  Fortunately is just a matter of copying and pasting it.  But I need to do a little more testing with it first.  IF I can get this to work, I MIGHT look into the 'show 2nd slashimage'.  But anyone else is more than welcome to chime in here!!!  :D

Edited by JoeViking245
Link to comment
Share on other sites

Hi @Sbaby

Try this but I warn you it is much much dirtier than anything  @JoeViking245 would make and I imagine they will clean it up and make it "good" code

Couple of things to say 

I am minimizing LaunchBox/BigBox because in theory that stops the whole issue with the possible double load of game/conflict between keys in game/on ahk/in BigBox - however I don't have dolphin set up on my system so this is a theory but it seems to work just when trying on other systems - the reason I minimize them both twice is for some reason I have to - I tried hiding them but it didn't work correctly and I tried disabling them as well, but minimizing seemed to work the most constantly 

I am hiding the taskbar so your images can go full screen - this assumes that the image you have got is full screen (eg 1920x1080)

I have also played with the order of things a little but, so Splash image 1 loads up, then after you press either Joy 1 or Joy 4 splash image 2 loads up over the top of splash image 1 which then closes - it just makes it cleaner with no back ground flashes - just a little OCD thing from me to make it clean and tidy

10 hours ago, Sbaby said:

3) Most of the buttons conflict with those of bogbox, I would like to replace 1Joy1 and 1Joy4 with the left and right directional buttons of the joystick but I can't find the command line, what is it?

Do you mean moving joystick left or right - if so that will involve having to set a timer and watch the axis which can be done, but I'm hoping the trick of minimizing LaunchBox/BigBox  means you don't have a conflict anyway

Good luck with it, oh and JoeViking245 please feel free to clean it up/improve it/make it actually work.

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

#SingleInstance force
Image = M:\Giochi\Utility\Launchbox\ThirdParty\AutoHotkey\Scripts\Wii-Dolphin-Scripts\wiihotkey_image.png
Image2 = M:\Giochi\Utility\Launchbox\ThirdParty\AutoHotkey\Scripts\Wii-Dolphin-Scripts\ImageRealWiimote.png
Image3 = M:\Giochi\Utility\Launchbox\ThirdParty\AutoHotkey\Scripts\Wii-Dolphin-Scripts\ImageEmuWiimote.png
EmulatorReal = "M:\Giochi\Emulatori\Nintendo Wii\Dolphin.exe" -b -e
EmulatorEmulated = "M:\Giochi\Emulatori\Nintendo Wii\Dolphin.exe" -b -e
SetTimer , Image2, off,
SetTimer , Image3, off,

WinHide, ahk_class Shell_TrayWnd
WinHide, ahk_class Shell_SecondaryTrayWnd

SplashImage,1:%Image%,b,,,MySplash

WinMinimize, ahk_exe LaunchBox.exe,
WinMinimize, ahk_exe LaunchBox.exe,
WinMinimize, ahk_exe BigBox.exe, 
WinMinimize, ahk_exe BigBox.exe,

#IfWinExist MySplash
{
   1Joy1::
   $Left::
   {
    FileCopy, M:\Giochi\Emulatori\Nintendo Wii\User\Config\WiimoteNew.in#real, M:\Giochi\Emulatori\Nintendo Wii\User\Config\WiimoteNew.ini, 1
    FileCopy, M:\Giochi\Emulatori\Nintendo Wii\User\Config\Dolphin.in#_scan_true, M:\Giochi\Emulatori\Nintendo Wii\User\Config\Dolphin.ini,1
SplashImage,2:%Image2%,b,,,Splash2
WinWait, Splash2
SplashImage,1:off
SetTimer , Image2, on,
MouseMove, 1920, 1080
    RunWait, %EmulatorReal% "%1%"
	 	 Gosub, Exit
   }

   1Joy4::
   $Right::
   {
    FileCopy, M:\Giochi\Emulatori\Nintendo Wii\User\Config\WiimoteNew.in#360emu, M:\Giochi\Emulatori\Nintendo Wii\User\Config\WiimoteNew.ini,1
   FileCopy, M:\Giochi\Emulatori\Nintendo Wii\User\Config\Dolphin.in#_scan_false, M:\Giochi\Emulatori\Nintendo Wii\User\Config\Dolphin.ini,1
SplashImage,3:%Image3%,b,,,Splash3
WinWait, Splash3
SplashImage,1:off
SetTimer , Image3, on,
MouseMove, 1920, 1080
     RunWait, %EmulatorEmulated% "%1%"
	 Gosub, Exit
   }

   1Joy2::
   $Exit
   {
     SplashImage,1:off
	 Gosub, Exit
   }
}
 
Exit:
WinShow, ahk_class Shell_TrayWnd
WinShow, ahk_class Shell_SecondaryTrayWnd
WinRestore, ahk_exe LaunchBox.exe
WinRestore, ahk_exe BigBox.exe 
ExitApp

Image2:
Sleep, 3000
SplashImage,2:off
SetTimer , Image2, off,
return

Image3:
Sleep, 3000
SplashImage,3:off
SetTimer , Image3, off,
return

Edit:

I changed the above ahk as I noticed you had a different images for the 2nd splash screen depending on if real or emulated wiimote - on the first one I was using the same image for both - sorry about that.

Link to comment
Share on other sites

11 hours ago, Kiinkyfoxx said:

Try this

Excellent work with the timers!!  Thank you, thank you!

 

11 hours ago, Kiinkyfoxx said:

I minimize them both twice is for some reason I have to

My 1st guess is because of a loading screen (plus the main app).  OK. That's actually my only guess. lol  

 

11 hours ago, Kiinkyfoxx said:

I am hiding the taskbar so your images can go full screen

Personally I don't like doing this because I tend to somehow screw something up and can't get it back without rebooting.  I did find a way to go [actual] fullscreen with 1 line of script vs the 45 lines I mentioned earlier.  "WinMove"   I didn't test with a 'regular' window, but it works great with SplashImage. 

Things to note in the script:

Options - This is to set (force) the Image size (not to be confused with window size). So if it's a 640x480, you can "stretch" it to 1920x1080. The 1st one listed automatically sizes it to the monitor.  The 2nd one (commented out) just shows how you can set it manually.

SetTimer...off  - I'm not sure if this is actually necessary [at the beginning of the script], so I commented the first 2 out.

WinMove - Ahh.. A thing of beauty.  ;)  So here we're moving the SplashImage "MySplash" to coordinates x=0, y=0, and setting it to the screens full width and height.  "TAKE THAT taskbar!!" :D

SetTimer, WatchAxis - This is what will look for joystick movement (vs a joystick 'click').  Examples for all directions are shown (commented) and I incorporated Left/Right/Down to give practical examples.  For Left and Up, if you don't have the "&& Joy.. > 0", everything gets all screwy if the controller's not on.
 

Spoiler


#SingleInstance force

Image = M:\Giochi\Utility\Launchbox\ThirdParty\AutoHotkey\Scripts\Wii-Dolphin-Scripts\wiihotkey_image.png
Image2 = M:\Giochi\Utility\Launchbox\ThirdParty\AutoHotkey\Scripts\Wii-Dolphin-Scripts\ImageRealWiimote.png
Image3 = M:\Giochi\Utility\Launchbox\ThirdParty\AutoHotkey\Scripts\Wii-Dolphin-Scripts\ImageEmuWiimote.png
Emulator = "M:\Giochi\Emulatori\Nintendo Wii\Dolphin.exe" -b -e
Options = Zw%A_ScreenWidth% Zh%A_ScreenHeight%
;Options = Zw1920 Zh1080

;SetTimer, Image2, off,
;SetTimer, Image3, off,

SplashImage,1:%Image%,b %Options%,,,MySplash
WinMove, MySplash,,0,0, %A_ScreenWidth%, %A_ScreenHeight%

WinMinimize, ahk_exe LaunchBox.exe,
WinMinimize, ahk_exe LaunchBox.exe,
WinMinimize, ahk_exe BigBox.exe, 
WinMinimize, ahk_exe BigBox.exe,

#IfWinExist MySplash
{
   SetTimer, WatchAxis, 5
   
   WatchAxis:
   JoyX := GetKeyState("JoyX")  ;Get position of X axis.
   JoyY := GetKeyState("JoyY")  ;Get position of Y axis.
   
   ;If (JoyX > 70)             ;Left-Joy Right
   ;If (JoyX < 30 && JoyX > 0) ;Left-Joy Left
   ;If (JoyY > 70)             ;Left-Joy Down
   ;If (JoyY < 30 && JoyY > 0) ;Left-Joy Up

   If (JoyX < 30 && JoyX > 0)  ;Left-Joy Left
     Gosub $Left

   If (JoyX > 70)  ;Left-Joy Right
     Gosub $Right

   If (JoyY > 70)  ;Left-Joy Down
     Gosub $Exit
   
   1Joy1::
   $Left::
   {
	FileCopy, M:\Giochi\Emulatori\Nintendo Wii\User\Config\WiimoteNew.in#real, M:\Giochi\Emulatori\Nintendo Wii\User\Config\WiimoteNew.ini, 1
	FileCopy, M:\Giochi\Emulatori\Nintendo Wii\User\Config\Dolphin.in#_scan_true, M:\Giochi\Emulatori\Nintendo Wii\User\Config\Dolphin.ini,1
	SplashImage,2:%Image2%,b %Options%,,,Splash2
	WinWait, Splash2
	SplashImage,1:off
	SetTimer, Image2, on,
	MouseMove, 1920, 1080
	RunWait, %Emulator% "%1%"
	Gosub, Exit
   }

   1Joy4::
   $Right::
   {
	FileCopy, M:\Giochi\Emulatori\Nintendo Wii\User\Config\WiimoteNew.in#360emu, M:\Giochi\Emulatori\Nintendo Wii\User\Config\WiimoteNew.ini,1
	FileCopy, M:\Giochi\Emulatori\Nintendo Wii\User\Config\Dolphin.in#_scan_false, M:\Giochi\Emulatori\Nintendo Wii\User\Config\Dolphin.ini,1
	SplashImage,3:%Image3%,b %Options%,,,Splash3
	WinWait, Splash3
	SplashImage, 1:off
	SetTimer, Image3, on,
	MouseMove, 1920, 1080
	RunWait, %Emulator% "%1%"
	Gosub, Exit
   }

   1Joy2::
   $Exit
   {
	 SplashImage, 1:off
	 Gosub, Exit
   }
}
 
Exit:
WinRestore, ahk_exe LaunchBox.exe
WinRestore, ahk_exe BigBox.exe 
ExitApp

Image2:
Sleep, 3000
SplashImage, 2:off
SetTimer, Image2, off,
return

Image3:
Sleep, 3000
SplashImage, 3:off
SetTimer, Image3, off,
return

 

I didn't test this go-around actually in BigBox, but I did test the logistics of the SplashScreen and joysticks.  But I tested them in sections so hopefully I copied, pasted and transposed it all correctly.  I'm sure someone will let me know. lol

 

Link to comment
Share on other sites

15 hours ago, Kiinkyfoxx said:

Hi @Sbaby

Try this but I warn you it is much much dirtier than anything  @JoeViking245 would make and I imagine they will clean it up and make it "good" code

Couple of things to say 

I am minimizing LaunchBox/BigBox because in theory that stops the whole issue with the possible double load of game/conflict between keys in game/on ahk/in BigBox - however I don't have dolphin set up on my system so this is a theory but it seems to work just when trying on other systems - the reason I minimize them both twice is for some reason I have to - I tried hiding them but it didn't work correctly and I tried disabling them as well, but minimizing seemed to work the most constantly 

I am hiding the taskbar so your images can go full screen - this assumes that the image you have got is full screen (eg 1920x1080)

I have also played with the order of things a little but, so Splash image 1 loads up, then after you press either Joy 1 or Joy 4 splash image 2 loads up over the top of splash image 1 which then closes - it just makes it cleaner with no back ground flashes - just a little OCD thing from me to make it clean and tidy

Do you mean moving joystick left or right - if so that will involve having to set a timer and watch the axis which can be done, but I'm hoping the trick of minimizing LaunchBox/BigBox  means you don't have a conflict anyway

Good luck with it, oh and JoeViking245 please feel free to clean it up/improve it/make it actually work.

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

#SingleInstance force
Image = M:\Giochi\Utility\Launchbox\ThirdParty\AutoHotkey\Scripts\Wii-Dolphin-Scripts\wiihotkey_image.png
Image2 = M:\Giochi\Utility\Launchbox\ThirdParty\AutoHotkey\Scripts\Wii-Dolphin-Scripts\ImageRealWiimote.png
Image3 = M:\Giochi\Utility\Launchbox\ThirdParty\AutoHotkey\Scripts\Wii-Dolphin-Scripts\ImageEmuWiimote.png
EmulatorReal = "M:\Giochi\Emulatori\Nintendo Wii\Dolphin.exe" -b -e
EmulatorEmulated = "M:\Giochi\Emulatori\Nintendo Wii\Dolphin.exe" -b -e
SetTimer , Image2, off,
SetTimer , Image3, off,

WinHide, ahk_class Shell_TrayWnd
WinHide, ahk_class Shell_SecondaryTrayWnd

SplashImage,1:%Image%,b,,,MySplash

WinMinimize, ahk_exe LaunchBox.exe,
WinMinimize, ahk_exe LaunchBox.exe,
WinMinimize, ahk_exe BigBox.exe, 
WinMinimize, ahk_exe BigBox.exe,

#IfWinExist MySplash
{
   1Joy1::
   $Left::
   {
    FileCopy, M:\Giochi\Emulatori\Nintendo Wii\User\Config\WiimoteNew.in#real, M:\Giochi\Emulatori\Nintendo Wii\User\Config\WiimoteNew.ini, 1
    FileCopy, M:\Giochi\Emulatori\Nintendo Wii\User\Config\Dolphin.in#_scan_true, M:\Giochi\Emulatori\Nintendo Wii\User\Config\Dolphin.ini,1
SplashImage,2:%Image2%,b,,,Splash2
WinWait, Splash2
SplashImage,1:off
SetTimer , Image2, on,
MouseMove, 1920, 1080
    RunWait, %EmulatorReal% "%1%"
	 	 Gosub, Exit
   }

   1Joy4::
   $Right::
   {
    FileCopy, M:\Giochi\Emulatori\Nintendo Wii\User\Config\WiimoteNew.in#360emu, M:\Giochi\Emulatori\Nintendo Wii\User\Config\WiimoteNew.ini,1
   FileCopy, M:\Giochi\Emulatori\Nintendo Wii\User\Config\Dolphin.in#_scan_false, M:\Giochi\Emulatori\Nintendo Wii\User\Config\Dolphin.ini,1
SplashImage,3:%Image3%,b,,,Splash3
WinWait, Splash3
SplashImage,1:off
SetTimer , Image3, on,
MouseMove, 1920, 1080
     RunWait, %EmulatorEmulated% "%1%"
	 Gosub, Exit
   }

   1Joy2::
   $Exit
   {
     SplashImage,1:off
	 Gosub, Exit
   }
}
 
Exit:
WinShow, ahk_class Shell_TrayWnd
WinShow, ahk_class Shell_SecondaryTrayWnd
WinRestore, ahk_exe LaunchBox.exe
WinRestore, ahk_exe BigBox.exe 
ExitApp

Image2:
Sleep, 3000
SplashImage,2:off
SetTimer , Image2, off,
return

Image3:
Sleep, 3000
SplashImage,3:off
SetTimer , Image3, off,
return

Edit:

I changed the above ahk as I noticed you had a different images for the 2nd splash screen depending on if real or emulated wiimote - on the first one I was using the same image for both - sorry about that.

Hi @Kiinkyfoxx,thanks gor your help. I really appreciate. 


I tried your script but it produces this error

error51.jpg.e905f6933c0131c438eac0303975f554.jpg

 

 

2 hours ago, JoeViking245 said:

Excellent work with the timers!!  Thank you, thank you!

 

My 1st guess is because of a loading screen (plus the main app).  OK. That's actually my only guess. lol  

 

Personally I don't like doing this because I tend to somehow screw something up and can't get it back without rebooting.  I did find a way to go [actual] fullscreen with 1 line of script vs the 45 lines I mentioned earlier.  "WinMove"   I didn't test with a 'regular' window, but it works great with SplashImage. 

Things to note in the script:

Options - This is to set (force) the Image size (not to be confused with window size). So if it's a 640x480, you can "stretch" it to 1920x1080. The 1st one listed automatically sizes it to the monitor.  The 2nd one (commented out) just shows how you can set it manually.

SetTimer...off  - I'm not sure if this is actually necessary [at the beginning of the script], so I commented the first 2 out.

WinMove - Ahh.. A thing of beauty.  ;)  So here we're moving the SplashImage "MySplash" to coordinates x=0, y=0, and setting it to the screens full width and height.  "TAKE THAT taskbar!!" :D

SetTimer, WatchAxis - This is what will look for joystick movement (vs a joystick 'click').  Examples for all directions are shown (commented) and I incorporated Left/Right/Down to give practical examples.  For Left and Up, if you don't have the "&& Joy.. > 0", everything gets all screwy if the controller's not on.
 

  Reveal hidden contents

 

 

#SingleInstance force

Image = M:\Giochi\Utility\Launchbox\ThirdParty\AutoHotkey\Scripts\Wii-Dolphin-Scripts\wiihotkey_image.png
Image2 = M:\Giochi\Utility\Launchbox\ThirdParty\AutoHotkey\Scripts\Wii-Dolphin-Scripts\ImageRealWiimote.png
Image3 = M:\Giochi\Utility\Launchbox\ThirdParty\AutoHotkey\Scripts\Wii-Dolphin-Scripts\ImageEmuWiimote.png
Emulator = "M:\Giochi\Emulatori\Nintendo Wii\Dolphin.exe" -b -e
Options = Zw%A_ScreenWidth% Zh%A_ScreenHeight%
;Options = Zw1920 Zh1080

;SetTimer, Image2, off,
;SetTimer, Image3, off,

SplashImage,1:%Image%,b %Options%,,,MySplash
WinMove, MySplash,,0,0, %A_ScreenWidth%, %A_ScreenHeight%

WinMinimize, ahk_exe LaunchBox.exe,
WinMinimize, ahk_exe LaunchBox.exe,
WinMinimize, ahk_exe BigBox.exe, 
WinMinimize, ahk_exe BigBox.exe,

#IfWinExist MySplash
{
   SetTimer, WatchAxis, 5
   
   WatchAxis:
   JoyX := GetKeyState("JoyX")  ;Get position of X axis.
   JoyY := GetKeyState("JoyY")  ;Get position of Y axis.
   
   ;If (JoyX > 70)             ;Left-Joy Right
   ;If (JoyX < 30 && JoyX > 0) ;Left-Joy Left
   ;If (JoyY > 70)             ;Left-Joy Down
   ;If (JoyY < 30 && JoyY > 0) ;Left-Joy Up

   If (JoyX < 30 && JoyX > 0)  ;Left-Joy Left
     Gosub $Left

   If (JoyX > 70)  ;Left-Joy Right
     Gosub $Right

   If (JoyY > 70)  ;Left-Joy Down
     Gosub $Exit
   
   1Joy1::
   $Left::
   {
	FileCopy, M:\Giochi\Emulatori\Nintendo Wii\User\Config\WiimoteNew.in#real, M:\Giochi\Emulatori\Nintendo Wii\User\Config\WiimoteNew.ini, 1
	FileCopy, M:\Giochi\Emulatori\Nintendo Wii\User\Config\Dolphin.in#_scan_true, M:\Giochi\Emulatori\Nintendo Wii\User\Config\Dolphin.ini,1
	SplashImage,2:%Image2%,b %Options%,,,Splash2
	WinWait, Splash2
	SplashImage,1:off
	SetTimer, Image2, on,
	MouseMove, 1920, 1080
	RunWait, %Emulator% "%1%"
	Gosub, Exit
   }

   1Joy4::
   $Right::
   {
	FileCopy, M:\Giochi\Emulatori\Nintendo Wii\User\Config\WiimoteNew.in#360emu, M:\Giochi\Emulatori\Nintendo Wii\User\Config\WiimoteNew.ini,1
	FileCopy, M:\Giochi\Emulatori\Nintendo Wii\User\Config\Dolphin.in#_scan_false, M:\Giochi\Emulatori\Nintendo Wii\User\Config\Dolphin.ini,1
	SplashImage,3:%Image3%,b %Options%,,,Splash3
	WinWait, Splash3
	SplashImage, 1:off
	SetTimer, Image3, on,
	MouseMove, 1920, 1080
	RunWait, %Emulator% "%1%"
	Gosub, Exit
   }

   1Joy2::
   $Exit
   {
	 SplashImage, 1:off
	 Gosub, Exit
   }
}
 
Exit:
WinRestore, ahk_exe LaunchBox.exe
WinRestore, ahk_exe BigBox.exe 
ExitApp

Image2:
Sleep, 3000
SplashImage, 2:off
SetTimer, Image2, off,
return

Image3:
Sleep, 3000
SplashImage, 3:off
SetTimer, Image3, off,
return

 

I didn't test this go-around actually in BigBox, but I did test the logistics of the SplashScreen and joysticks.  But I tested them in sections so hopefully I copied, pasted and transposed it all correctly.  I'm sure someone will let me know. lol

 

Hi @JoeViking245 Your work looks great but I can't get it to work, it makes me this error:

error72.jpg.d0ce7470c0eec3e453a3817679df3ff4.jpg

 

 

🙄

 

 

I tried to replace

   1Joy2 ::
   $Exit

 

with the exact one:

   1Joy2 ::
   $Esc::


but the error becomes:

error.jpg.d1e6188eb788ec2430ae10f5649cd797.jpg

 

Edited by Sbaby
Link to comment
Share on other sites

43 minutes ago, Sbaby said:

tried to replace

   1Joy2 ::
   $Exit

 

with the exact one:

   1Joy2 ::
   $Esc::

 

That's because I'm an idiot and shouldn't do things at 6am in the morning when I cannot sleep!!

In my code you are correct and if you change Line 51 to $Esc:: rather than my stupid typo it should work

 

However as JoeViking245 has yet again come up with the goods (and the only reason it doesn't work is because of my mistake) I would say make the following changes

 

Line 41 change to

Gosub $Esc

and line 72 change to 

$Esc::

Think you have already figure out to make the 2nd change

So again sorry for the error, especially as it also made the far better version not work.

Cheers

Edited by Kiinkyfoxx
Link to comment
Share on other sites

30 minutes ago, Kiinkyfoxx said:

That's because I'm an idiot and shouldn't do things at 6am in the morning when I cannot sleep!!

In my code you are correct and if you change Line 51 to $Esc:: rather than my stupid typo it should work

 

However as JoeViking245 has yet again come up with the goods (and the only reason it doesn't work is because of my mistake) I would say make the following changes

 

Line 41 change to

Gosub $Esc

and line 72 change to 

$Esc::

Think you have already figure out to make the 2nd change

So again sorry for the error, especially as it also made the far better version not work.

Cheers

 


Do not worry 😅

1) Ok thanks , now it works  !  First image ok, but second image ImageEmuWiimote.png does not load correctly (distorted) ... I add a video of what happens

 


2) left and right analog sticks work but I would also like to add the directionals, but I noticed that they only work without minimizing bigbox .... With the latest script 1joy9 and 1joy10 do not work

 

My latest script :

#SingleInstance force

Image = M:\Giochi\Utility\Launchbox\ThirdParty\AutoHotkey\Scripts\Wii-Dolphin-Scripts\wiihotkey_image.png
Image2 = M:\Giochi\Utility\Launchbox\ThirdParty\AutoHotkey\Scripts\Wii-Dolphin-Scripts\ImageRealWiimote.png
Image3 = M:\Giochi\Utility\Launchbox\ThirdParty\AutoHotkey\Scripts\Wii-Dolphin-Scripts\ImageEmuWiimote.png
Emulator = "M:\Giochi\Emulatori\Nintendo Wii\Dolphin.exe" -b -e
Options = Zw%A_ScreenWidth% Zh%A_ScreenHeight%
;Options = Zw1920 Zh1080

;SetTimer, Image2, off,
;SetTimer, Image3, off,

SplashImage,1:%Image%,b %Options%,,,MySplash
WinMove, MySplash,,0,0, %A_ScreenWidth%, %A_ScreenHeight%

WinMinimize, ahk_exe LaunchBox.exe,
WinMinimize, ahk_exe LaunchBox.exe,
WinMinimize, ahk_exe BigBox.exe, 
WinMinimize, ahk_exe BigBox.exe,

#IfWinExist MySplash
{
   SetTimer, WatchAxis, 5
   
   WatchAxis:
   JoyX := GetKeyState("JoyX")  ;Get position of X axis.
   JoyY := GetKeyState("JoyY")  ;Get position of Y axis.
   
   ;If (JoyX > 70)             ;Left-Joy Right
   ;If (JoyX < 30 && JoyX > 0) ;Left-Joy Left
   ;If (JoyY > 70)             ;Left-Joy Down
   ;If (JoyY < 30 && JoyY > 0) ;Left-Joy Up

   If (JoyX < 30 && JoyX > 0)  ;Left-Joy Left
     Gosub $Left

   If (JoyX > 70)  ;Left-Joy Right
     Gosub $Right

   If (JoyY > 70)  ;Left-Joy Down
     Gosub $Esc
   
   1Joy9::
   $Left::
   {
    FileCopy, M:\Giochi\Emulatori\Nintendo Wii\User\Config\WiimoteNew.in#real, M:\Giochi\Emulatori\Nintendo Wii\User\Config\WiimoteNew.ini, 1
    FileCopy, M:\Giochi\Emulatori\Nintendo Wii\User\Config\Dolphin.in#_scan_true, M:\Giochi\Emulatori\Nintendo Wii\User\Config\Dolphin.ini,1
    SplashImage,2:%Image2%,b %Options%,,,Splash2
    WinWait, Splash2
    SplashImage,1:off
    SetTimer, Image2, on,
    MouseMove, 1920, 1080
    RunWait, %Emulator% "%1%"
    Gosub, Exit
   }

   1Joy10::
   $Right::
   {
    FileCopy, M:\Giochi\Emulatori\Nintendo Wii\User\Config\WiimoteNew.in#360emu, M:\Giochi\Emulatori\Nintendo Wii\User\Config\WiimoteNew.ini,1
    FileCopy, M:\Giochi\Emulatori\Nintendo Wii\User\Config\Dolphin.in#_scan_false, M:\Giochi\Emulatori\Nintendo Wii\User\Config\Dolphin.ini,1
    SplashImage,3:%Image3%,b %Options%,,,Splash3
    WinWait, Splash3
    SplashImage, 1:off
    SetTimer, Image3, on,
    MouseMove, 1920, 1080
    RunWait, %Emulator% "%1%"
    Gosub, Exit
   }

   1Joy2::
   $Esc::
   {
     SplashImage, 1:off
     Gosub, Exit
   }
}
 
Exit:
WinRestore, ahk_exe LaunchBox.exe
WinRestore, ahk_exe BigBox.exe 
ExitApp

Image2:
Sleep, 3000
SplashImage, 2:off
SetTimer, Image2, off,
return

Image3:
Sleep, 3000
SplashImage, 3:off
SetTimer, Image3, off,
return

 

Edited by Sbaby
Link to comment
Share on other sites

2 hours ago, Sbaby said:

second image ImageEmuWiimote.png does not load correctly (distorted)

Either remove "%Options%" from the line  "SplashImage,2:....." (and probably 3 also), OR copy and paste the WinMove line to right below "SplashImage,2:....." and change %Image2% to %Splash2%.  You can also set the image size manually on the "SplashImage,2:....." line by replacing "%Options%" with zw number and zh number.  Play around and see what looks best with your image(s)

3 hours ago, Sbaby said:

With the latest script 1joy9 and 1joy10 do not work

Did they work before?  Try putting a $ in front of them.   i.e.  $1Joy9.

3 hours ago, Sbaby said:

left and right analog sticks work but I would also like to add the directionals, but I noticed that they only work without minimizing bigbox

Since you're now using something to select your choice that doesn't cause problems in BigBox, comment out (or remove) the lines that minimize it.

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.

×
×
  • Create New...