Skip to content

Commit

Permalink
Update speedrun.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
simylein authored Oct 17, 2020
1 parent 91dd527 commit b21e440
Showing 1 changed file with 6 additions and 18 deletions.
24 changes: 6 additions & 18 deletions speedrun.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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

0 comments on commit b21e440

Please sign in to comment.