AsTio

Light decider

Jun 25th, 2019
82
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local wmodem = peripheral.wrap("top")
  2. local modem = peripheral.wrap("right")
  3. wmodem.open(55002)
  4. sleep(1)
  5. modem.transmit(56002, 3, "ON")
  6. redstone.setOutput("left",false)
  7. while true do
  8.  
  9.  
  10. event, s, f, rf, msg = os.pullEvent("modem_message")
  11.  
  12.  
  13. if msg == "OFF" then
  14.     redstone.setOutput("left",true)
  15.     print(""..msg)
  16.     modem.transmit(56002, 3, "OFF")
  17. end
  18. if msg == "ON" then
  19.     redstone.setOutput("left",false)
  20.     print(""..msg)
  21.     modem.transmit(56002, 3, "ON")
  22. end
  23. end
RAW Paste Data