Advertisement
Nielsnederlands

monitor

Jul 9th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.63 KB | None | 0 0
  1.  
  2. while true do
  3.  
  4.     local monitor = peripheral.wrap("right")
  5.     monitor.clear()
  6.     monitor.setCursorPos(1, 2)
  7.     monitor.setTextScale(3)
  8.    
  9.     local currentTime = os.time()
  10.     local timeZones = {"Night", "Morning", "Afternoon", "Evening"}
  11.    
  12.     -- night
  13.     if currentTime >= 22 or currentTime < 6 then
  14.         monitor.write(timeZones[1])
  15.     elseif currentTime >= 6 and currentTime < 12 then
  16.         monitor.write(timeZones[2])
  17.     elseif currentTime >= 12 and currentTime < 18 then
  18.         monitor.write(timeZones[3])
  19.     elseif currentTime >= 18 and currentTime < 22 then
  20.         monitor.write(timeZones[5])
  21.     else
  22.         monitor.write(currentTime)
  23.     end
  24.    
  25.     sleep(1)
  26.  
  27. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement