Advertisement
Guest User

Untitled

a guest
May 11th, 2016
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. --os.pullEvent = os.pullEventRaw
  2. local monitor = peripheral.find("monitor")
  3. function lock()
  4. if peripheral.find("monitor") then
  5. monitor.clear()
  6. monitor.setCursorPos(1,1)
  7. monitor.print("Currently Locked")
  8. end
  9. term.clear()
  10. term.setCursorPos(1,1)
  11. term.setTextColor(colors.yellow)
  12. textutils.slowPrint("MC Crafters Security System")
  13. term.setTextColor(colors.white)
  14. sleep(1)
  15. textutils.slowWrite("Username: ")
  16. user = read()
  17. textutils.slowWrite("Password: ")
  18. pass = read("*")
  19. if user == "Admin" and pass == "password" then
  20. term.setCursorPos(1,4)
  21. term.setTextColor(colors.green)
  22. textutils.slowPrint("Valid Login Credentials, Welcome to The System.")
  23. if peripheral.find("monitor") then
  24. monitor.clear()
  25. monitor.setCursorPos(1,1)
  26. monitor.print("Currently Unlocked")
  27. end
  28. sleep(2)
  29. term.clear()
  30. os.version()
  31. term.setCursorPos(1,2)
  32. else
  33. term.setCursorPos(1,4)
  34. term.setTextColor(colors.red)
  35. textutils.slowPint("Invalid Login Credenials, Please Don't Try Again.")
  36. sleep(2)
  37. lock()
  38. end
  39. end
  40.  
  41. if not fs.exists("startup") then
  42. local file = fs.open("startup", "w")
  43. file:shell.run("lock")
  44. file:close()
  45. os.reboot()
  46. end
  47.  
  48. lock()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement