From b21e4404400ecad45c18f13048a1962701cc8cef Mon Sep 17 00:00:00 2001 From: simylein <67859356+simylein@users.noreply.github.com> Date: Sun, 18 Oct 2020 01:00:32 +0200 Subject: [PATCH] Update speedrun.sh --- speedrun.sh | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/speedrun.sh b/speedrun.sh index 0166db7..9befb59 100644 --- a/speedrun.sh +++ b/speedrun.sh @@ -69,7 +69,6 @@ dragondeath="Free the End" screenlog="screenlog.0" counter="0" while [ ${counter} -lt 12000 ]; do # while under 3 hours and 20 minutes do loop - if [[ ! -z $(grep "$dragondeath" "$screenlog") ]]; then # if dragon is killed output time and reset server let "hours=counter/3600" if (( ${hours} < 10 )); then hours=0${hours} @@ -82,28 +81,17 @@ while [ ${counter} -lt 12000 ]; do # while under 3 hours and 20 minutes do loop if (( ${seconds} < 10 )); then seconds=0${seconds} fi + if [[ ! -z $(grep "$dragondeath" "$screenlog") ]]; then # if dragon is killed output time and reset server echo "Challange has been completed in ${hours}:${minutes}:${seconds}" # command line time output screen -Rd ${servername} -X stuff "say Challange has been completed in ${hours}:${minutes}:${seconds}$(printf '\r')" # ingame time output screen -Rd ${servername} -X stuff "gamemode spectator @a$(printf '\r')" ./reset.sh # execution of the reset script - break + break fi - if [ $((counter%240)) -eq 0 ]; then # output time every 4 minutes - let "hours=counter/3600" - if (( ${hours} < 10 )); then - hours=0${hours} - fi - let "minutes=(counter%3600)/60" - if (( ${minutes} < 10 )); then - minutes=0${minutes} - fi - let "seconds=(counter%3600)%60" - if (( ${seconds} < 10 )); then - seconds=0${seconds} - fi - echo "Time elapsed: ${hours}:${minutes}:${seconds}" # command line time output - screen -Rd ${servername} -X stuff "say Time elapsed: ${hours}:${minutes}:${seconds}$(printf '\r')" # ingame time output - fi + if [ $((counter%240)) -eq 0 ]; then # output time every 4 minutes + echo "Time elapsed: ${hours}:${minutes}:${seconds}" # command line time output + screen -Rd ${servername} -X stuff "say Time elapsed: ${hours}:${minutes}:${seconds}$(printf '\r')" # ingame time output + fi counter=$((counter+1)) sleep 1s done