Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local channel = settings.get "channel" or 0xbee
- local name = settings.get "name" or os.getComputerLabel() or error "name needed"
- local side = settings.get "side" or error "side needed"
- local modem = peripheral.find "modem"
- modem.open(channel)
- while true do
- local _, _, c, rc, msg = os.pullEvent "modem_message"
- if type(msg) == "table" and msg[1] == "toggle" and msg[2] == name then
- print "toggle"
- rs.setOutput(side, true)
- sleep(0.1)
- rs.setOutput(side, false)
- modem.transmit(channel, rc, {"toggled", name})
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement