Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --This password will be "cypherd" (Not really) so people dont just go "edit startup" and see it, the cypher is pretty weak but will discourage most people
- --Use https://pastebin.com/qa1HP7X2 to find the cyphers
- local pullEvent = os.pullEvent --Lines 3,4, and 26 came from the computercraft WIKI
- os.pullEvent = os.pullEventRaw
- local correct= false
- local attempts = 0
- local iPassword --Inputed password
- local cPassword --Output password
- while correct == false do
- print("Password Required")
- iPassword = read()
- iPassword = string.byte(iPassword)
- iPassword = (iPassword*24^2/3+23%3)+(-iPassword*80%4) --This is the "hash"
- if iPassword == 15362 then --15362 is the encrypted version of "Password"
- 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