Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Check out the last password script I posted for more comments
- local pullEvent = os.pullEvent --Lines 3,4, and 26 came from the computercraft WIKI
- os.pullEvent = os.pullEventRaw
- local correct= false
- local attempts = 0
- while correct == false do
- print("Password Required")
- if read("*") == "Password" then
- correct = true
- term.clear() --Clear the screen and reset cursor
- term.setCursorPos(1,1)
- else
- attempts = attempts + 1
- term.clear() --Clear the screen and reset cursor
- term.setCursorPos(1,1)
- for i = 5*attempts,0,-1 do --Time increases with all failed attempts
- print("Password Incorrect ".. "Attempts: ".. attempts) --Incorrect password cooldown
- print(i)
- sleep(1)
- term.clear() --Clear the screen and reset cursor
- term.setCursorPos(1,1)
- end
- end
- end
- attempts = 0
- os.pullEvent = pullEvent
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement