Tools for measuring mission time without opening game window

master
krzys-h 2014-10-31 21:05:26 +01:00
parent 501cd7026b
commit aa59a22995
2 changed files with 14 additions and 0 deletions

5
tools/mission-time-loop.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/bash
# Works like mission-time.sh but execures in a loop
while [ true ]; do
./mission-time.sh $@
done

9
tools/mission-time.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/bash
# Returns mission time on stdout for a mission given on the commandline
# Make sure the level actually uses MissionTimer, or the script will hang!
colobot -headless -runscene $@ 2>&1 | while read -r line; do
if [[ $line =~ Mission[[:space:]]time:[[:space:]]([0-9:.]*) ]]; then
echo ${BASH_REMATCH[1]}
fi
done