Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- LOCAL VARIABLES --
- local settings = {
- modemDirection = "top",
- period = 2,
- protocol = "PSSWD"
- }
- local passwords = {
- ["L1D"] = "123",
- ["L2D"] = "49a50aaf94",
- ["L3D"] = "g5^'+)(0A43jv9'^3a!aFJA"
- }
- -- LOCAL VARIABLES END --
- rednet.open(settings.modemDirection)
- term.clear()
- term.setCursorPos(1, 1)
- io.write("Password Server Onlinenn")
- while true do
- local id, protocol = rednet.receive()
- if protocol == "@" .. settings.protocol then
- local id2, input = rednet.receive(settings.period)
- if id == id2 then
- local lockType, password = string.match(input, "(%w+):(%w+)")
- io.write("Door " .. id .. "> " .. input .. "n")
- rednet.send(id, passwords[lockType] == password)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement