Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function prog()
- term.setCursorPos(1, 3)
- term.setBackgroundColor(colors.blue)
- term.clear()
- end
- local function register()
- print("Register")
- print("")
- write("user:")
- register_user = read()
- if register_user == "" then
- error("incorrect arguments!")
- else
- reg = fs.open(".user", "w")
- reg.writeLine(register_user)
- write("password:")
- register_password = read("*")
- reg.writeLine(register_password)
- reg.close()
- end
- end
- if fs.exists("tde-desktop") then
- prog()
- if fs.exists(".user") then
- login = true
- openfile = fs.open(".user", "r")
- username = openfile.readLine()
- password = openfile.readLine()
- while login == true do
- write("user:")
- username_w = read()
- write("password:")
- password_w = read("*")
- if username_w == username and password_w == password then
- openfile.close()
- login = false
- else
- print("username or password incorrect!")
- end
- end
- else
- register()
- end
- else
- term.setTextColor(colors.red)
- print("This is not TDE support OS")
- term.setTextColor(colors.white)
- end
- term.setBackgroundColor(colors.black)
- term.clear()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement