Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local modem = peripheral.wrap('top')
- modem.open(2)
- while true do
- local event, modemSide, senderChannel, replyChannel, message, senderDistance = os.pullEvent('modem_message')
- if message == 'on' then
- redstone.setOutput('bottom',true)
- modem.transmit(replyChannel, 2, 'turned on')
- elseif message == 'off' then
- redstone.setOutput('bottom',false)
- modem.transmit(replyChannel, 2, 'turned off')
- else
- modem.transmit(replyChannel, 2, 'invalid message')
- end
- end
Add Comment
Please, Sign In to add comment