Advertisement
Muzze77

Muzze JobScript V1.1

Jun 10th, 2014
320
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 10.07 KB | None | 0 0
  1.    
  2.  
  3.     --BauJob by Muzze77--
  4.     rednet.open("back")
  5.      
  6.      
  7.             function cut()
  8.                     sleep(0.5)
  9.                     shell.run("clear")
  10.                     sleep(0.5)
  11.             end
  12.      
  13.      
  14.     function beenden()
  15.     shell.run("delete " .. a)
  16.     print("Account geloescht!")
  17.     sleep(2)
  18.     cut()
  19.     start()
  20.     end  
  21.     function load()
  22.                     shell.run("clear")
  23.                     print(" Bitte Usernamen eingeben: ")
  24.       user = (read())
  25.                     dem = fs.exists(user)
  26.                             if dem == true then
  27.                                                             rfile = fs.open(user, "r")
  28.                                                             a = rfile.readLine(1)
  29.                                                             b = rfile.readLine(2)
  30.                                                             c = rfile.readLine(3)
  31.                                                             d = rfile.readLine(4)
  32.      
  33.                                                             rfile.close()
  34.                            
  35.                                                     if user == a then
  36.                                                             print(" Bitte Password eingeben")
  37.                                                             pass = (read("*"))
  38.                                                                     if pass == b then
  39.                                                                             print(" Password Akzeptiert")
  40.                                                                             cut()
  41.                                                                             print(" Den Job wirklich beenden oder Password wechseln? ")
  42.                                                                             print(" [J] Ja | [N] Nein | [P]Password")
  43.                                                                            
  44.                                                                             local evt, key2 = os.pullEvent("char")
  45.                                                                            
  46.                                                                                     if key2 == "j" then
  47.                                                                                     beenden()
  48.                                                                                     elseif key2 == "n" then
  49.                                                                                     shell.run("reboot")
  50.                                                                                     elseif key2 == "p" then
  51.                                                                                     cut()
  52.                                                                                     print(" Neues Password eingeben:")
  53.                                                                                     nPass = (read("*"))
  54.                                                                                     wfile = fs.open(a, "w")
  55.                                                                                     wfile.writeLine(a)
  56.                                                                                     wfile.writeLine(nPass)
  57.                                                                                     wfile.writeLine(c)
  58.                                                                                     wfile.writeLine(d)
  59.                                                                                     wfile.close()
  60.                                                                                     print("Password gewechselt")
  61.                                                                                     sleep(2)
  62.                                                                                     start()
  63.                                                                                     end
  64.                                                                     else
  65.                                                                             print(" Falsches Passwort")
  66.                                                                             sleep(2)
  67.                                                                     end
  68.                                                     else
  69.                                                             print(" Falscher Username")
  70.                                                             sleep(2)
  71.                                                            
  72.                                                            
  73.                                                     end
  74.                             elseif dem == false then
  75.                             print(" Der Account " .. user .. " exsistiert nicht")
  76.                             sleep(2)
  77.                            
  78.                             end
  79.     end
  80.            
  81.     function send()
  82.     shell.run("clear")
  83.      
  84.     print("Welcher User soll gesendet werden?")
  85.     sending = io.read()
  86.     if fs.exists(sending) == false then
  87.     print("User existiert nicht")
  88.     else
  89.     rednet.broadcast(sending)
  90.     print("Wurde gesendet")
  91.     sleep(1)
  92.     test()
  93.     end
  94.     end    
  95.      
  96.      
  97.      
  98.     function new()
  99.                     cut()
  100.            
  101.                     print(" Namen Eingeben :")
  102.                                     Name = read()
  103.                                     if fs.exists(Name) then
  104.                                             print(" Account existiert bereits")
  105.                                             print(" Bitte waehlen Sie einen anderen Accountnamen")
  106.                                            
  107.                                     else
  108.                                             print(" Name " .. Name .. " gewaehlt")
  109.                                             sleep(2)
  110.                                             cut()
  111.                                             print(" Password Eingeben:")
  112.                             print(" Keine Passwoerter von Emails, Accouns \n        und Co ( In meiner Datei nachlesbar!)" )
  113.                                             Password = (read("*"))
  114.                                             cut()
  115.                                             print(" Alter angeben:")
  116.                                             Age = (read())
  117.                                             Age = tonumber(Age)
  118.                                             print(" Weshalb willst du bei Muzze77 Arbeiten ?")
  119.                                             grund = io.read()
  120.                                             file = fs.open(Name, "w")
  121.                                             file.writeLine(Name)
  122.                                             file.writeLine(Password)
  123.                                             file.writeLine(Age)
  124.                                             file.writeLine(grund)
  125.                                             file.close()
  126.                                             print(" Done!")
  127.                                             print(" Name: " .. Name .. " Account erstellt.")
  128.                                             sleep(2)
  129.                                             cut()
  130.                                     end
  131.     end                            
  132.      
  133.      
  134.     function test()
  135.     cut()
  136.     t = fs.list("/")
  137.      
  138.     for m, n in pairs (t) do
  139.     if n == "rom" then
  140.     elseif n == "1" then
  141.     elseif n == "startup" then
  142.     else
  143.     write(n .. " | ")
  144.     end
  145.     end
  146.      
  147.     print("\n\n     Welchen Namen oeffnen?: ")
  148.     Idle = (read())
  149.     fileT = fs.open(Idle, "r")
  150.     ra = fileT.readAll()
  151.     fileT.close()
  152.     print(ra)
  153.     sleep(4)
  154.     print(" [B]Beenden oder [W]weiter schauen? [S]Senden")
  155.     evt, key4 = os.pullEvent("char")
  156.     if key4 == "b" then
  157.     start()
  158.     elseif key4 == "w" then
  159.     test()
  160.     elseif key4 == "s" then
  161.     send()
  162.     elseif key1 == "e" then
  163.     shell.run("edit 1")
  164.     end
  165.      
  166.     end
  167.      
  168.      
  169.      
  170.     function masterkey()
  171.     cut()
  172.     print(" Masterkey Eingeben: ")
  173.     term.setCursorPos(21, 1)
  174.     mkey = (read("*"))
  175.     if mkey == "daremon22" then
  176.     term.setCursorPos(1,3)
  177.     print(" Password akzepiert")
  178.     cut()
  179.     test()
  180.     else
  181.     term.setCursorPos(1,2)
  182.     print(" Falsches Password")
  183.     cut()
  184.     end
  185.      
  186.      
  187.      
  188.      
  189.     end
  190.      
  191.            
  192.      
  193.      
  194.                     function LoadNew()
  195.                     local evt, key1 = os.pullEvent("char")
  196.                            
  197.                             if key1 == "l" then
  198.                             load()
  199.                             elseif key1 == "n" then
  200.                             new()
  201.                             elseif key1 == "m" then
  202.                             masterkey()
  203.                            
  204.                             end
  205.     end
  206.      
  207.     function TerminalStart()
  208.                     local evt, key = os.pullEvent("char")
  209.                    
  210.                     if key == "w" then
  211.                             cut()
  212.                             print(" Bitte waehle eine Aktion:\n     [L]Benutzer Laden - Job aufgeben\n      [N]Neuer User - Bewerbung\n     [M]Masterkey - Muzze77")
  213.                             LoadNew()
  214.      
  215.                     end
  216.                    
  217.     end
  218.         function start()
  219.             shell.run("clear")
  220.             sleep(0.2)
  221.             term.setBackgroundColor(colors.blue)
  222.             term.setTextColor(colors.white)
  223.             shell.run("clear")
  224.             sleep(0.2)
  225.             print(" Willkommen bei der Anmeldung fuer Manarolas Jobs\n")
  226.             print(" Hier kannst du dich anmelden um als ")
  227.             print(" Arbeiter bei Muzze77 zu arbeiten")
  228.             print(" Wenn du angenommen wurdest steht ")
  229.             print(" es am Rechner Links von hier")
  230.             print("\n")    
  231.             print(" Mit W bekommst du zugriff aufs Terminal")
  232.             TerminalStart()
  233.            
  234.     end
  235.      
  236.      
  237.     while true do
  238.     os.pullEvent = os.pullEventRaw
  239.     start()
  240.      
  241.     end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement