Advertisement
Guest User

clock

a guest
Sep 2nd, 2014
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.35 KB | None | 0 0
  1. local value = -1
  2. while true do
  3.   local hour = math.floor(os.time())
  4.   if hour > 12 then hour = hour - 12 end
  5.   if hour == 0 then hour = 12 end
  6.   if hour ~= value then
  7.     rs.setAnalogOutput('back',hour)
  8.     print(''..hour..' <- '..textutils.formatTime(os.time()))
  9.     --if value ~= -1 then sleep(40) end
  10.     value = hour
  11.   end
  12.   sleep(1)
  13. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement