Advertisement
RemiCraft

Remote Door Server

Jun 29th, 2021 (edited)
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.48 KB | None | 0 0
  1. local modem = peripheral.wrap("back")
  2. local password = "123"
  3. local channel = 20
  4. --------------------
  5. modem.open(channel)
  6. while true do
  7.  local event, modemSide, senderChannel, replyChannel, message, senderDistance = os.pullEvent("modem_message")
  8.   if message == password then
  9.    modem.transmit(channel, channel, "accepted")
  10.    print("password accepted")
  11.   else
  12.     modem.transmit(channel, channel, "denied")
  13.     print ("password denied (" ..message.. ")")
  14.   end
  15.  sleep(0.1)
  16. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement