From: terencehill Date: Wed, 1 Feb 2017 22:00:57 +0000 (+0100) Subject: demotc-race-record-extractor.sh: update race record marker recognition and add suppor... X-Git-Tag: xonotic-v0.8.2~9 X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fxonotic.git;a=commitdiff_plain;h=c74ac8ba7462328db420aea437ec1f978fbfd739 demotc-race-record-extractor.sh: update race record marker recognition and add support for cts and ctf records --- diff --git a/misc/tools/demotc-race-record-extractor.sh b/misc/tools/demotc-race-record-extractor.sh index 7f10290e..2a8a366f 100755 --- a/misc/tools/demotc-race-record-extractor.sh +++ b/misc/tools/demotc-race-record-extractor.sh @@ -4,14 +4,20 @@ case "$2" in old) PATTERN='all-time fastest lap record with (.*)\n' ;; - new|*) - PATTERN='//RA?CE? RECORD SET (.*)\n' + cts) + PATTERN='//cts RECORD SET (.*)\n' + ;; + ctf) + PATTERN='//ctf RECORD SET (.*)\n' + ;; + new|race|rc|*) + PATTERN='//(?:RA?CE?|rc) RECORD SET (.*)\n' ;; esac d=$1 i=0 -demotc.pl grep "$d" "$PATTERN" | while IFS=" " read -r timecode result; do +./demotc.pl grep "$d" "$PATTERN" | while IFS=" " read -r timecode result; do timecode=${timecode%:} result=${result#\"} result=${result%\"} @@ -28,6 +34,6 @@ demotc.pl grep "$d" "$PATTERN" | while IFS=" " read -r timecode result; do timecode_start=`echo "$timecode - $minutes*60 - $seconds - $tenths*0.1 - 2" | bc -l` timecode_end=`echo "$timecode + 2" | bc -l` i=$(($i + 1)) - demotc.pl cut "$d" "playback-$i.dem" "$timecode_start" "$timecode_end" - demotc.pl cut "$d" "capture-$i.dem" "$timecode_start" "$timecode_end" --capture + ./demotc.pl cut "$d" "playback-$i.dem" "$timecode_start" "$timecode_end" + ./demotc.pl cut "$d" "capture-$i.dem" "$timecode_start" "$timecode_end" --capture done