jumpingjoran

JJ Login System

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