Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Short Circuit's Lua Timer applet
- Time cap: 99 hours, 59 minutes, 59 seconds
- ]]--
- function sleep( n )
- if n > 0 then
- os.execute( "ping -n " .. tonumber( n + 1 ) .. " localhost > NUL" )
- end
- end
- -- Init varialbes
- s1, s2, m1, m2, h1, h2 = 0, 0, 0, 0, 0, 0
- os.execute( "color F" )
- while true do
- if s1 > 9 then
- s1 = 0
- s2 = s2 + 1
- end
- if s2 > 5 then
- s2 = 0
- m1 = m1 + 1
- end
- if m1 > 9 then
- m1 = 0
- m2 = m2 + 1
- end
- if m2 > 5 then
- m2 = 0
- h1 = h1 + 1
- end
- if h1 > 9 then
- h1 = 0
- h2 = h2 + 1
- end
- if h2 == 9 and h1 == 9 and m2 == 5 and m1 == 9 and s2 == 5 and s1 == 9 then
- print( "Time cap reached!" )
- os.execute( "pause" )
- end
- os.execute( "cls" )
- print( "Time elapsed: " .. h2 .. h1 .. ":" .. m2 .. m1 .. ":" .. s2 .. s1 )
- print( "Time remaining: " .. 9 - h2 .. 9 - h1 .. ":" .. 5 - m2 .. 9 - m1 .. ":" .. 5 - s2 .. 9 - s1 )
- sleep( 1 )
- s1 = s1 + 1
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement