Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function pasrep(paas)
- local sec = 0
- for i = 1,string.len(paas)-1 do
- sec = sec + string.byte(paas, i)
- end
- sec = sec*string.byte (paas, string.len(paas))
- return sec
- end
- rs.setOutput("left",true)
- sleep(1)
- local opentime = 10
- local side = "left"
- local password = 45576
- term.clear()
- term.setCursorPos(1,1)
- write("Password: ")
- local input = read("*")
- if pasrep(input) == password then
- term.clear()
- term.setCursorPos(1,1)
- print("ok")
- rs.setOutput(side,false)
- sleep(opentime)
- rs.setOutput(side,true)
- os.reboot()
- else
- print(pasrep(input))
- print(password)
- term.clear()
- term.setCursorPos(1,1)
- print("Password incorrect!")
- sleep(2)
- os.reboot()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement