Advertisement
Guest User

startup

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