Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --BauJob
- list = {
- }
- function cut()
- sleep(3)
- shell.run("clear")
- sleep(1)
- end
- function beenden()
- --
- end
- function load()
- shell.run("clear")
- print(" Bitte Usernamen eingeben: ")
- user = io.read()
- dem = fs.exists(user)
- if dem == true then
- rfile = fs.open(user, "r")
- a = rfile.readLine(1)
- b = rfile.readLine(2)
- rfile.close()
- if user == a then
- print(" Bitte Password eingeben")
- pass = read("*")
- if pass == b then
- print("Password Akzeptiert")
- cut()
- print("Den Job wirklich beenden ? ")
- print("[J] Ja | [N] Nein")
- local evt, key2 = os.pullEvent("char")
- key2 = string.lower(key2)
- if key2 == "j" then
- beenden()
- elseif key2 == "n" then
- shell.run("reboot")
- end
- else
- print(" Falsches Passwort")
- sleep(2)
- end
- else
- print(" Falscher Username")
- sleep(2)
- end
- elseif dem == false then
- print(" Der Account " .. user .. " exsistiert nicht")
- sleep(2)
- end
- end
- function new()
- cut()
- print(" Namen Eingeben :")
- Name = io.read()
- if fs.exists(Name) then
- print(" Account existiert bereits")
- print(" Bitte waehlen Sie einen anderen Accountnamen")
- else
- print("Name " .. Name .. " gewaehlt")
- sleep(2)
- cut()
- print("Password Eingeben:")
- Password = read("*")
- cut()
- print("Alter angeben:")
- Age = io.read()
- Age = tonumber(Age)
- acc = {}
- acc.Name = {}
- acc.Name.Name = Name
- acc.Name.Password = Password
- acc.Name.Age = Age
- file = fs.open(Name, "w")
- file.writeLine(acc.Name.Name)
- file.writeLine(acc.Name.Password)
- file.writeLine(acc.Name.Age)
- file.close()
- table.insert(list, Name)
- table.insert(list, Name.Name)
- table.insert(list, Name.Age)
- print(" Done!")
- print(" Name: " .. acc.Name.Name .. " Account erstellt.")
- sleep(2)
- cut()
- end
- end
- function test()
- for m, k in pairs (list) do
- local evt, key2 = os.pullEvent("key")
- key2 = string.lower(key2)
- if key2 == 28 then
- print(k)
- print(k.Name)
- print(k.Age)
- else
- end
- end
- end
- function masterkey()
- cut()
- print("Masterkey Eingeben: ")
- term.setCursorPos(21, 1)
- mkey = read("*")
- if mkey == "daremon22" then
- term.setCursorPos(1,2)
- print("Password akzepiert")
- cut()
- test()
- else
- term.setCursorPos(1,2)
- print("Falsches Password")
- cut()
- end
- end
- function LoadNew()
- local evt, key1 = os.pullEvent("char")
- key1 = string.lower(key1)
- if key1 == "l" then
- load()
- elseif key1 == "n" then
- new()
- elseif key1 == "m" then
- masterkey()
- end
- end
- function TerminalStart()
- local evt, key = os.pullEvent("char")
- key = string.lower(key)
- if key == "w" then
- cut()
- print(" Bitte waehle eine Aktion:\n [L]Benutzer Laden - Job aufgeben\n [N]Neuer User - Bewerbung\n [M] Masterkey - Muzze77")
- LoadNew()
- end
- end
- function start()
- shell.run("clear")
- sleep(0.2)
- term.setBackgroundColor(colors.blue)
- term.setTextColor(colors.white)
- shell.run("clear")
- sleep(0.2)
- print(" Willkommen bei der Anmeldung für Manarolas Jobs")
- print(" Mit W zugriff aufs Terminal")
- TerminalStart()
- end
- while true do
- start()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement