Advertisement
CastleMan2000

Timekeep

Apr 25th, 2014
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.40 KB | None | 0 0
  1. while true do
  2.   term.clear()
  3.   term.setCursorPos(1,1)
  4.  
  5.   local sTime = string.reverse(os.time())
  6.   time = string.sub(sTime, 2)
  7.  
  8.   print("Day since creation: "..os.day())
  9.   print("Time of day:"..string.reverse(sTime))
  10.   local nTime = os.time()
  11.  
  12.   if nTime >= 19.5 or nTime < 5.75 then
  13.     print("NIGHT")
  14.   elseif nTime >= 5.75 and nTime < 19.5 then
  15.     print("DAY")
  16.   end
  17.  
  18.   sleep(0.1)
  19. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement