Advertisement
AsTio

Light decider

Jun 25th, 2019
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.49 KB | None | 0 0
  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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement