Jump to content
LaunchBox Community Forums

Autoplay Attract Mode 1.0.0

   (0 reviews)

About This File

This was inspired by "Play N Quit" and I wanted to create an improved version that would work for anyone regardless of settings in Big Box

Description: This is an AHK script that will automatically launch and close selected games for an in game playable take on Attract Mode. In between each game being selected, it will randomly scroll through your game wheel. Please note at this time it will only work in a single game wheel (it's not smart enough to know how to go into different platforms/playlists) and though can be easily configured for different emulators, it can only be configured for one at a time. Once the script is running you can easily start playing whatever game is currently being ran by hitting the designated hotkey to stop the script and proceed with your gaming session!


Here are the improvements:

  • Takes into consideration whether or not Startup/Shutdown screens are enabled
  • Takes into consideration whether or not Game Details View is skipped
  • Can work with any emulator
  • Uses a random number for the game wheel selection to change
  • Can set a max value for this random number
  • Randomizes direction for the game wheel to move
  • Will work with a vertical or horizontal game wheel
  • Removed all the extra non-functional lines


How to use:

In the header section of the script there are detailed comments directing users what a handful of variables are doing and how to set them

  • GameDetails - Use a value of 1 if you have Game Details View enabled. Use a value of 0 (or anything but 1) if you have Game Details View disabled
  • GameWheelOrientation - Use "V" (must be in quotes) for vertical game wheels (ie up and down) and use "H" for horizontal game wheels (left and right)
  • GameRunTime - Enter the number of minutes each game should run before closing and choosing the next game
  • MaxGames - the maximum random number to be generated. Tip: make this at or smaller than the total qty of games in the platform/playlist. (if you make it same or greater as total qty it is possible for the random number to select the same game twice in a row)
  • EmulatorEXE - Enter the file name with extension of the emulator (must be in quotes)
  • Exit Hotkey - last line in script is a hotkey to terminate the script. Use this at any time the script is running to stop it

 

Default values:

  • GameDetails - 0 (disabled)
  • GameWheelOrientation - "V" (vertical)
  • GameRunTime - 3 (minutes for game to run)
  • MaxGames - 150 (max number for wheel to move to select new game)
  • EmulatorEXE - "retroarch.exe" (emulator's executable file name with extension)
  • Exit Hotkey - Joy8 (commonly the "start" button on joypads)

 

How to use (continued):

  • Place the script file in a desired location
  • In LaunchBox, edit a game entry
  • In the game's Additional Apps, add the script file as the Additional App
  • Select for the Additional App to start automatically at game launch
  • Now when this game is launched, this script will start the Autoplay Attract Mode

Alternative launching method:

  • Alternatively, you could add a hotkey to the script that would start it
  • If so place this hotkey at the spot designed in the script, specifically it is line 28
  • For ex: +Home::
  • The above example starting hotkey would be shift+home keys
  • Recommended to add the script to startup programs in LaunchBox if using the start with hotkey method. Do this instead of adding it to a game as an Additional App
  • This is due to the script will instead launch automatically at start of LaunchBox/Big Box. But it will not execute the main part of the script until the hotkey is pressed
  • This may be a better method for some to start/stop the script depending on your use case

 

Leave any feedback in this thread! Cheers!

 

Edited by skizzosjt
adding better description

  • Like 5

User Feedback

Recommended Comments

Great additions ❤️ love it, haven't tried it yet, but looked trough the code, seems great.


It would be nice if theese settings were integrated in Bigbox's attract mode...

Right now I'm using a modified version of my code in which I've changed the "close retroarch" action, with plain "send input alt-f4", so it now works for other emulators that get closed by alt-f4 too, even windows games.

  • Like 1
Link to comment
Share on other sites

34 minutes ago, izzishor said:

Great additions ❤️ love it, haven't tried it yet, but looked trough the code, seems great.


It would be nice if theese settings were integrated in Bigbox's attract mode...

Right now I'm using a modified version of my code in which I've changed the "close retroarch" action, with plain "send input alt-f4", so it now works for other emulators that get closed by alt-f4 too, even windows games.

it's neat idea you had here! just wanted to polish it up!

You have the right idea with using a universal closing command, but that is still not an ideal situation as it would close some programs in an inappropriate way. Alt+F4 is akin to Process Close which is akin to opening up Task Manager and killing/ending the process. This is a less than ideal way to close programs since some will not be able to execute code that the would otherwise at a normal shutdown. If for example they alter save settings on exit, those saves would not get done and worst case scenario means associated game or emulator files end up wrong, blank, or corrupted.  So in the end, the adjustment you're making is a lateral adjustment in my opinion. Might work with more emulators, but I wouldn't recommend doing it like that out of fear of making issues for yourself and others. I wouldn't recommend anyone use that with native windows games, native games have native exiting means that should be utilized whenever possible. WinClose is still a superior option to use since that is the equivalent of clicking the "X" button in the top right corner of a window. Games/programs will shutdown as intended that way and would execute any code triggered by an exit. With that said I recommend altering your script a bit further by avoiding "Process, Close" and sending Alt+F4, but instead make use of WinClose or some other equally safe method.

In order to get it to work with other emulators without the need to edit the specific emulator we need a way to detect which process (emulator/game) is running. Haven't got a good idea on this yet that isn't a bit....well, silly lol. I could make a long if/else ladder that basically goes "if emulator A exists then EmulatorEXE = emulatorA.exe else if emulator B exists then EmulatorEXE = emulatorB.exe......etc etc and so on". This would work, but every emulator would need to specifically spelled out. I know of ways to detect new processes, but it would be impossible to detect if one is an emulator or if one is some random additional app or game launcher etc. I may get creative and find a way to see if I can pass what the emulator is being used or even parse through the platform's XML file to find out what emulator is being used for that specific game and then either pass it as an argument or if needed store into an ini file and read it from there. I think I can get it to into different platforms/playlists too, that would just take a more involved if/else ladder diverting randomly using the random number, or maybe a different random number. Something like after say X games were played in the same platform/playlist, back out one extra step to get to platform/playlist like and then start the loop over after randomly selecting a new platform/playlist. It would be another step like what was configured for considering if game detail view were enabled/disabled

  • Game On 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.
Add a comment...

×   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...