Jump to content
LaunchBox Community Forums

Can LB pass variables to AutoHotkey?


Recommended Posts

Update:

  • GUI (Beta) code is in place and working.
  • Plan on working on the final version of the GUI this weekend and import the code over to the final GUI that can be added to LB.

Note: The GUI (Beta) was just for me to learn and see if I could actually create a working GUI for my Launcher. Yes I successfully accomplished that!

Edited by Krakerman
  • Like 1
  • Unusual Gem 2
Link to comment
Share on other sites

  • 2 weeks later...

What's new:

  • New design and layout of the GUI (Final).
  • Added tooltips similar to RLUI.
  • On launch of the UI will determine what platform and display an icon in the GUI for that platform so you know what system you are editing.
Edited by Krakerman
  • Like 1
  • Game On 1
Link to comment
Share on other sites


I should have this GUI (LauncherUI) wrapped up by next weekend. Went at it hard this weekend (coding/debugging) and got about 90% of it done.? The Launcher itself is ready to go so I am looking forward to a release coming soon.

 

Edited by Krakerman
  • Like 1
  • Game On 1
Link to comment
Share on other sites

Update:

  • Added a screenshot of the game when viewing the UI when in fullscreen mode (Requires NirCmd to be installed in LB ThirdParty folder). 

* NirCmd is available here https://www.nirsoft.net/utils/nircmd.html. I am using the 64-bit version and install it in the LaunchBox\ThirdParty\NirCmd folder.

To do:

  • This weekend plan on working on the GUI for adding news games for each of the platforms (Atari 8-Bit, Atari 5200 and Atari XEGS).

 

Edited by Krakerman
Link to comment
Share on other sites

Actually spent the weekend fixing computer issues and updating my display to 120hz ... man what a difference in 4K smooth!

I did manage to implement some new error checking routines into the code and debugging in which I squashed a few more that I found.?

Edited by Krakerman
Link to comment
Share on other sites

Ok the Launcher is done! ?

I removed the GUI for now as it isn't ready for general use it's more for my own personal use as it was more of a proof of concept and something I personally wanted to create to see if I could do it taking inspiration from RLUI. You will be able to edit the included config files and create your own by using your own favorite text editor such as Notepad++ or my favorite Visual Studio Code.

The only thing left to do is pretty much just post it and instructions on how to set it up in LaunchBox (which is really easy). The folder structure is customizable but does use a similar file/folder structure like RL for saving your Info Cards (Instruction Cards like in RocketLauncher) and Sound FX.

The Launcher for Altirra supports the following:

  • Atari 8-Bit Computer Systems (400/800/XL/XE).
  • Atari 5200.
  • Atari XEGS.
  • Supports Altirra profiles as well as many more features like Various RAM Sizes, Cheats, Covox, RAMDisks and much more.
  • Info Cards (Instruction Cards) up to 4 you can create. Supports PNG images.
  • Info Cards support sound effects in MP3 or WAV format.
  • Cinematic startup/shutdown videos.
  • Per game configs.
  • Can launch/run Basic, Binary, Carts, Disks and Tape formats.
  • Comes with configs for all supported systems to get you started of which most of the Atari 5200 and XEGS have are close if not complete.
  • Works with LaunchBox/BigBox Pause feature as well!

 

Edited by Krakerman
  • Like 2
  • Thanks 2
Link to comment
Share on other sites

8 minutes ago, Krakerman said:

Ok the Launcher is done! ?

I removed the GUI for now as it isn't ready for general use it's more for my own personal use as it was more of a proof of concept and something I personally wanted to create to see if I could do it taking inspiration from RLUI. You will be able to edit the included config files and create your own by using your own favorite text editor such as Notepad++ or my favorite Visual Studio Code.

The only thing left to do is pretty much just post it and instructions on how to set it up in LaunchBox (which is really easy). The folder structure is customizable but does use a similar file/folder structure like RL for saving your Info Cards (Instruction Cards like in RocketLauncher) and Sound FX.

 

Thanks, Really love the look of the work you have done.

  • Like 1
Link to comment
Share on other sites

  • 1 year later...

I tried a different approach where my goal was not not use any file needed in the installation, and only to use internal windows commands, as i don't want to install Autohotkey for a portable installation

I was able to accomplish this in a very creative way, where its still possible to pass the game name, it was very challenging as the clipboard needs a sleep timer to work, and it was not possible within autohotkey start script to use this, as it sees powershell exe as a ended script and in that way close the process

Default command line

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe

Parameters

-noprofile -NonInteractive -command Set-Clipboard %romfile% ; sleep 5

 Hide Console

Running Script Code

Sleep, 3000
Workingdir := "E:\Launchbox\Launchbox\Emulators\M2emulatorLightgun"
Game := clipboard
Run E:\Launchbox\Launchbox\Emulators\M2emulatorLightgun\emulator_multicpu.exe %Game%,%workingdir%

This little rocket, copies the game into clipboard to be used within autohotkey, it could be further improved with adding all lunchbox variables, and split it inside the autohotkey

  • Like 1
Link to comment
Share on other sites

2 hours ago, Mock said:

I tried a different approach where my goal was not not use any file needed in the installation, and only to use internal windows commands, as i don't want to install Autohotkey for a portable installation

I was able to accomplish this in a very creative way, where its still possible to pass the game name, it was very challenging as the clipboard needs a sleep timer to work, and it was not possible within autohotkey start script to use this, as it sees powershell exe as a ended script and in that way close the process

Default command line

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe

Parameters

-noprofile -NonInteractive -command Set-Clipboard %romfile% ; sleep 5

Hide Console

Running Script Code

Sleep, 3000
Workingdir := "E:\Launchbox\Launchbox\Emulators\M2emulatorLightgun"
Game := clipboard
Run E:\Launchbox\Launchbox\Emulators\M2emulatorLightgun\emulator_multicpu.exe %Game%,%workingdir%

This little rocket, copies the game into clipboard to be used within autohotkey, it could be further improved with adding all lunchbox variables, and split it inside the autohotkey

Committed the final code to git that also support relative path and no hardcoding of exe files

https://github.com/mooock/Launchbox/blob/main/Autohotkey/Startscript/EmulatorVariablePassing.ahk

  • Like 1
Link to comment
Share on other sites

8 hours ago, Mock said:

Committed the final code to git that also support relative path and no hardcoding of exe files

https://github.com/mooock/Launchbox/blob/main/Autohotkey/Startscript/EmulatorVariablePassing.ahk

Fixed link:
https://github.com/mooock/Launchbox/blob/main/Autohotkey/Startup Emulator Variable Passing.ahk

This is awesome. Thank you! This is going to come in handy in several ways, I believe.

Edited by megashub
Link to comment
Share on other sites

  • 1 month later...

This needs some refinement but the following command returns the commandline used to call a particular emulator. Easy to grab the rom name directly in AHK and no need for fancy scripts to call your emulator..

wmic path win32_process where "caption='hoxs64.exe'" get commandline

Which gives..

CommandLine

"D:\Emulation\C64\Emulators\Hoxs64\hoxs64.exe" -fullscreen -autoload "D:\Emulation\C64\Games\Freeze\space pilot.prg"

Link to comment
Share on other sites

16 hours ago, ElStocko said:

This needs some refinement but the following command returns the commandline used to call a particular emulator. Easy to grab the rom name directly in AHK and no need for fancy scripts to call your emulator..

wmic path win32_process where "caption='hoxs64.exe'" get commandline

Which gives..

CommandLine

"D:\Emulation\C64\Emulators\Hoxs64\hoxs64.exe" -fullscreen -autoload "D:\Emulation\C64\Games\Freeze\space pilot.prg"

Nice find, ElStocko!!!   Thanks!

To expand on this further: If you wanted to use this in the Running AutoHotKey Script tab for an Emulator,

queryEnum2 := ComObjGet("winmgmts:").ExecQuery(""
     . "Select * from Win32_Process where caption='hoxs64.exe'")
     ._NewEnum()[process]

CommandLine = % process.commandline

Then from here, the string %CommandLine% can be used with StringSplit and SplitPath to get what's needed.  i.e.

MsgBox, %CommandLine%   ; "D:\Emulation\C64\Emulators\Hoxs64\hoxs64.exe" -fullscreen -autoload "D:\Emulation\C64\Games\Freeze\space pilot.prg"

StringSplit, cl, CommandLine, "
MsgBox, %cl2%        ; D:\Emulation\C64\Emulators\Hoxs64\hoxs64.exe
MsgBox, %cl3%        ; -fullscreen -autoload
MsgBox, %cl4%        ; D:\Emulation\C64\Games\Freeze\space pilot.prg

SplitPath, cl4,fullrom,fullDir,,romName
MsgBox, %fullRom%    ; space pilot.prg
MsgBox, %fullDir%    ; D:\Emulation\C64\Games\Freeze
MsgBox, %romName%    ; space pilot

 

  • Like 1
Link to comment
Share on other sites

2 hours ago, JoeViking245 said:

Nice find, ElStocko!!!   Thanks!

To expand on this further: If you wanted to use this in the Running AutoHotKey Script tab for an Emulator,

queryEnum2 := ComObjGet("winmgmts:").ExecQuery(""
     . "Select * from Win32_Process where caption='hoxs64.exe'")
     ._NewEnum()[process]

CommandLine = % process.commandline

Then from here, the string %CommandLine% can be used with StringSplit and SplitPath to get what's needed.  i.e.

MsgBox, %CommandLine%   ; "D:\Emulation\C64\Emulators\Hoxs64\hoxs64.exe" -fullscreen -autoload "D:\Emulation\C64\Games\Freeze\space pilot.prg"

StringSplit, cl, CommandLine, "
MsgBox, %cl2%        ; D:\Emulation\C64\Emulators\Hoxs64\hoxs64.exe
MsgBox, %cl3%        ; -fullscreen -autoload
MsgBox, %cl4%        ; D:\Emulation\C64\Games\Freeze\space pilot.prg

SplitPath, cl4,fullrom,fullDir,,romName
MsgBox, %fullRom%    ; space pilot.prg
MsgBox, %fullDir%    ; D:\Emulation\C64\Games\Freeze
MsgBox, %romName%    ; space pilot

 

Thanks Joe, nice job! I'm glad you did all the hard work for me 😁

  • Haha 1
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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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...