Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Lock for CUBI0S 2.0--
- --Formating screen--
- term.clear()
- term.setBackgroundColor(colors.blue)
- term.clear()
- --Declaration du bouton reboot--
- paintutils.drawPixel(20,15, colors.green)
- --Affichage de l'icone de l'utilisateur--
- local usericon = paintutils.loadImage("usericon")
- paintutils.drawImage(usericon, 22, 5)
- --Lecture du nom du PC--
- local usernameread = fs.open("systeminfo/computername","r")
- username = usernameread.readAll()
- usernameread.close()
- --Affichage du nom du PC--
- term.setCursorPos(22,10)
- term.setBackgroundColor(colors.blue)
- print(username)
- --Affichage de textes et de pixels--
- term.setCursorPos(20,11)
- print("Mot de Passe:")
- paintutils.drawLine(19,12,33,12, colors.gray)
- term.setCursorPos(19,12)
- paintutils.drawLine(23,13,29,13, colors.yellow)
- term.setCursorPos(19,12)
- term.setBackgroundColor(colors.gray)
- -- Le probleme commence ici--
- --Ecriture du mot de passe correct dans une variable
- local passwordread = fs.open("systeminfo/password","r")
- password = passwordread.readAll()
- passwordread.close()
- --On detecte le mot de passe entre par l'utilisateur
- local password_entered = read("*")
- -- On verifie si le mot de passe est correcte
- if password_entered == password then
- --Futur demarrage du "Bureau"
- else
- shell.run("boot.lua")
- end
- --On indique l'action pour le bouton redemarer
- local event, button, X, Y = os.pullEvent("mouse_click")
- XY = X..","..Y
- if XY == "20,15" and button == 1 then
- shell.run("boot.lua")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement