Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local modem_pos = "right"
- local protocol = "door_control"
- local device_name = "ramp"
- local redstone_pos = "left"
- rednet.open(modem_pos)
- while true do
- os.pullEvent("redstone")
- if redstone.getAnalogInput(redstone_pos) > 0 then
- os.sleep(5)
- local id = rednet.lookup(protocol, device_name)
- rednet.send(id, "open", protocol)
- os.sleep(3)
- rednet.send(id, "close", protocol)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement