RetroFanZ Posted February 8, 2021 Share Posted February 8, 2021 (edited) Hi everybody. Here I come to you because I would like to know if it was possible to make a script to launch such or such core according to the hour? let me explain. take the Nintendo Famicom for example. Nintendo Famicom Dayly.Dll would launch from 7:00 a.m. to 9:00 p.m. Nintendo Famicom Nightly.dll from 9:00 p.m. to 6:00 a.m. Why? All is a question of shaders I have a day version as well as a night version. history of perfecting as much as possible this magnificent front end which is LB / BB thanks for your help if by any chance someone has the solution i think i would be the happiest man! As exemple Day version Night Version Edited February 8, 2021 by RetroFanZ 1 Quote Link to comment Share on other sites More sharing options...
RetroFanZ Posted February 9, 2021 Author Share Posted February 9, 2021 anybody:( Quote Link to comment Share on other sites More sharing options...
JoeViking245 Posted February 9, 2021 Share Posted February 9, 2021 Easiest way (I can think of) is to create a new Emulator similar to the steps listed here: The script portion is, of course going to be different and you'll need to make one for each Platform (or make 1 that's a_litTLe_moRre_coMpLEx). Sample Famicom Platform: romPath = %1% If A_Hour >= 07 and A_Hour <= 21 Run, "D:\Emulators\retroarch\retroarch.exe" -L "D:\Emulators\retroarch\cores\Nintendo Famicom Dayly.Dll" "%romPath%", 1 else Run, "D:\Emulators\retroarch\retroarch.exe" -L "D:\Emulators\retroarch\cores\Nintendo Famicom Nightly.Dll" "%romPath%", 1 Adjust the paths to your retroarch.exe and to your cores. 1 Quote Link to comment Share on other sites More sharing options...
RetroFanZ Posted February 9, 2021 Author Share Posted February 9, 2021 (edited) wow thx i'll try it right now! hey I've change hour for testing but nothing happened. i've create a new emulator in LB called retroarch famicom i'v point everythings correctly and then copy your script in the script hotkey Tab nothing changed ;( Edited February 9, 2021 by RetroFanZ Quote Link to comment Share on other sites More sharing options...
JoeViking245 Posted February 9, 2021 Share Posted February 9, 2021 1 hour ago, RetroFanZ said: and then copy your script in the script hotkey Tab I don't recall writing that step. So we'll start again from scratch (with a little better details). 1) Create a new text file and save it to somewhere you won't forget nor accidentally delete. Say somewhere like "D:\LaunchBox\ThirdParty\AutoHotkey\MyAHKs\" 2) Inside that text file, put: romPath = %1% If A_Hour >= 07 and A_Hour <= 21 Run, "D:\Emulators\retroarch\retroarch.exe" -L "D:\Emulators\retroarch\cores\Nintendo Famicom Dayly.Dll" "%romPath%", 1 else Run, "D:\Emulators\retroarch\retroarch.exe" -L "D:\Emulators\retroarch\cores\Nintendo Famicom Nightly.Dll" "%romPath%", 1 3) Now save the file, but save it with an "ahk" file extension. Say something like "FamicomScript.ahk". (make sure it doesn't save as "FamicomScript.ahk.txt") 4) In LaunchBox, click Tools and select Manage Emulators. 5) Click Add... 6) Under Emulator Name:, give it a name. Say something like "retroarch famicom". 7) Where it says Emulator Application Path: click Browse and navigate to your ../LaunchBox/ThirdParty/AutoHotkey/ folder and select 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. 9) Leave all boxes unchecked. 10) The Sample Command-Line should look like AutoHotkey.exe "D:\LaunchBox\ThirdParty\AutoHotkey\MyAHKs\FamicomScript.ahk" "FULL\PATH\TO\ROM\FILE" 11) Click on the Associated Platforms tab. 12) 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. 13) 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. 14) Click OK. Click Close. 15) Play games. 2 Quote Link to comment Share on other sites More sharing options...
RetroFanZ Posted February 9, 2021 Author Share Posted February 9, 2021 ok thats work but how can i point my configs? Quote Link to comment Share on other sites More sharing options...
RetroFanZ Posted February 9, 2021 Author Share Posted February 9, 2021 (edited) after several tests I decided to run a config backup to verify that the night core was activated and it turns out that apparently it does not take into account the time slot. may be that it only works on time precise.i continue my tests and keep you posted anyway thank you for this very detailed tutorial and the time you devote to me! thanks again Edited February 9, 2021 by RetroFanZ Quote Link to comment Share on other sites More sharing options...
RetroFanZ Posted February 9, 2021 Author Share Posted February 9, 2021 i've try romPath = %1% If A_Hour >= 07 and A_Hour <= 21 Run, "F:\Emulateurs\RetroArch - Sega Saturn\Sega Saturn - Jour\retroarch.exe" -L "F:\Emulateurs\RetroArch - Sega Saturn\Sega Saturn - Jour\cores\Sega Saturn.Dll" "%romPath%", 1 If A_Hour >= 21 and A_Hour <= 07 Run, "F:\Emulateurs\RetroArch - Sega Saturn\Sega Saturn - Nuit\retroarch.exe" -L "F:\Emulateurs\RetroArch - Sega Saturn\Sega Saturn - Nuit\cores\Sega Saturn Nightly.dll" "%romPath%", 1 but it launch both configurations lol.nightly is reconized lol...:) Quote Link to comment Share on other sites More sharing options...
JoeViking245 Posted February 9, 2021 Share Posted February 9, 2021 @RetroFanZ Launches both? That's not good. lol The "and" doesn't seem to doing what [I think] it's supposed to. Also you shouldn't the 2nd "If" statement. Time for Plan "B". romPath = %1% If A_Hour between 07 and 21 Run, "F:\Emulateurs\RetroArch - Sega Saturn\Sega Saturn - Jour\retroarch.exe" -L "F:\Emulateurs\RetroArch - Sega Saturn\Sega Saturn - Jour\cores\Sega Saturn.Dll" "%romPath%", 1 else Run, "F:\Emulateurs\RetroArch - Sega Saturn\Sega Saturn - Nuit\retroarch.exe" -L "F:\Emulateurs\RetroArch - Sega Saturn\Sega Saturn - Nuit\cores\Sega Saturn Nightly.dll" "%romPath%", 1 1 Quote Link to comment Share on other sites More sharing options...
RetroFanZ Posted February 9, 2021 Author Share Posted February 9, 2021 it switch...sometimes day and other time night.LOL have u test it?maybe i'de made a mistake? Quote Link to comment Share on other sites More sharing options...
RetroFanZ Posted February 9, 2021 Author Share Posted February 9, 2021 Ok it dosent' work in the same hour so...i made a test actualy for me it's 23h50. imade different hours for test If A_Hour between 07:01 and 23:48 don't work If A_Hour between 07:01 and 23:00 don't work If A_Hour between 07:01 and 22:59 WORKING So i think we must do If A_Hour between 06:59 and 20:59 for working perfectly. weird bug or just a script can't be precise and see every minutes in the same hour as the absolute same hour. 1 Quote Link to comment Share on other sites More sharing options...
JoeViking245 Posted February 9, 2021 Share Posted February 9, 2021 Well, I didn't change my system clock to test it. lol But ya, finetuning the variables definitely gets it more precise. in fact may want to change the upper limit. If A_Hour between 06:59 and 21:01 That way "7" and "21" are BETWEEN the two in the true sense of the word. 1 Quote Link to comment Share on other sites More sharing options...
RetroFanZ Posted February 9, 2021 Author Share Posted February 9, 2021 Thank you very much my friend.Sincerly! 1 Quote Link to comment Share on other sites More sharing options...
RetroFanZ Posted February 10, 2021 Author Share Posted February 10, 2021 Just a last thing. (sorry) how can we point the config file? Quote Link to comment Share on other sites More sharing options...
JoeViking245 Posted February 10, 2021 Share Posted February 10, 2021 14 hours ago, RetroFanZ said: weird bug or just a script can't be precise and see every minutes in the same hour as the absolute same hour. I looked into this a little... A_Hour only returns a two digit (whole) number (00-23). So we only got "lucky" when we changed what we thought would be the minutes, when in fact it was the 'hour' change (from 23 to 22) that made it work. lol We live and learn. 11 hours ago, RetroFanZ said: how can we point the config file? I don't know what the command line parameter is to load a config file for RetroArch. If you know what is, it can be added to the "Run" statement in the script. But if you're loading different ones for different games (vs different Platforms) it could get tricky. 1 Quote Link to comment Share on other sites More sharing options...
Your Friendly A.I Overlord Posted February 10, 2021 Share Posted February 10, 2021 (edited) retroarch.exe 21 minutes ago, JoeViking245 said: I don't know what the command line parameter is to load a config file for RetroArch. From an example I have: Run, D:\Emulators\RetroArch\retroarch.exe -L D:\Emulators\RetroArch\cores\mednafen_saturn_libretro.dll -c "D:\Emulators\RetroArch\config\mednafen_saturn_libretro.cfg" "D:\Games\Sega Saturn\Daytona USA Championship Circuit Edition (USA)\Daytona USA Championship Circuit Edition (USA).chd" But RetroArch also has a --appendconfig parameter which let you append a custom config to existing configs: --appendconfig PATH Appends a different set of config files to the config file loaded in -c (or default). Multiple config files are delimited by ','. Every config file will be appended in order where the key-value pairs of the next config file takes priority over the old ones. Edited February 10, 2021 by Koroth 1 Quote Link to comment Share on other sites More sharing options...
RetroFanZ Posted February 10, 2021 Author Share Posted February 10, 2021 i found a solution not the easiest but it's ok.creat a retroarch folder per system.we can't ATM point the config file in the config folder so it automaticaly point the co,nfig in the root of retroarch so as example i' create 2 folders Sega Saturn Day and sega Saturn Night.it's preaty cool i can custom my retroachievement sound per system! Quote Link to comment Share on other sites More sharing options...
RetroFanZ Posted February 10, 2021 Author Share Posted February 10, 2021 (edited) i koroth i've test it like that romPath = %1% If A_Hour between 06:59 and 20:59 Run, "F:\Emulateurs\RetroArch\retroarch.exe" -L "F:\Emulateurs\Retroarch\cores\Sega Saturn.Dll" -c "F:\Emulateurs\RetroArch\config\Sega Saturn\Sega Saturn.cfg" "%romPath%", 1 else Run, "F:\Emulateurs\RetroArch\retroarch.exe" -L "F:\Emulateurs\RetroArch\cores\Sega Saturn Nightly.Dll" -c "F:\Emulateurs\RetroArch\config\Sega Saturn Nightly\Sega Saturn Nightly.cfg" "%romPath%", 1 in my principal set up but it launch a command window 1 sec ant nothing Edited February 10, 2021 by RetroFanZ Quote Link to comment Share on other sites More sharing options...
RetroFanZ Posted February 10, 2021 Author Share Posted February 10, 2021 ok.... romPath = %1% If A_Hour between 06:59 and 20:59 Run, "RETROARCH\PATH" -L "CORE\PATH\DAY.Dll" -c "CONFIG\PATH\DAY.cfg" "%romPath%", 1 else Run, "RETROARCH\PATH" -L "CORE\PATH\NIGHT.Dll" -c "CONFIG\PATH\NIGHT.cfg" "%romPath%", 1 Here is the final script Just Works Perfectly. Thx to every one! in fact if u wana do that i separate my config files like that: Retroarch Config Sega Saturn Beetle Saturn Sega Saturn.cfg Sega Saturn - Nightly Beetle Saturn Sega Saturn - Nightly.cfg Super Nintendo Entertainment system SNES9X Super Nintendo Entertainment system.cfg etc...for all my systems just point the config folder in the folder configuration in retroarch. then create 2cores 1 day and 1 night apply the proper shader do each and then save. follow the tutorial above and th' ats it! pretty good not necessary but impressive IMO. Thanks again. 1 1 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.