Advertisement
natie3

Turned stairs

Oct 12th, 2013
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.58 KB | None | 0 0
  1. modem = peripheral.wrap("top")
  2. modem.open(100)
  3.  
  4. function open()
  5.   rs.setOutput("right", false)
  6.   os.sleep(0.2)
  7.   rs.setOutput("bottom", true)
  8. end
  9.  
  10. function close()
  11.   rs.setOutput("bottom", false)
  12.   os.sleep(0.2)
  13.   rs.setOutput("right", true)
  14. end
  15.  
  16. while true do
  17.   event, param1, param2, param3, param4= os.pullEvent()
  18.   if event == "redstone" then
  19.     if rs.getInput("left") then
  20.       open()
  21.       os.sleep(5)
  22.       close()
  23.     end
  24.   elseif event == "modem_message" then
  25.     if param4 == "open" then
  26.       open()
  27.       os.sleep(5)
  28.       close()
  29.     end
  30.   end
  31. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement