Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Clear-System
- function cc()
- term.clear()
- term.setCursorPos(1,1)
- end
- function gui(name)
- cc()
- print("--------------------------------------------------")
- print(" Fontania-Messages ")
- print("--------------------------------------------------")
- term.setCursorPos(1,19)
- write("Willkommen "..name.."!")
- term.setCursorPos(1,4)
- end
- function befehl(name)
- write("Befehl: ")
- Befehl = io.read()
- if Befehl == "help" == true then
- gui(name)
- print("Herunterfahren: shutdown")
- print("Neustarten: reboot")
- print("Abmelden: singout")
- print("Bericht Erstellen: new")
- print("Bericht liste: list")
- print("Bericht Oeffnen open")
- print("Gebannte spieler liste Banned-players")
- print()
- befehl(name)
- elseif Befehl == "shutdown" == true then
- os.shutdown()
- elseif Befehl == "reboot" == true then
- os.reboot()
- elseif Befehl == "singout" == true then
- shell.run("Stadt")
- elseif Befehl == "list" == true then
- gui(name)
- local files = fs.list(shell.dir())
- for i,file in pairs(files) do
- if fs.isDir(file) then
- if file == "Users" == false then
- if file == "rom" == false then
- print("[Thema] "..file)
- end
- end
- else
- if file == "Stadt" == false then
- if file == "edit.lua" == false then
- if file == "startup" == false then
- print("[Artikel] "..file)
- end
- end
- end
- end
- end
- write("Artikel Oeffnen: ")
- local input = io.read()
- if fs.exists(input) == true then
- else
- textutils.slowPrint("Dieser Artikel existiert nicht!")
- end
- elseif Befehl == "new" == true then
- gui(name)
- write("Betreff: ")
- Betreff = io.read()
- shell.run("edit.lua ("..name.."):"..Betreff)
- elseif Befehl == "Banned-players" == true then
- local files = fs.list(shell.dir())
- for i,file in pairs(files) do
- if fs.isDir(file) == false then
- print("[File] "..file)
- end
- end
- elseif Befehl == "open" == true then
- cc()
- gui(name)
- shell.run("edit.lua")
- end
- end
- -- Login-System
- function login(name)
- gui(name)
- write("Bei Hilfe 'help' eingeben!")
- term.setCursorPos(1,6)
- befehl(name)
- end
- -- Funktion für den falschen User
- function falseUser()
- print("Falscher User!")
- sleep(1)
- os.reboot()
- end
- -- User-Registrierung
- function register(name,passwort,berechtigung)
- filesave(name,name)
- end
- function filesave(name,folder,message)
- fs.makeDir("Users/"..folder)
- f = fs.open("Users/"..folder..""..name,"w")
- f.write(message)
- f.close()
- end
- function main()
- -- Input-abfrage
- write"Name/Kennung: "
- input = io.read()
- if fs.exists("Users/"..input) then
- login(input)
- else
- falseUser()
- end
- end
- -- Startdateien werden vorbereitet!
- if fs.exists("Users/Admin") == false then
- fs.makeDir("Artikel")
- fs.makeDir("Users")
- fa = fs.open("Users/Admin","w")
- fa.write("Account!")
- fa.close()
- end
- cc()
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement