Muzze77

BankSysNew

Mar 21st, 2014
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.91 KB | None | 0 0
  1.    
  2.  
  3.  
  4.  function pruf()
  5.         if disk.hasData("left") == true then
  6.         ask = fs.open("disk/username", "w")
  7.         n = ask.readAll()
  8.            
  9.                 if n == nil then
  10.                     shell.run("clear")
  11.                     print("Bitte Username eingeben")
  12.                     name = io.read()
  13.                     ask.writeLine(username)
  14.                     ask.close()
  15.                     print("Name eingetragen")
  16.                     sleep(1)
  17.                     shell.run("clear")  
  18.                 else
  19.                     print(" Bitte Accountnamen eingeben")
  20.                     aname = io.read()
  21.    
  22.                     na = ask.readAll()
  23.                     fs.close()
  24.                     if na == aname then
  25.                         ask2 = fs.open("disk/password", "w")
  26.                         n2 = ask2.readAll
  27.                         if n2 == nil then
  28.                             shell.run("clear")
  29.                             print("Bitte Password eingeben")
  30.                             password = io.read()
  31.                             ask2.write(password)
  32.                             ask2.close()
  33.                             print("Password eingetragen")
  34.                             shell.run("clear")
  35.                        
  36.                         else    
  37.                             print("Bitte Accountpassword eingeben")
  38.                             pa = ask.readAll()
  39.                             apass = io.read()
  40.                             if apass == pa then  
  41.                                     ask2.close()
  42.                                     ask3 = fs.open("/disk/money", "read")
  43.                                     mon = ask3.read()
  44.    
  45.                                     if mon == nil then
  46.                                         mon = 0
  47.                                         print("Derzeitger Kontostand:" .. mon .. "$")
  48.                                         sleep(4)
  49.                                         print("Was wollen sie tun?")
  50.                                         print("Abheben, Einzahlen, Kontostand")
  51.                                     else
  52.                                         print("Derzeitger Kontostand:" .. mon .. "$")
  53.                                         sleep(4)
  54.                                         print("Was wollen sie tun?")
  55.                                         print("Abheben, Einzahlen, Kontostand")              
  56.                                     end            
  57.                             else
  58.                                 fs.close()
  59.                                 print("Falsches Password. Bitte erneut eingeben")
  60.                                 Shell.run("reboot")
  61.                             end    
  62.                            
  63.                         end
  64.                     else
  65.                         fs.close()
  66.                         print("Falscher Username. Bitte erneut eingeben")
  67.                         shell.run("reboot")
  68.                     end
  69.                 end
  70.         else
  71.         print("Keine KK eingelegt. Bitte einlegen!")
  72.         end
  73.  end
  74.      
  75.     while true do
  76.       print(" Willkommen in der MazeBank.")
  77.       pruf()
  78.     end
Add Comment
Please, Sign In to add comment