Guest User

startup

a guest
May 7th, 2014
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.66 KB | None | 0 0
  1.  
  2. function serumfiller()
  3.   if rs.getInput("bottom") then
  4.     rs.setOutput("back", true)
  5.     sleep(0.05)
  6.     rs.setOutput("back", false)
  7.   end
  8.   sleep(0.3)
  9.   if rs.getInput("top") then
  10.     rs.setOutput("right", true)
  11.     sleep(0.05)
  12.     rs.setOutput("right", false)  
  13.   end
  14. end
  15.  
  16. local on = true
  17. local interval = 3
  18.  
  19. local timer = os.startTimer(0)
  20. while on do
  21.    local event, p1, p2, p3 = os.pullEvent()
  22.    if event == "timer" then
  23.            --Update program
  24.            timer = os.startTimer(interval)
  25.            serumfiller()
  26.    elseif event == "key" then
  27.            if p1 == 45 then --x
  28.                    on = false
  29.            end
  30.    end
  31. end
Advertisement
Add Comment
Please, Sign In to add comment