Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DoorSide = "right" --Side Of Computer The Door Is On
- OpenTime = 5 --Ammount Of Seconds The Door Is Open
- FailuresAllowed = 3 -- Ammount Of Times The Password Can Be Incorrect
- Password = "ChangeMe" --Change The Text But Leave The Quotes
- -- Dont Change The Following Variables
- os.pullEvent = os.pullEventRaw
- FailedAttempts = 0
- function CheckForgivness()
- if fs.exists("NoForgivness") then
- term.setBackgroundColor(colors.red)
- term.clear()
- term.setCursorPos(1, 1)
- print("")
- print("No Forgivness For You")
- sleep(15)
- print("Furbies Are Evil")
- sleep(.5)
- fs.delete("NoForgivness")
- Main()
- else
- Main()
- end
- end
- function Open()
- rs.setOutput(DoorSide, true)
- sleep(OpenTime)
- rs.setOutput(DoorSide, false)
- Main()
- end
- function Main()
- term.setBackgroundColor(colors.gray)
- term.clear()
- term.setCursorPos(1, 1)
- print("Enter Your Password To Open The Door")
- write("> ")
- input = read("|")
- if input == Password then
- print("Password Correct, Opening Door")
- Open()
- Main()
- else
- FailedAttempts = FailedAttempts + 1
- if FailedAttempts == FailuresAllowed then
- term.setBackgroundColor(colors.red)
- term.clear()
- term.setCursorPos(1, 1)
- cf = fs.open("NoForgivness", "w")
- cf.write("Hello Everyone")
- cf.close()
- print("You Have Used All Your Attempts On")
- print(" Incorrect Passwords ")
- print("")
- print(" Now You Must Wait For Forgivness" )
- sleep(10)
- FailedAttempts = 0
- fs.delete("NoForgivness")
- Main()
- else
- print("Incorrect Password")
- print("The Failed Attempts Is Now At "..FailedAttempts)
- sleep(3)
- Main()
- end
- end
- end
- CheckForgivness()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement