Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while true do
- term.clear()
- term.setCursorPos(1, 1)
- mon = peripheral.wrap("top")
- mon.clear()
- local user
- term.write("Enter a username: ")
- user = read()
- mon.setCursorPos(3, 1)
- mon.write("User:".. user)
- mon.setCursorPos(3, 2)
- local password1
- term.write("Enter a password: ")
- password1 = read("*")
- redstone.setOutput( "left", true)
- term.clear()
- term.setCursorPos(1, 1)
- print("Closing the door in 5 seconds")
- sleep(5)
- redstone.setOutput( "left", false)
- term.clear()
- term.setCursorPos(1, 1)
- local password2
- print("Enter your password to open the door: ")
- mon.setCursorPos(8, 2)
- password2 = read("*")
- while password1 ~= password2 do
- print("wrong password.")
- sleep(1)
- term.clear()
- term.setCursorPos(1, 1)
- print("Enter your password to open the door: ")
- password2 = read("*")
- end
- if password1 == password2 then
- print("Correct.")
- redstone.setOutput("left", true)
- sleep(5)
- redstone.setOutput("left", false)
- end
- end
Add Comment
Please, Sign In to add comment