sasaa86

CC-switch

Feb 1st, 2021
816
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.57 KB | None | 0 0
  1. modem = peripheral.wrap("top")
  2. term.clear()
  3. rs.setOutput("bottom", true)
  4.  
  5. local mob = "Wither"
  6. local channel = 32
  7. modem.open(channel)
  8.  
  9. print("  computer id: ".. os.getComputerID())
  10. print("  Spawner:     ".. mob)
  11. print("  modem-kanaal ".. channel)
  12.  
  13. while true do
  14.     local event, modemSide, senderChannel, replyChannel, message, senderDistance = os.pullEvent("modem_message")
  15.     if (message == mob.."-off") then
  16.         rs.setOutput("bottom", true)
  17.     end
  18.     if (message == mob.."-on") then
  19.         rs.setOutput("bottom", false)
  20.     end
  21.     os.sleep(0.1)
  22. end
Advertisement
Add Comment
Please, Sign In to add comment