Advertisement
Himeki

Simplified Auto Lights mk2

Oct 1st, 2012
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.45 KB | None | 0 0
  1. readout = "Awaiting time shift."
  2.  
  3. function clear()
  4.     term.clear()
  5.     term.setCursorPos(1,1)
  6. end
  7.  
  8. while true do
  9.     local ntime = os.time()
  10.     print("Time: "....textutils.formatTime( nTime, false ))
  11.     if (ntime>5.59) and (ntime<18.00) then
  12.         redstone.setOutput("back", false)
  13.         print("Lights off.")
  14.     elseif (ntime<6.00) and (ntime>17.59) then
  15.         redstone.setOutput("back", true)
  16.         print("Lights on.")
  17.     end
  18. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement