Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- password = "bitchbetrippin"
- guesses = 0
- greeting = "%DESCRIPTION%"
- lockTime = 10
- timeLeft = lockTime
- GUESS_LIMIT = 3
- --
- --This will tell the user if the guesses left, and if the password is wrong
- --
- while guesses < GUESS_LIMIT do
- term.clear()
- term.setCursorPos(1,1)
- write(greeting.."\n\n")
- write(GUESS_LIMIT - guesses.." attempts remaining\n\n")
- write("Incorrect Password. Please try again!\n\n\n")
- --
- --This will ask the user to enter a password from the above variable
- --
- write("Please enter password: ")
- guess = read("*")
- --
- --If the password is correct it will turn the bottom output of the monitor to on, then off incrementally until the
- --door is open, defined by the amount of spaces it this should be changed it will then close the door with the same --amount of spaces
- --
- if guess == password then
- redstone.setBundledOutput("bottom", colors.orange)
- sleep(1)
- redstone.setBundledOutput("bottom", 0)
- sleep(1)
- redstone.setBundledOutput("bottom", colors.orange)
- sleep(1)
- redstone.setBundledOutput("bottom", 0)
- sleep(1)
- redstone.setBundledOutput("bottom", colors.orange)
- sleep(1)
- redstone.setBundledOutput("bottom", 0)
- sleep(1)
- redstone.setBundledOutput("bottom", colors.orange)
- sleep(1)
- redstone.setBundledOutput("bottom", 0)
- sleep(1)
- redstone.setBundledOutput("bottom", colors.orange)
- sleep(1)
- redstone.setBundledOutput("bottom", 0)
- sleep(1)
- redstone.setBundledOutput("bottom", colors.orange)
- sleep(1)
- redstone.setBundledOutput("bottom", 0)
- sleep(1)
- redstone.setBundledOutput("bottom", colors.orange)
- sleep(1)
- redstone.setBundledOutput("bottom", 0)
- sleep(1)
- redstone.setBundledOutput("bottom", colors.orange)
- sleep(1)
- redstone.setBundledOutput("bottom", 0)
- sleep(1)
- redstone.setBundledOutput("bottom", colors.orange)
- sleep(1)
- redstone.setBundledOutput("bottom", 0)
- sleep(1)
- redstone.setBundledOutput("bottom", colors.orange)
- sleep(1)
- redstone.setBundledOutput("bottom", 0)
- sleep(10)
- redstone.setBundledOutput("bottom", colors.white)
- sleep(1)
- redstone.setBundledOutput("bottom", 0)
- sleep(1)
- redstone.setBundledOutput("bottom", colors.white)
- sleep(1)
- redstone.setBundledOutput("bottom", 0)
- sleep(1)
- redstone.setBundledOutput("bottom", colors.white)
- sleep(1)
- redstone.setBundledOutput("bottom", 0)
- sleep(1)
- redstone.setBundledOutput("bottom", colors.white)
- sleep(1)
- redstone.setBundledOutput("bottom", 0)
- sleep(1)
- redstone.setBundledOutput("bottom", colors.white)
- sleep(1)
- redstone.setBundledOutput("bottom", 0)
- sleep(1)
- redstone.setBundledOutput("bottom", colors.white)
- sleep(1)
- redstone.setBundledOutput("bottom", 0)
- sleep(1)
- redstone.setBundledOutput("bottom", colors.white)
- sleep(1)
- redstone.setBundledOutput("bottom", 0)
- sleep(1)
- redstone.setBundledOutput("bottom", colors.white)
- sleep(1)
- redstone.setBundledOutput("bottom", 0)
- sleep(1)
- redstone.setBundledOutput("bottom", colors.white)
- sleep(1)
- redstone.setBundledOutput("bottom", 0)
- sleep(1)
- redstone.setBundledOutput("bottom", colors.white)
- sleep(1)
- redstone.setBundledOutput("bottom", 0)
- sleep(4)
- os.reboot()
- --
- --If the password is incorrect it will lock the screen for the amount of time set above and then reboot
- --
- else
- guesses = guesses + 1
- term.clear()
- term.setCursorPos(1,1)
- write("Password Incorrect")
- end
- end
- while timeLeft > 0 do
- term.clear()
- term.setCursorPos(1,1)
- write("Number of permitted guesses exceeded.\n\nLocking Terminal for "..timeLeft.." seconds.")
- timeLeft = timeLeft - 1
- sleep(1)
- os.reboot()
- end
- os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement