Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --WaffleJohns's countdown timer for Tekkit MC
- --If you want the below values to be entered as you launch the program then try using read() ex: "local h = read()"
- local h = 2
- local m = 29
- local s = 59
- local total = ((h*60*60)+(m*60)+s) --Counts the total seconds
- for i = total,0,-1 do
- s = i%60 --Divides by 60 and gives you the remainder, which happens to be the seconds :)
- term.clear()
- term.setCursorPos(1,1)
- print(h.. ":".. m.. ":".. s)
- if s == 0 then
- m = m-1
- end
- if m == -1 then
- h = h-1
- m = 59
- end
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement