Advertisement
Guest User

autostart

a guest
May 22nd, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.72 KB | None | 0 0
  1. term.clear()
  2. term.setCursorPos(1,1)
  3. term.setTextColor(colors.cyan)
  4. print("Geben sie 1 fuer Login ein oder 2 fuer Registration.")
  5. sel = read()
  6.  
  7. if sel ~= "1" and sel ~= "2" then
  8.  
  9.   term.setTextColor(colors.red)
  10.   print("Ihre Auswahl ist ungueltig.")
  11.   sleep(1)
  12.   os.reboot()
  13. end
  14.  
  15. if sel == "1" then
  16.   term.clear()
  17.   term.setCursorPos(1,1)
  18.   term.setTextColor(colors.green)
  19.   print("Bitte geben sie ihren Benutzernamen ein...")
  20.   user = read()
  21.  
  22.   if fs.exists(user) then
  23.     term.setTextColor(colors.blue)
  24.     print("Bitte geben sie ihr Passwort ein...")
  25.     pass = read("*")
  26.     f = fs.open(user, "r")
  27.     fc = f.readLine()
  28.  
  29.     if pass == fc then
  30.       term.clear()
  31.       term.setCursorPos(1,1)
  32.       term.setTextColor(colors.yellow)
  33.       print("CraftOS 1.7")
  34.       term.setCursorPos(1,2)
  35.     else
  36.       term.setTextColor(colors.red)
  37.       textutils.slowPrint("Passwort ist Inkorrekt!")
  38.       sleep(2)
  39.       os.reboot()
  40.     end
  41.   else
  42.     term.setTextColor(colors.red)
  43.     print("Benutzer "..user.." existiert nicht!")
  44.     sleep(2)
  45.     os.reboot()
  46.   end
  47. end
  48.  
  49. if sel == "2" then
  50.   term.clear()
  51.   term.setCursoePos(1,1)
  52.   term.setTextColor(colors.pink)
  53.   print("Geben sie ihren gewuenschten Benutzernamen ein...")
  54.   reguse = read()
  55.  
  56.   if not fs.exists(reguse) then
  57.     F = fs.open("/"..reguse, "w")
  58.     term.setTextColor(colors.lightBlue)
  59.     print("Geben sie ihr gewuenschtes Passwort ein...")  
  60.     regpas = read("*")
  61.     F.write(regpas)
  62.     term.setTextColor(colors.lime)
  63.     print("Registration erfolgreich!")
  64.     sleep(2)
  65.     os.reboot()
  66.   else
  67.     term.setTextColor(colors.red)
  68.     print("Der Benutzername "..reguse.." existiert bereits.")
  69.     sleep(2)
  70.     os.reboot()
  71.   end
  72. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement