Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Checks for password file------------
- if fs.exists(".tde-password") then --
- file = fs.open(".tde-password", 'r')--
- password = file.readLine() --
- file.close() --
- else --
- password = false --
- end --
- --------------------------------------
- -- Password Checking:
- local function unlock()
- if password then
- term.setBackgroundColor(colors.blue)
- term.setTextColor(colors.yellow)
- write("Password for unlock: ")
- term.setBackgroundColor(colors.blue)
- term.setTextColor(colors.yellow)
- password_check = read("*")
- if password_check == password then
- return true
- end
- else
- return true
- end
- end
- -- lock
- while true do
- term.setBackgroundColor(colors.blue)
- term.setTextColor(colors.white)
- term.clear()
- term.setCursorPos(18, 1)
- write("Computer Locked")
- term.setCursorPos(8, 4)
- local event, button, X, Y = os.pullEventRaw()
- checking = unlock()
- if checking then
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.white)
- term.clear()
- term.setCursorPos(1, 1)
- break
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement