Guest User

Computercraft boot screen

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