chand1012

Wireless_reactor_controller

Feb 8th, 2017
121
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local modem = peripheral.wrap('top')
  2. modem.open(1200)  -- Open channel 3 so that we can listen on it
  3. while true do
  4.     local event, modemSide, senderChannel, replyChannel, message, senderDistance = os.pullEvent("modem_message")
  5.     print("Received a message on channel: "..senderChannel)
  6.     print("The reactor state was set to: "..message)
  7.     if message == 'True' then
  8.         redstone.setOutput('right', true)
  9.         print("The reactor state was set to True")
  10.     elseif message == 'False' then
  11.         redstone.setOutput('right', false)
  12.         print("The reactor state was set to False")
  13.     else
  14.         print("Message unknown, ignoring")
  15.     end
  16. end
RAW Paste Data