Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local locker = true
- local failed = true
- local attempted_login = true
- local password_server = 0 -- change to the ID of your password server computer
- rednet.open("back") -- change to the side your rednet modem is on
- while locker do
- attempted_login = false
- term.clear()
- term.setCursorPos(1,1)
- print("Welcome Roaming Profile Enabled")
- print("What would you like to do?")
- print("[1] Login (*)")
- print("[2] Open door")
- print("[3] Shutdown")
- write("> ")
- local input = read()
- if input == "3" then
- os.shutdown()
- elseif input == "1" or input == "2" then
- attempted_login = true
- print("Please login...")
- write("Username: ")
- local username = read()
- write("Password: ")
- local password = read("*")
- rednet.send(password_server, password , true)
- senderId, message, distance = rednet.receive(5)
- if username == message then
- failed = false
- locker = false
- term.clear()
- term.setCursorPos(1,1)
- print("Welcome ", username)
- if input == "2" then
- redstone.setOutput("right","true")
- sleep(4)
- redstone.setOutput("right","false")
- locker = true
- end
- else
- print("Invalid Username or Password.")
- sleep(3)
- end
- else
- print("Command not recognised...")
- sleep(2)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement