May 27, 2015 03:04 PM
(This post was last modified: Jun 1, 2015 01:33 PM by Nakamoto..)
To be honest I don't think I have ever seen a visual countdown timer, had to write this the other day for a tournament. Due to the lack of time to write it I borrowed the numbers from White Lights clock (thats a lot to type out). Anyway if anyone ever needs a timer here you go
Just in case its mutilated by the forum parsing here is a pastebin.
EDIT: Thanks to boosted fixing what I was to lazy to, it is now more accurate and does a full minute instead of losing 1 second off of every minute.
Code
@echo off
title Timer
color 0a
mode con cols=40 lines=8
setlocal enabledelayedexpansion
:starttime
set /p starttime="Enter time in Minutes: "
if %starttime% leq 0 (
echo Invalid input.
goto starttime
)
if %starttime% gtr 60 (
echo Invalid input.
goto starttime
)
:main
set mintime=%starttime%
set sectime=0
:mainloop
cls
call :display
timeout /t 1 >nul
if %sectime% geq 0 (
set /a sectime=%sectime%-1
)
if %sectime% lss 0 (
if %mintime% leq 0 (
goto endtime
) else (
set /a mintime=%mintime%-1
set sectime=59
)
)
goto mainloop
:endtime
cls
echo TIMES UP!
pause >nul
goto starttime
:display
set n1l1= ÛÛ&set n2l1=ÛÛÛÛÛÛÛÛ&set n3l1=ÛÛÛÛÛÛÛÛ&set n4l1=ÛÛ ÛÛ&set n5l1=ÛÛÛÛÛÛÛÛ&set n6l1=ÛÛÛÛÛÛÛÛ&set n7l1=ÛÛÛÛÛÛÛÛ&set n8l1=ÛÛÛÛÛÛÛÛ&set n9l1=ÛÛÛÛÛÛÛÛ&set n0l1=ÛÛÛÛÛÛÛÛ&set nxl1=:::
set n1l2= ÛÛ&set n2l2= ÛÛ&set n3l2= ÛÛ&set n4l2=ÛÛ ÛÛ&set n5l2=ÛÛ &set n6l2=ÛÛ &set n7l2= ÛÛ&set n8l2=ÛÛ ÛÛ&set n9l2=ÛÛ ÛÛ&set n0l2=ÛÛ ÛÛ&set nxl2=:::
set n1l3= ÛÛ&set n2l3= ÛÛ&set n3l3= ÛÛ&set n4l3=ÛÛ ÛÛ&set n5l3=ÛÛ &set n6l3=ÛÛ &set n7l3= ÛÛ&set n8l3=ÛÛ ÛÛ&set n9l3=ÛÛ ÛÛ&set n0l3=ÛÛ ÛÛ&set nxl3=:::
set n1l4= ÛÛ&set n2l4=ÛÛÛÛÛÛÛÛ&set n3l4=ÛÛÛÛÛÛÛÛ&set n4l4=ÛÛÛÛÛÛÛÛ&set n5l4=ÛÛÛÛÛÛÛÛ&set n6l4=ÛÛÛÛÛÛÛÛ&set n7l4= ÛÛ&set n8l4=ÛÛÛÛÛÛÛÛ&set n9l4=ÛÛÛÛÛÛÛÛ&set n0l4=ÛÛ ÛÛ&set nxl4=
set n1l5= ÛÛ&set n2l5=ÛÛ &set n3l5= ÛÛ&set n4l5= ÛÛ&set n5l5= ÛÛ&set n6l5=ÛÛ ÛÛ&set n7l5= ÛÛ&set n8l5=ÛÛ ÛÛ&set n9l5= ÛÛ&set n0l5=ÛÛ ÛÛ&set nxl5=:::
set n1l6= ÛÛ&set n2l6=ÛÛ &set n3l6= ÛÛ&set n4l6= ÛÛ&set n5l6= ÛÛ&set n6l6=ÛÛ ÛÛ&set n7l6= ÛÛ&set n8l6=ÛÛ ÛÛ&set n9l6= ÛÛ&set n0l6=ÛÛ ÛÛ&set nxl6=:::
set n1l7= ÛÛ&set n2l7=ÛÛÛÛÛÛÛÛ&set n3l7=ÛÛÛÛÛÛÛÛ&set n4l7= ÛÛ&set n5l7=ÛÛÛÛÛÛÛÛ&set n6l7=ÛÛÛÛÛÛÛÛ&set n7l7= ÛÛ&set n8l7=ÛÛÛÛÛÛÛÛ&set n9l7= ÛÛ&set n0l7=ÛÛÛÛÛÛÛÛ&set nxl7=:::
if %mintime% geq 10 (
set min1=%mintime:~0,1%
) else (
set min1=0
)
set min2=%mintime:~-1,1%
if %sectime% lss 10 (
set sec1=0
) else (
set sec1=%sectime:~0,1%
)
set sec2=%sectime:~-1,1%
for /l %%a in (1,1,7) do (
call echo %%n!min1!l%%a%% %%n!min2!l%%a%% %%nxl%%a%% %%n!sec1!l%%a%% %%n!sec2!l%%a%%
)
goto :eofEDIT: Thanks to boosted fixing what I was to lazy to, it is now more accurate and does a full minute instead of losing 1 second off of every minute.

