Advertisement
speedSpider3

CC Redstone Timer

Aug 20th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.55 KB | None | 0 0
  1. TIME = 300 -- input your time (in seconds)
  2. running = true
  3.  
  4. while running do
  5.  local time = TIME
  6.  while time > 0 do
  7.   print(time.." seconds remaining")
  8.   local first = os.startTimer(1)
  9.   while true do
  10.    local event, timerID = os.pullEvent("timer")
  11.    if timerID == first then
  12.      time = time - 1
  13.      break
  14.    end
  15.   end
  16.  end
  17.  local second = os.startTimer(1)
  18.  rs.setAnalogOutput("left", 15)
  19.  while true do
  20.   local event, timerID = os.pullEvent("timer")
  21.   if timerID == second then
  22.    break
  23.   end
  24.  end
  25.  rs.setAnalogOutput("left", 0)
  26. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement