Toby31

LogIn StartUp

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