GraySloth

ComputerCraft: 'clock' Time and Day 24H clock

Feb 6th, 2013
1,278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.43 KB | None | 0 0
  1. --v2.3 by GraySloth 2013-Feb-23
  2. --default is 24-hour time, set militaryTime to false for AM/PM time day to false for no day number
  3. --variables
  4. local militaryTime = true --false is AM/PM time
  5. local day = true --false is no day counter
  6. --main
  7. while true do
  8.    term.clear()
  9.    term.setCursorPos(1,1)  
  10.    print(textutils.formatTime(os.time(),militaryTime))
  11.    if day then
  12.       print("\nDay:"..os.day())
  13.    end
  14.    sleep(1)
  15. end
Advertisement
Add Comment
Please, Sign In to add comment