Advertisement
Guest User

showtime

a guest
Apr 10th, 2020
282
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.51 KB | None | 0 0
  1. local mon = peripheral.wrap("monitor_6")
  2.  
  3. mon.setBackgroundColor(colors.black)
  4. mon.clear()
  5.  
  6. while true do
  7.   sleep(1)
  8.   print(os.time())
  9.   mon.setCursorPos(2,2)
  10.   --mon.write(os.time())
  11.  
  12.   if os.time() > 6 and os.time() < 19 then
  13.     mon.setBackgroundColor(colors.blue)
  14.     mon.clear()
  15.     mon.write(" Day")
  16.   else
  17.     mon.setBackgroundColor(colors.black)
  18.     mon.clear()
  19.     mon.write("Night")
  20.   end
  21.  
  22.   mon.setCursorPos(1,4)
  23.   mon.write(textutils.formatTime(os.time(), false))
  24.  
  25.      
  26. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement