Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Systeme de securite EzKliks v0.1
- -- Variable
- local accesvip = "etekt1ex"
- -- function
- function initLigne()
- xLigne = 2
- end
- function addligne()
- xLigne = xLigne + 1
- term.setCursorPos(2, xLigne)
- end
- function clearCommand()
- term.setCursorPos(2, 18)
- print(" ")
- end
- function initMenu()
- term.setBackgroundColor(colors.gray)
- term.setTextColor(colors.white)
- term.clear()
- h = fs.open("fileUser", "r")
- prenom = h.readAll()
- h.close()
- term.setCursorPos(1,1)
- print(" EzKliksOS user : " .. prenom .. " ")
- term.setBackgroundColor(colors.cyan)
- term.setCursorPos(2,2)
- print(" ")
- term.setCursorPos(2,3)
- print(" ")
- term.setCursorPos(2,4)
- print(" ")
- term.setCursorPos(2,5)
- print(" ")
- term.setCursorPos(2,6)
- print(" ")
- term.setCursorPos(2,7)
- print(" ")
- term.setCursorPos(2,8)
- print(" ")
- term.setCursorPos(2,9)
- print(" ")
- term.setCursorPos(2,10)
- print(" ")
- term.setCursorPos(2,11)
- print(" ")
- term.setCursorPos(2,12)
- print(" ")
- term.setCursorPos(2,13)
- print(" ")
- term.setCursorPos(2,14)
- print(" ")
- term.setCursorPos(2,15)
- print(" ")
- term.setCursorPos(2,16)
- print(" ")
- term.setBackgroundColor(colors.gray)
- term.setCursorPos(2,17)
- print(" ")
- term.setBackgroundColor(colors.cyan)
- term.setCursorPos(2,18)
- print(" ")
- term.setCursorPos(2,2)
- rednet.open("left")
- end
- function command()
- while true do
- local typeResult = nil
- term.setCursorPos(2, 18)
- typeResult = read()
- term.setCursorPos(2, xLigne)
- if typeResult == "shutdown" then
- sleep(0.5)
- os.shutdown()
- elseif typeResult == "help" then
- sleep(0.1)
- print("commands : clear - reboot - help - shutdown")
- elseif typeResult == "clear" then
- sleep(0.5)
- initMenu()
- initLigne()
- elseif typeResult == "SuperAdmin" then
- write("Password : ")
- pswd = read("*")
- if pswd == accesvip then
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.white)
- term.clear()
- term.setCursorPos(1,1)
- break
- end
- elseif typeResult == "reboot" then
- sleep(0.5)
- os.reboot()
- else
- sleep(0.1)
- print("Commande inconnue, tapez 'help'")
- end
- clearCommand()
- addligne()
- end
- end
- function connexion()
- term.setBackgroundColor(colors.cyan)
- term.setTextColor(colors.white)
- term.clear()
- term.setCursorPos(1,1)
- end
- -- Body
- connexion()
- initMenu()
- initLigne()
- command()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement