DerMarten

ttet

Jul 27th, 2015
199
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local modem = peripheral.wrap("back")
  2. modem.open(1)--Open channel 3 so that we can listen on it
  3. while true do
  4.     if rs.getInput("bottom") then
  5.         local event, modemSide, senderChannel, replyChannel, message, senderDistance = os.pullEvent("modem_message")
  6.         if event == "modem_message" then
  7.             if message == "Strom_aus" then
  8.                 rs.setOutput("top",true)
  9.                 modem.close(1)
  10.                 modem.transmit(1,1, "Strom")
  11.                 modem.open(1)
  12.                 sleep(0.1)
  13.             else
  14.                 rs.setOutput("top",false)
  15.                 sleep(0.1)
  16.             end
  17.         end
  18.     sleep(0.1)
  19.     end
  20. end
RAW Paste Data