Guest User

Untitled

a guest
May 18th, 2018
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.90 KB | None | 0 0
  1. print ("Welcome back to computer #", os.getComputerID(), "!")
  2. print("Loading...")
  3. sleep(2)
  4. print("Hello!");
  5. sleep(2)
  6. debug="shutdown"
  7. correct="password"
  8. opentime = 5
  9. maxtries=5
  10. tries=0
  11. function lock()
  12. password()
  13. if user == debug then
  14.  print "Shutting down CraftOS"
  15.  shell.run("shutdown")
  16. end
  17. if user == "password" then
  18.  print "Password correct, booting computer..."
  19.  correct()
  20. end
  21. if not(user == correct) or (user == debug) then
  22.  if tries == maxtries -1 then
  23.   if protectmode then
  24.    protect()
  25.     else
  26.    print "Too many tries"
  27.    print "Shutting down..."
  28.    sleep (2)
  29.    shell.run("shutdown")
  30.   end
  31.    else
  32.   print "Incorrect Password."
  33.   tries = tries+1
  34.   print (maxtries - tries, " tries left.")
  35.   sleep(1)
  36.   lock()
  37.  end
  38. end
  39. end
  40. function correct()
  41.  sleep(1)
  42.  shell.run("clear")
  43.  shell.run("shell")
  44. end
  45. function password()
  46.  write "Input password: "
  47.  user=read("*")
  48. end
  49. lock()
Add Comment
Please, Sign In to add comment