You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.3 KiB
Bash

#!/bin/bash
# Dependencies: obs-cli,scummvm, ...
# Scumm vars
scummvm="/usr/games/scummvm"
subs="--subtitles"
fullScreen="--no-fullscreen"
debugLevel="--debuglevel=3"
debugFlag="--debugflags=room"
outFile="/tmp/.debugScummvm.txt"
detect="--auto-detect"
gameDir="--path=$(dirname $0)/game/Laura_Bow_II-Laura_Bow_in_The_Dagger_of_Amon_Ra/RA/"
saveDir="--savepath=$(dirname $0)/game/Laura_Bow_II-Laura_Bow_in_The_Dagger_of_Amon_Ra/SAVES"
extraDir="--extrapath=$(dirname $0)/game/Laura_Bow_II-Laura_Bow_in_The_Dagger_of_Amon_Ra/EXTRAS"
# Obs-cli vars
obsCli="/usr/local/go/bin/obs-cli"
obsHost="--host localhost"
obsPort="--port 4444"
obsPasswd="--password lapasswordquetengas"
# Script vars
skipAutoSwitch="$1" # --just-debug
function main() {
startScummvmDebugRoom
if [ "$skipAutoSwitch" != "--just-debug" ]; then obsSceneAutoSwitch ; fi
}
function startScummvmDebugRoom () {
$scummvm $subs $fullScreen $debugLevel $debugFlag $detect $gameDir $saveDir $extraDir | tee $outFile | grep -i room &
}
function obsSceneAutoSwitch() {
while :
do
room=$(cat $outFile | grep -i "Entering room number " | tail -1 | rev | cut -d " " -f 1 | rev)
if [ "$room" == "$room" ]; then $obsCli $obsHost $obsPort $obsPasswd scene switch $room >/dev/null 2>&1 ; fi
sleep 1
done
}
main