Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- modem = peripheral.wrap("top")
- modem.open(100)
- function open()
- rs.setOutput("right", false)
- os.sleep(0.2)
- rs.setOutput("bottom", true)
- end
- function close()
- rs.setOutput("bottom", false)
- os.sleep(0.2)
- rs.setOutput("right", true)
- end
- while true do
- event, param1, param2, param3, param4= os.pullEvent()
- if event == "redstone" then
- if rs.getInput("left") then
- open()
- os.sleep(5)
- close()
- end
- elseif event == "modem_message" then
- if param4 == "open" then
- open()
- os.sleep(5)
- close()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement