Advertisement
Guest User

Untitled

a guest
Jan 16th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. -- LOCAL VARIABLES --
  2.  
  3. local settings = {
  4. modemDirection = "top",
  5. period = 2,
  6. protocol = "PSSWD"
  7. }
  8.  
  9. local passwords = {
  10. ["L1D"] = "123",
  11. ["L2D"] = "49a50aaf94",
  12. ["L3D"] = "g5^'+)(0A43jv9'^3a!aFJA"
  13. }
  14.  
  15. -- LOCAL VARIABLES END --
  16.  
  17. rednet.open(settings.modemDirection)
  18.  
  19. term.clear()
  20. term.setCursorPos(1, 1)
  21. io.write("Password Server Onlinenn")
  22.  
  23. while true do
  24. local id, protocol = rednet.receive()
  25.  
  26. if protocol == "@" .. settings.protocol then
  27. local id2, input = rednet.receive(settings.period)
  28.  
  29. if id == id2 then
  30. local lockType, password = string.match(input, "(%w+):(%w+)")
  31.  
  32. io.write("Door " .. id .. "> " .. input .. "n")
  33. rednet.send(id, passwords[lockType] == password)
  34. end
  35. end
  36. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement