Guest User

server

a guest
Sep 30th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.54 KB | None | 0 0
  1. term.clear()
  2. term.setCursorPos(1, 1)
  3.  
  4. textutils.slowPrint("Starting alert server...")
  5.  
  6. local modem = peripheral.wrap("back")
  7. local password = "pass123"
  8.  
  9. modem.open(3000)
  10. modem.open(3001)
  11.  
  12. while true do
  13.   local event, modemSide, senderChannel,
  14.     replyChannel, message, senderDistance = os.pullEvent("modem_message")
  15.   if message == password then
  16.     if senderChannel == 3000 then
  17.       redstone.setOutput("bottom", true)
  18.     end
  19.     if senderChannel == 3001 then
  20.       redstone.setOutput("bottom", false)
  21.     end
  22.   end
  23. end
Advertisement
Add Comment
Please, Sign In to add comment