Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --sys2_service_doors_tDoor3x3
- args = { ... }
- local rootId = tonumber(args[1])
- local bootUnitId = tonumber(args[2])
- os.loadAPI("sys/syslib")
- function imp(side)
- redstone.setOutput(side, false)
- redstone.setOutput(side, true)
- sleep(0.1)
- redstone.setOutput(side, false)
- sleep(0.15)
- end
- function chain(sides)
- for i, side in ipairs(sides) do
- imp(side)
- end
- end
- function open()
- chain({"left", "bottom", "top", "right", "top", "left" })
- end
- function close()
- chain({ "left", "bottom", "left" })
- end
- while true do
- local id, msg = syslib.receiveRednet()
- local tag, pts = syslib.getMsgData(msg)
- if tag == "@door" then
- if pts[1] == "open" then
- open()
- elseif pts[1] == "close" then
- close()
- else print("unknown command: " .. pts[1])
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement