Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- arg = {...}
- assert(#arg == 2,'usage: pistonDoor <2 pistons signal> <4 pistons signal>')
- --Send a signal to open the hidden door
- function open()
- rs.setOutput(arg[1],false)
- os.sleep(0.3)
- rs.setOutput(arg[2],false)
- end
- --Send a signal to close it
- function close()
- rs.setOutput(arg[2],true)
- os.sleep(0.3)
- rs.setOutput(arg[1],true)
- end
- --Waits for a change in redstone signal, once detected it will send signal to open, wait 4 seconds then close. Defaults to staying closed.
- close()
- while true do
- event = os.pullEvent('redstone')
- open()
- os.sleep(4)
- close()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement