Advertisement
Guest User

ambient

a guest
Jul 4th, 2014
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.67 KB | None | 0 0
  1. m = peripheral.wrap("left")
  2.  
  3. m.setBackgroundColor(colors.black)
  4. m.clear()
  5. m.setTextScale(0.5)
  6.  
  7. while true do
  8. --shell.run("clear")
  9. local time = os.time()
  10. --local formattedTime = textutils.formatTime(time,true)
  11.  
  12. m.clear()
  13. m.setCursorPos(5,1)
  14. m.setTextColor(colors.blue)
  15. m.write("GEODATA")
  16.  
  17. if time > 5 and time < 6 then
  18. t = "SUNRISE"
  19.  
  20. elseif time > 6 and time < 12 then
  21. t = "MORNING"
  22.  
  23. elseif time > 12 and time < 18 then
  24. t = "AFTERNOON"
  25.  
  26. elseif time > 18 and time < 19.5 then
  27. t = "SUNSET"
  28.  
  29. elseif time > 19.5 and time < 21 then
  30. t = "EVENING"
  31.  
  32. else
  33. t = "NIGHT"
  34. end
  35.  
  36.  
  37. m.setTextColor(colors.lime)
  38. m.setCursorPos(1,3)
  39. m.write("TIME: "..t)
  40. sleep(.5)
  41. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement