Advertisement
RabaGhast

gateController_2

Oct 20th, 2016
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.52 KB | None | 0 0
  1. sleepTime = 0.1
  2. timeLeft = 3
  3. gateTime = 3
  4.  
  5. while true do
  6.   --shell.run("clear")
  7.   if rs.getInput("bottom") or rs.getInput("back") then
  8.     timeLeft = gateTime
  9.   end
  10.   while timeLeft > 0 do
  11.     print(timeLeft)
  12.     if rs.getInput("bottom") or rs.getInput("back") then
  13.       timeLeft = gateTime
  14.       print("redstone ON")
  15.       rs.setOutput("top", true)
  16.     else
  17.       print("redstone OFF")
  18.     end
  19.     sleep(sleepTime)
  20.     timeLeft = timeLeft - sleepTime
  21.   end
  22.   rs.setOutput("top", false)
  23.   os.pullEvent("redstone")
  24. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement