RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    1. Home
    2. Tags
    3. scripting
    Log in to post
    • All categories
    • R

      External triggers from runcommand-onstart.sh

      Watching Ignoring Scheduled Pinned Locked Moved Help and Support runcommand scripting bash
      5
      0 Votes
      5 Posts
      809 Views
      S

      @Rens I think you're asking what parameters are passed to the onstart/onend scripts. It is just the four mentioned in the docs: $1 = system, $2 = emulator, $3 = rom path and $4 = command

      https://retropie.org.uk/docs/Runcommand/#runcommand-scripts

      Useful data are passed as arguments to these scripts:

      $1 - the system (eg: atari2600, nes, snes, megadrive, fba, etc). $2 - the emulator (eg: lr-stella, lr-fceumm, lr-picodrive, pifba, etc). $3 - the full path to the rom file. $4 - the full command line used to launch the emulator.

      You can see here, for example, the runcommand-onstart.sh and others are called with the user_script function:

      user_script "runcommand-onstart.sh"

      The function:

      https://github.com/RetroPie/RetroPie-Setup/blob/cdb2bda29fab4cae57ca5bf283f87620ab4be851/scriptmodules/supplementary/runcommand/runcommand.sh#L1300

      # calls script with parameters SYSTEM, EMULATOR, ROM, and commandline function user_script() { local script="$CONFIGDIR/all/$1" if [[ -f "$script" ]]; then bash "$script" "$SYSTEM" "$EMULATOR" "$ROM" "$COMMAND" </dev/tty 2>>"$LOG" fi }

      The meat is here:

      bash "$script" "$SYSTEM" "$EMULATOR" "$ROM" "$COMMAND" </dev/tty 2>>"$LOG"

      As you can see, only the four parameters "$SYSTEM" "$EMULATOR" "$ROM" "$COMMAND" are passed to $script

    • R

      How should I find the current audio device ?

      Watching Ignoring Scheduled Pinned Locked Moved Help and Support audio device scripting
      1
      0 Votes
      1 Posts
      326 Views
      No one has replied
    • 3Draco3

      Web file server for game manuals different way

      Watching Ignoring Scheduled Pinned Locked Moved Ideas and Development manuals web server scripting all systems
      1
      1 Votes
      1 Posts
      345 Views
      No one has replied
    • S

      Smart joystick auto configuration mapping (raspberry -retropie - attract mode)

      Watching Ignoring Scheduled Pinned Locked Moved Ideas and Development attractmode raspberrypi scripting joypads joystick
      1
      0 Votes
      1 Posts
      859 Views
      No one has replied
    • R

      Using custom script that is not runcommand.sh does not work

      Watching Ignoring Scheduled Pinned Locked Moved Help and Support scripting
      36
      0 Votes
      36 Posts
      4k Views
      R

      @Folly @sleve_mcdichael Alright, it's done. I present to you the script to load games based off of their filenames. This is the version I have, and it works very well. The selection is limited, but the good news is you can select for yourself what file types are supported. Have fun!

      #!/bin/bash rom="$1" if [ "${1: -4}" == ".chd" ] then /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ psx "$1" elif [ "${1: -4}" == ".bin" ] || [ "${1: -3}" == ".md" ] then /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ megadrive "$1" elif [ "${1: -4}" == ".nes" ] then /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ nes "$1" elif [ "${1: -4}" == ".smc" ] || [ "${1: -4}" == ".sfc" ] then /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ snes "$1" elif [ "${1: -4}" == ".z64" ] then /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ n64 "$1" elif [ "${1: -4}" == ".gba" ] then /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ gba "$1" elif [ "${1: -4}" == ".zip" ] then /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ mame-libretro "$1" elif [ "${1: -3}" == ".gb" ] then /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ gb "$1" elif [ "${1: -4}" == ".gbc" ] then /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ gbc "$1" elif [ "${1: -4}" == ".fds" ] then /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ fds "$1" elif [ "${1: -4}" == ".nds" ] then /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ nds "$1" fi
    • zerobyzeroZ

      Start EmulationStation on last game selected before closing?

      Watching Ignoring Scheduled Pinned Locked Moved Help and Support scripting
      2
      0 Votes
      2 Posts
      304 Views
      mituM

      @zerobyzero said in Start EmulationStation on last game selected before closing?:

      So, I'd like to know whether now in 2022 is there any way to achieve exactly that, when starting ES, having selected the last game that was selected before closing ES the previous gaming session.

      There's no such feature yet. However, using the 'Last Played' collection and setting EmulationStation to automatically open it on start would position you on the last played game right after start.

    • S

      system-select script not called

      Watching Ignoring Scheduled Pinned Locked Moved Help and Support scripting
      4
      0 Votes
      4 Posts
      473 Views
      mituM

      Update your EmulationStation package and try again.

    • N

      Tell another device what game is playing

      Watching Ignoring Scheduled Pinned Locked Moved Help and Support retropie 4.7.1 emulationstaton scripting addons
      3
      0 Votes
      3 Posts
      880 Views
      LolonoisL

      @nohitter151 There is also a different way. ES has script callouts for some events: https://retropie.org.uk/docs/EmulationStation/#scripting

      Put your scripts in your favorite language in the respective folder. Make them executable (chmod a+x <script>) and you should be ready to go. With the values of %rom_path% %rom_name% (first and second parameter inputted to your script you can locate the respective entry in the gamelist.xml which leads you to the artwork.

      PS: Welcome to this forum :)

    • T

      Quitting a game via command line / ssh

      Watching Ignoring Scheduled Pinned Locked Moved Help and Support scripting ssh
      9
      0 Votes
      9 Posts
      1k Views
      T

      @mitu ah perfect that worked too, thank you very much!

    • ExarKunIvE

      testing custom script

      Watching Ignoring Scheduled Pinned Locked Moved Help and Support scripting script testing
      5
      0 Votes
      5 Posts
      549 Views
      ExarKunIvE

      @mitu i dont think its a dependency. it is something that the guys who made OpenMW, built to help with the running the game

      this is what quicksliver said about in on the forum page about installing OpenMW

      Also a couple notes about running OpenMW on the raspberry pi. You cant use open scene graph from the apt repository, it has to be manually compiled against OpenGL NOT OpenGL ES otherwise the game will not run. OpenMW devs recommend using their fork of OSG for better performance though that is not strictly necessary (I used their fork and it works great https://github.com/OpenMW/osg). The following cmake arguments can be used to prevent building unneeded OSG plugins and prevent bloat

    • AshpoolA

      Project VPC (some personal python scripts)

      Watching Ignoring Scheduled Pinned Locked Moved Projects and Themes filtering mamedat scripting viewport
      4
      0 Votes
      4 Posts
      821 Views
      AshpoolA

      @Rion Thanks for the Feedback...
      But as this was a rushed release, because of me trying to be helpfull, it has taken me a while to come up with the next step...

      The VPCalc script itself was ready in the time I opened this topic, but me and readmes are only friends in context of me reading them, not writing such.... (and then, in (CP)2020 CP2077 came to be)... well, as life is passing by, instead of having the filter scripted and at least in beta stage by now, I may have that one ready in 202101/02 ... here we are with the viewport calculator: Project VPC: VPCalc at least. ...

      As I had to use used some markdown/html patchwork to create the readme which is, so far and for now, working on git, but unusable here.... I am only providing the link for now...

      Edit: And a look at the UI:
      VPCalc-UI

      Besides me living in Night City at the moment, the UI for the filtering App/Script is in its alpha and ready to be populated/used by/with further scripting.... sneak preview:

      VPC_DatFilter.png

    • ectoE

      Web file server for game manuals (scummvm, dosbox, ...)

      Watching Ignoring Scheduled Pinned Locked Moved Ideas and Development manuals ms-dos scripting scummvm web server
      6
      2 Votes
      6 Posts
      1k Views
      F

      @ecto said in Web file server for game manuals (scummvm, dosbox, ...):

      Yes that's right! :D So far, when I select a pdf manual, it will be downloaded to the pad/phone for reading while I play. This way I can chack for copy protections and/or clues while I play a game on the Retropie.

      At first I was thinking that you could read the manual before you were going to play. but this is indeed better.

      Have you read my thread on translation ?
      https://retropie.org.uk/forum/topic/28461/translate-games-on-the-fly
      While thinkering with this I also discovered this :
      https://retropie.org.uk/forum/topic/28345/old-computer-appreciation-thread/420

      Perhaps an idea for you to tinker with.
      In theory you could match the sum of a screenshot, with extra information. and output it back in speech or as an overlay in the game.

    • S

      scripting question

      Watching Ignoring Scheduled Pinned Locked Moved Help and Support stretch scripting raspbian sh files
      2
      0 Votes
      2 Posts
      297 Views
      mituM

      Post your script.

    • R

      Help with .sh scripts and global variables

      Watching Ignoring Scheduled Pinned Locked Moved Help and Support variable scripting help me please
      3
      0 Votes
      3 Posts
      329 Views
      R

      @mitu thank you for your reply, sorry i was distracted for a few days. I didnt figure out how to make variables work but i was able to make a txt file that i could read/write as a varriable so im good now.

    • W

      I'd like the Retropie to power on our Xbox and switch to its OneGuide app

      Watching Ignoring Scheduled Pinned Locked Moved Help and Support python scripting xbox
      4
      0 Votes
      4 Posts
      374 Views
      mituM

      @WesleyBidsnipes said in I'd like the Retropie to power on our Xbox and switch to its OneGuide app:

      @mitu It's been years since I've messed with udev... does that work with Bluetooth as well? We have one of the Playstation 3 wireless controllers, I think it's the Sixaxis.

      It should work.

    • T

      Trouble using EmulationStation Scripting

      Watching Ignoring Scheduled Pinned Locked Moved Help and Support scripting
      1
      0 Votes
      1 Posts
      179 Views
      No one has replied
    • BuZzB

      Humble Book Bundle: Linux & UNIX by O'Reilly

      Watching Ignoring Scheduled Pinned Locked Moved General Discussion and Gaming linux books scripting
      1
      0 Votes
      1 Posts
      398 Views
      No one has replied
    • W

      RGB LED marquee

      Watching Ignoring Scheduled Pinned Locked Moved Help and Support scripting rgb led matrix runcommand emulationstaion
      9
      0 Votes
      9 Posts
      2k Views
      alinkeA

      here's a couple projects I've done with an LED matrix marquee

      RetroPie based ==>https://www.instructables.com/id/Vertical-Bartop-Arcade-With-Integrated-PIXEL-LED-D/

      PC Based ==>https://www.instructables.com/id/Arcade-Machine-With-Changing-LED-Marquee/

      Here's a guide for setting up this LED marquee and RetroPie ==>http://ledpixelart.com/files/retropie/ .

      Runcommand onstart and onend is used here. When a new game is launched, a script runs which passes the rom name to the LED marquee software (http://pixelcade.org) which is then displayed on the panels. Both still image PNGs and GIF animations can be displayed by game.

      This project also includes artwork that has been manually re-mastered for 128x32 for that classic 8-bit look. Disclaimer, I'm the creator for this project and sell these as kits.

      alt text
      alt text
      alt text
      alt text
      alt text

    • Azsorlex26A

      Setting up RetroPie without using the gui

      Watching Ignoring Scheduled Pinned Locked Moved Help and Support retropie setup scripting
      6
      0 Votes
      6 Posts
      2k Views
      mituM

      @azsorlex26 Each package exposes a standard set of commands to be executed - sources, build, install, remove, configure. Most packages have these options, there might be packages with special functions.
      Look at https://github.com/RetroPie/RetroPie-Setup/blob/master/scriptmodules/packages.sh#L55 and https://github.com/RetroPie/RetroPie-Setup/blob/bfaedb92cb86335b7fec34d23fb39890455ae05f/scriptmodules/packages.sh#L162 to see how the retropie_packages.sh script works.

    • Azsorlex26A

      Trouble with setting up RetroPie in a custom script

      Watching Ignoring Scheduled Pinned Locked Moved Help and Support retropie setup scripting raspberrypi 3b
      8
      0 Votes
      8 Posts
      800 Views
      ?

      @jonnykesh I apologize. I was in a hurry and it kept telling me I needed someone else to