Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local modem = peripheral.wrap('top')
- modem.open(1200) -- Open channel 3 so that we can listen on it
- while true do
- local event, modemSide, senderChannel, replyChannel, message, senderDistance = os.pullEvent("modem_message")
- print("Received a message on channel: "..senderChannel)
- print("The reactor state was set to: "..message)
- if message == 'True' then
- redstone.setOutput('right', true)
- print("The reactor state was set to True")
- elseif message == 'False' then
- redstone.setOutput('right', false)
- print("The reactor state was set to False")
- else
- print("Message unknown, ignoring")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement