Advertisement
Guest User

Untitled

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