Advertisement
Muzze77

BurningKeys Startup

Apr 9th, 2014
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.39 KB | None | 0 0
  1.     term.setBackgroundColor(colors.white)
  2.     term.setTextColor(colors.blue)
  3.     shell.run("clear")
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.     --Start--
  15.     function start()
  16.     shell.run("clear")
  17.     term.setBackgroundColor(colors.white)
  18.     term.setTextColor(colors.blue)
  19.     shell.run("clear")
  20.     print("  Willkommen in der Computercraft Akademie")
  21.     term.setCursorPos(16, 3)
  22.     print("BurningKeys")
  23.     term.setCursorPos(1, 5)
  24.     print("  Hier werden die einzelnen Grundlagen gezeigt")
  25.     print("  Um den PC zu starten bitte ENTER druecken")
  26.     pcstr()
  27.     end
  28.     --PCstr-- PC startet
  29.     function pcstr()
  30.         evt, key = os.pullEvent("key")
  31.         if key == 28 then
  32.             shell.run("clear")
  33.             print("Bitte Logge dich ein." )
  34.             print("Erstellt ein Profil oder laedt es wenn eins vorhanden ist")
  35.             tAcc()
  36.         else
  37.             pcstr()
  38.         end
  39.     end
  40.     -- rAccs -- Reading Accounts
  41.     function rAccs()
  42.         sleep(2)
  43.         shell.run("clear")
  44.         rAcc = fs.open(name, "r")
  45.         rname = rAcc.readLine(1)
  46.         rpass = rAcc.readLine(2)
  47.         rcode = rAcc.readLine(3)
  48.         rAcc.close()
  49.         loading()
  50.     end
  51.     -- tAcc -- test Accounts
  52.     function tAcc()
  53.         name = io.read()
  54.         if fs.exists(name) == true then
  55.             sleep(0.2)
  56.             shell.run("clear")
  57.             print("Willkommen zurueck " .. name .. ". Bitte gib DEIN Password ein")
  58.             pass = read("*")
  59.             if pass == rpass then
  60.                 rAccs()
  61.             else
  62.                 print("Falsches Password!")
  63.                 sleep(2)
  64.                 shell.run("clear")
  65.                 tAcc()
  66.             end
  67.         else
  68.         sAcc()
  69.         end
  70.     end
  71.     -- Loading-- Daten werden Geladen
  72.     function sAcc()
  73.             print("Neuer Account wird Erstellt")
  74.             sleep(2)
  75.             shell.run("clear")
  76.             print("Bitte PW waehlen")
  77.             spass = read("*")
  78.             print("Password gewaehlt. Code wird Generiert")
  79.             sleep(2)
  80.             shell.run("clear")
  81.             term.setCursorPos(12, 4)
  82.             print("Speichert Datein. Bitte warten.")
  83.             term.setCursorPos(17, 5)
  84.             term.setBackgroundColor(colors.black)
  85.             print("             ")
  86.             term.setCursorPos(17, 7)
  87.             print("             ")
  88.             term.setCursorPos(17, 6)
  89.             print(" ")
  90.             term.setCursorPos(29, 6)
  91.             print(" ")
  92.             term.setCursorPos(18, 6)
  93.             term.setBackgroundColor(colors.green)
  94.             textutils.slowPrint("           ", 0.60)
  95.             term.setBackgroundColor(colors.white)
  96.             code1 = math.random(0, 9)
  97.             code2 = math.random(0, 9)
  98.             code3 = math.random(0, 9)
  99.             code4 = math.random(0, 9)
  100.             code5 = math.random(0, 9)
  101.             code6 = math.random(0, 9)
  102.             code7 = math.random(0, 9)
  103.             code8 = math.random(0, 9)
  104.             code = code1 .. code2 .. code3 .. code4 .. code5 .. code6 .. code7 .. code8
  105.             print("Deine Codenummer ist: " .. code)
  106.             sAcc = fs.open(name, "w")
  107.             sAcc.writeLine(name)
  108.             sAcc.writeLine(spass)
  109.             sAcc.writeLine(code)
  110.             sAcc.close()
  111.             loading()
  112.     end
  113.  
  114.     function loading()
  115.     sleep(1)
  116.     shell.run("clear")
  117.     term.setCursorPos(4, 2)
  118.     term.setTextColor(colors.red)
  119.     print("Daten werden Geladen eine Sekunde")
  120.     term.setCursorPos(17, 5)
  121.     term.setBackgroundColor(colors.black)
  122.     print("             ")
  123.     term.setCursorPos(17, 7)
  124.     print("             ")
  125.     term.setCursorPos(17, 6)
  126.     print(" ")
  127.     term.setCursorPos(29, 6)
  128.     print(" ")
  129.     term.setCursorPos(18, 6)
  130.     term.setBackgroundColor(colors.green)
  131.     textutils.slowPrint("           ", 0.60)
  132.     term.setBackgroundColor(colors.white)
  133.     lprog1()
  134.     end
  135.  
  136.     function lprog1()
  137.     shell.run("clear")
  138.     sleep(1)
  139.     print("||||||||||")
  140.     evt1, key1 = os.pullEvent("key")
  141.     if key1 == 2 then
  142.     shell.run("prog1")
  143.     else
  144.     lprog1()
  145.     end
  146.     end
  147.  
  148. --Beginschleife--
  149.     while true do
  150.     start()
  151.     end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement