Advertisement
Guest User

startup

a guest
Nov 5th, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.13 KB | None | 0 0
  1. term.clear()
  2. term.setCursorPos(1,1)
  3. oldPull = os.pullEvent -- just incase you need
  4. -- to pull events for custom things :>
  5. os.pullEvent = os.pullEventRaw
  6.  
  7. env = {}
  8. env.time = 3
  9. env.side = "back"
  10. env.messages = {}
  11. env.messages.gotin = "Welcome back to Blitz HQ" -- lol
  12. users = {"fisher","nukelar","User","NvQ"} -- it wont matter caps, it will lower case it when checking.
  13. passwords = {"fishae","DeathByNuke9","Blitz1623","#CommunistsRule"}
  14. masterpassword = "HappyAIDS69" --ok, its a randy thing ok?
  15.  
  16. function reset()
  17.   term.setBackgroundColor(colors.white)
  18.   term.setTextColor(colors.black)
  19.   term.clear()
  20.   term.setCursorPos(1,1)
  21. end
  22.  
  23. while true do
  24. reset()
  25. size = {term.getSize()}
  26. term.setBackgroundColor(colors.gray)
  27. term.setCursorPos(3,3)
  28. for i = 1,size[2]-4 do
  29.   cpos = {term.getCursorPos()}
  30.   for i = 1,size[1]-4 do
  31.     term.write(" ")
  32.   end
  33.   term.setCursorPos(cpos[1],cpos[2]+1)
  34. end
  35.  
  36. term.setBackgroundColor(colors.red)
  37.  
  38. title = " Blitz Bunker OS "
  39. title1 = "                 "
  40. function titlelen(y)
  41.   term.setCursorPos((size[1]/2)-(#title/2),y)
  42. end
  43.  
  44. titlelen(2)
  45. print(title1)
  46. titlelen(3)
  47. print(title)
  48. titlelen(4)
  49. print(title1)
  50. term.setCursorPos(4,6)
  51. term.setBackgroundColor(colors.gray)
  52. print("Input your Credentials to proceed.")
  53. term.setCursorPos(4,8)
  54. term.write("User: ")
  55. local user = read()
  56. term.setCursorPos(4,10)
  57. term.write("Password: ")
  58. local pass = read("*") --don't want any others getting this hence local
  59.  
  60. found = false
  61.  
  62. if pass == masterpassword then
  63.   term.setCursorPos(4,12)
  64.   print("Welcome back, "..user..". You look mighty spiffy today, might I also add, you have the mastercode! Don't tell anyone!")
  65.   _G["cuser"] = user
  66.   break
  67. end
  68.  
  69. if not found then
  70. for i = 1,#users do
  71.   for i1 = 1,#passwords do
  72.     if user:lower() == users[i]:lower() then
  73.       if pass == passwords[i1] then
  74.         found = true
  75.         term.setCursorPos(4,12)
  76.         print(env.messages.gotin)
  77.         rs.setOutput(env.side, true)
  78.         sleep(env.time)
  79.         rs.setOutput(env.side,false)
  80.       end
  81.     end
  82.   end
  83. end
  84. end
  85. end
  86. --print("Welcome to the computer, ".._G["cuser"]..", and have a nice day.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement