jille_Jr

CC: Toby31's CraftOS

Sep 29th, 2012
304
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function wait(seconds, event)
  2.   local waitdelay = os.startTimer(seconds)
  3.   local chk, p1, p2, p3;
  4.   repeat chk, p1, p2, p3 = os.pullEvent() until (event ~= nil and chk == event) or (chk == "timer" and p1 == waitdelay)
  5.   return chk, p1, p2, p3
  6. end
  7.  
  8. term.clear()
  9. term.setCursorPos(1,1)
  10. textutils.slowPrint("Running Startup Program...")
  11. wait(1)
  12.  
  13. term.setCursorPos(1,1)
  14. term.clearLine()
  15. print("Running Startup Program..")
  16. wait(1)
  17.  
  18. term.setCursorPos(1,1)
  19. term.clearLine()
  20. print("Running Startup Program...")
  21. wait(1)
  22.  
  23. term.setCursorPos(1,1)
  24. term.clearLine()
  25. print("Running Startup Program..")
  26. wait(1)
  27.  
  28. term.setCursorPos(1,1)
  29. term.clearLine()
  30. print("Running Startup Program...")
  31. wait(1)
  32.  
  33. textutils.slowPrint("Processing Scripts...")
  34. wait(1)
  35.  
  36. term.setCursorPos(1,2)
  37. term.clearLine()
  38. print("Processing Scripts..")
  39. wait(1)
  40.  
  41. term.setCursorPos(1,2)
  42. term.clearLine()
  43. print("Processing Scripts...")
  44. wait(1)
  45.  
  46. totalbytes = 3250187
  47. local count = 0
  48.  
  49. repeat
  50.   count = count + 325000  
  51.   print("Bytes Loaded: " .. count)
  52.   wait(0.001)
  53. until count >= totalbytes
  54.  
  55. textutils.slowPrint("35 folders detected.")
  56. wait(2)
  57.  
  58. textutils.slowPrint("491 initial files loaded.")
  59. wait(2)
  60.  
  61. textutils.slowPrint("Loading user made programs.")
  62. wait(1)
  63.  
  64. textutils.slowPrint("Loading startup screen")
  65. wait(1)
  66.  
  67. term.clear()
  68. pos1 = 30
  69. term.setCursorPos(pos1, 9)
  70.  
  71. countt = 0
  72. repeat
  73.   term.setCursorPos(pos1, 9)
  74.   print("-")
  75.   pos1 = pos1 - 1
  76.   wait(0.5)
  77. until pos1 == 18
  78.  
  79. term.clearLine()
  80. term.setCursorPos(1,6)
  81. print([[
  82.     _____          _____  ____  ____
  83.    / ___/______ _/ _/ /_/ __ \/ __/
  84.   / /__/ __/ _  / _/ __/ /_/ /\ \  
  85.   \___/_/  \_,_/_/ \__/\____/___/
  86.        / /  ___  ___ ____/ /__ ___/ /
  87.       / /__/ _ \/ _  / _  / -_) _  /  
  88.      /____/\___/\_,_/\_,_/\__/\_,_/  
  89.  
  90. ]])
  91.  
  92. wait(3)
  93. Admin = "Admin"
  94. Apass = "Password"
  95. User = "User"
  96. Upass = "Password"
  97.  
  98. shell.run("clear")
  99. term.clear()
  100. term.setCursorPos(1,1)
  101. term.setCursorPos(1,6)
  102. print([[
  103.     _____          _____  ____  ____
  104.    / ___/______ _/ _/ /_/ __ \/ __/
  105.   / /__/ __/ _  / _/ __/ /_/ /\ \  
  106.   \___/_/  \_,_/_/ \__/\____/___/
  107.      
  108.  ]])
  109. print ("ComputerCraft 1.4")
  110. print("------------------------")
  111. -- Height, 18
  112. -- Width, 50
  113. print("Computer Users Enter Password")
  114. print("User:Admin")
  115. print("User:User")
  116. status, input = pcall (read)
  117. if input == Admin then
  118.   print "Password:"
  119.   status, password = pcall (read,'*')
  120.   if password == Apass then
  121.     print "Access Granted!"
  122.     sleep(2)
  123.     shell.run("cd","Admin")
  124.     shell.run("clear")  
  125.     wait(3)
  126.  
  127.     term.clear()
  128.     term.setCursorPos(1,1)
  129.     term.setCursorPos(1,6)
  130.  
  131.     print([[
  132.     _____          _____  ____  ____
  133.    / ___/______ _/ _/ /_/ __ \/ __/
  134.   / /__/ __/ _  / _/ __/ /_/ /\ \  
  135.   \___/_/  \_,_/_/ \__/\____/___/
  136.        / /  ___  ___ ____/ /__ ___/ /
  137.       / /__/ _ \/ _  / _  / -_) _  /  
  138.      /____/\___/\_,_/\_,_/\__/\_,_/  
  139.  
  140.     ]])
  141.     print ("ComputerCraft 1.4")
  142.     print("------------------------")
  143.     -- Height, 18
  144.     -- Width, 50
  145.   else
  146.   end
  147. elseif input == User then
  148.   print "Password:"
  149.   status, password = pcall (read,'*')
  150.   if password == Upass then
  151.     print "Access Granted!"
  152.     sleep(2)
  153.     shell.run("cd","User")
  154.     shell.run("clear")
  155.   else
  156.  
  157.   end -- needed a end here
  158. elseif input ~= Admin and input ~= User then -- to stop people bypassing your script.
  159.   print("WrongPassword")
  160.   sleep(3)
  161.  
  162.   term.clear()
  163.   term.setCursorPos(1,1)
  164.   textutils.slowPrint("ShutingDown...")
  165.   wait(1)
  166.  
  167.   term.setCursorPos(1,1)
  168.   term.clearLine()
  169.   print("ShutingDown..")
  170.   wait(1)
  171.  
  172.   term.setCursorPos(1,1)
  173.   term.clearLine()
  174.   print("ShutingDown...")
  175.   wait(1)
  176.  
  177.   term.setCursorPos(1,1)
  178.   term.clearLine()
  179.   print("ShutingDown..")
  180.   wait(1)
  181.  
  182.   term.setCursorPos(1,1)
  183.   term.clearLine()
  184.   print("ShutingDown...")
  185.   wait(1)
  186.  
  187.  
  188.   sleep(3)
  189.   os.shutdown()
  190. end
Advertisement
Add Comment
Please, Sign In to add comment