Advertisement
Guest User

startup

a guest
Jun 17th, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.52 KB | None | 0 0
  1. os.pullEvent = os.pullEventRaw
  2. term.setBackgroundColor(colors.black)
  3. term.setTextColor(colors.gray)
  4. local function pause(key)
  5.   print('Press X to continue.')
  6.   while true do
  7.             local sEvent, sParam=os.pullEvent('char')
  8.             if string.lower(sParam)==key then
  9.   break
  10.             end
  11.  end
  12. end
  13. local progressbar = {"----------","o---------","oo--------","ooo-------","oooo------","ooooo-----","oooooo----","ooooooo---","oooooooo--","ooooooooo-","oooooooooo"}
  14. term.clear()
  15. sleep(.3)
  16. term.setCursorPos(1,1)
  17. print("[/////////////////////////////////////////////////]")
  18. print("[/////////////8///88888/88888/////////////////////]")
  19. print("[///////////88888/8///8/8/////////////////////////]")
  20. print("[/////////////8///8///8/88888/////////////////////]")
  21. print("[////////8888/8///8///8/////8///8/8///88//////////]")
  22. print("[////////8//8/8///8///8/////8///8/8////8//////////]")
  23. print("[////////8888/8///88888/88888///8/8////8//////////]")
  24. print("[////////8///////////////////////8//o/888/////////]")
  25. print("[////////8////////////////////////////////////////]")
  26. print("[/////////////////////////////////////////////////]")    
  27.                                   for i=1,#progressbar do
  28. term.setCursorPos(20,12)
  29. print(progressbar[i])
  30. sleep(.5)
  31. end
  32. sleep(1)
  33. term.clear()
  34. term.setCursorPos(21,2)
  35. print("Welcome!")
  36. sleep(2.5)
  37. local intcount=0
  38. term.clear()
  39. term.setCursorPos(1,1)
  40. print("Login")
  41. while true do
  42.   write("Username: ")
  43.   userNameInput = read()
  44.   if string.lower(userNameInput) == "admin" then
  45.     sleep(1)
  46.     break
  47.   else
  48.   sleep(1)
  49.     print("Username not found.")
  50.     intcount=intcount+1
  51.     sleep(1)
  52.     for i=3,2,-1 do
  53.               term.setCursorPos(1,i)
  54.               term.clear()
  55.   end
  56. end
  57. if intcount==3 then
  58.   print('You have entered an invalid username too many times.')
  59.   sleep(5)
  60.   os.shutdown()
  61.   end
  62.  end
  63.  local intcount=0
  64.  while true do
  65.  write("Password: ")
  66.  passwordInput = read("*")
  67.  print("Verifying login...")
  68.  sleep(2.5)
  69.  if passwordInput == "password" then
  70.  print("Loading your settings...")
  71.  sleep(1.5)
  72.  print("Logging in...")
  73.  sleep(3.5)
  74.  term.clear()
  75.  term.setCursorPos(1,1)
  76.  print("Welcome to ptOS!")
  77.  pause('x')
  78.  term.setCursorPos(1,2)
  79.  term.clearLine()
  80.  break
  81.  else
  82.  print("The password you have entered is incorrect.")
  83.  intcount=intcount+1
  84.  sleep(1)
  85.  for i=6,3,-1 do
  86.  term.setCursorPos(1,i)
  87.  term.clearLine()
  88.  end
  89.  end
  90.  if intcount==3 then
  91.   print('You have entered an incorret password too many times.')
  92.   sleep(5)
  93.   os.shutdown()
  94.   end
  95.   end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement