Advertisement
Guest User

startup

a guest
Jan 7th, 2012
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.13 KB | None | 0 0
  1. -- Made by tylorddude123, Just change the 2 password lines to the password you choose and
  2. -- Have fun! BootPassv1.1.02. You must save it as startup and in the
  3. -- folder /.minecraft/saves/MAP NAME/computer/COMPUTER ID/startup
  4.  
  5. print ("Welcome back to computer #", os.getComputerID(), "!")
  6. print("Loading...")
  7. sleep(2)
  8. print("Hello!");
  9. sleep(2)
  10. debug="shutdown"
  11. correct="password"
  12. opentime = 5
  13. maxtries=5
  14. tries=0
  15. function lock()
  16. password()
  17. if user == debug then
  18.  print "Shutting down CraftOS"
  19.  shell.run("shutdown")
  20. end
  21. if user == "password" then
  22.  print "Password correct, booting computer..."
  23.  correct()
  24. end
  25. if not(user == correct) or (user == debug) then
  26.  if tries == maxtries -1 then
  27.   if protectmode then
  28.    protect()
  29.     else
  30.    print "Too many tries"
  31.    print "Shutting down..."
  32.    sleep (2)
  33.    shell.run("shutdown")
  34.   end
  35.    else
  36.   print "Incorrect Password."
  37.   tries = tries+1
  38.   print (maxtries - tries, " tries left.")
  39.   sleep(1)
  40.   lock()
  41.  end
  42. end
  43. end
  44. function correct()
  45.  sleep(1)
  46.  shell.run("clear")
  47.  shell.run("shell")
  48. end
  49. function password()
  50.  write "Input password: "
  51.  user=read("*")
  52. end
  53. lock()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement