Guest User

JJ Userlogin 4

a guest
Jan 3rd, 2013
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.27 KB | None | 0 0
  1. function loading()
  2.     term.setCursorPos(17,11)
  3.     term.clearLine()
  4.     print ("[    Loading    ]")
  5.     sleep(0.5)
  6.     term.setCursorPos(17,11)
  7.     term.clearLine()
  8.     print ("[  Loading 16%  ]")
  9.     term.setCursorPos(17,11)
  10.     term.clearLine()
  11.     sleep(0.5)
  12.     print ("[  Loading 31%  ]")
  13.     term.setCursorPos(17,11)
  14.     term.clearLine()
  15.     sleep(0.5)
  16.     print ("[  Loading 46%  ]")
  17.     term.setCursorPos(17,11)
  18.     term.clearLine()
  19.     sleep(0.5)
  20.     print ("[  Loading 62%  ]")
  21.     term.setCursorPos(17,11)
  22.     term.clearLine()
  23.     sleep(0.5)
  24.     print ("[  Loading 78%  ]")
  25.     term.setCursorPos(17,11)
  26.     term.clearLine()
  27.     sleep(0.5)
  28.     print ("[  Loading 93%  ]")
  29.     term.setCursorPos(17,11)
  30.     term.clearLine()
  31.     sleep(0.5)
  32.     print ("[  Loading Done ]")
  33.     sleep(2)
  34. end
  35.  
  36. function start()
  37.     term.clear()
  38.     term.setCursorPos(1,1)
  39.     print ("              __ |  __ |            Login System  ")
  40.     print ("                ||    ||    _ \\ (_-<             ")
  41.     print ("              __//  __// .\\___/ ___/             ")
  42.     print ("------------------(Version: 2.1)------------------")
  43.     print ("")
  44. end
  45.  
  46. function welcome()
  47.     term.clear()
  48.     term.setCursorPos(1,1)
  49.     print ("              __ |  __ |   Welcome, "..username.."")
  50.     print ("                ||    ||    _ \\ (_-<             ")
  51.     print ("              __//  __// .\\___/ ___/             ")
  52.     print ("-----------------(Version: 2.1)-------------------")
  53.     print ("")
  54. end
  55.  
  56. function accountAccepted()
  57.     term.setCursorPos(17,11)
  58.     term.clearLine()
  59.     print ("Account Accepted.")
  60.     sleep(3)
  61. end
  62.  
  63. function wrongLogin()
  64.     term.setCursorPos(11,11)
  65.     term.clearLine()
  66.     textutils.slowPrint ("Username and/or Password do not match")
  67. end
  68.  
  69. os.pullEvent = os.pullEventRaw
  70. start()
  71. print ("Login: ")
  72. print ("")
  73.  
  74. write ("Username: ")
  75. username = read()
  76. write ("Password: ")
  77. password = read ("*")
  78. sleep(1)
  79.  
  80. -- admin account
  81. if username == "admin" and password == "adminbypass" then    
  82.     loading()
  83.     accountAccepted()
  84.     welcome()
  85.  
  86. -- jumpingjoran account
  87. elseif username == "jumpingjoran" and password == "jumpingjoran" then    
  88.     loading()
  89.     accountAccepted()
  90.     welcome()
  91.  
  92. -- mastermy2 account
  93. elseif username == "mastermy2" and password == "mastermy2" then    
  94.     loading()
  95.     accountAccepted()
  96.     welcome()
  97.  
  98. -- no account whatsoever...
  99. else
  100.     wrongLogin()
  101.     sleep(3)
  102.     os.reboot()
  103. end
Advertisement
Add Comment
Please, Sign In to add comment