Door OS for Minecraft CC


SUBMITTED BY: Guest

DATE: Jan. 23, 2014, 10:18 p.m.

FORMAT: Lua

SIZE: 1.5 kB

HITS: 1290

  1. function os.pullEvent()
  2. local event, p1, p2, p3, p4, p5 = os.pullEventRaw()
  3. if event == "terminate" then
  4. os.reboot()
  5. end
  6. return event, p1, p2, p3, p4, p5
  7. end
  8. local function clearScreen()
  9. term.clear()
  10. term.setCursorPos(1,1)
  11. end
  12. clearScreen()
  13. print("ChopTerminal 1.0")
  14. print("Door Lock System")
  15. print("----------------")
  16. sleep(1)
  17. local user1 = "<NAME>"
  18. local user2 = "<NAME2>"
  19. local pass1 = "<PASSWORD1>"
  20. local pass2 = "<PASSWORD2>"
  21. local override = "<OVERRIDE CODE>"
  22. local input = " "
  23. write("Please enter your name: ")
  24. input = read("*")
  25. if input == user1 then
  26. sleep(1)
  27. print("Welcome, Choppie!")
  28. write("Please enter your password: ")
  29. input2 = read("*")
  30. if input2 == pass1 then
  31. print("Access Granted!")
  32. rs.setOutput("left",true)
  33. sleep(2)
  34. rs.setOutput("left",false)
  35. os.reboot()
  36. else
  37. print("Wrong Password!")
  38. sleep(1)
  39. os.reboot()
  40. end
  41. elseif input == user2 then
  42. sleep(1)
  43. print("Welcome, Guy!")
  44. write("Please enter your password: ")
  45. input3 = read("*")
  46. if input3 == pass2 then
  47. print("Access Granted!")
  48. rs.setOutput("left",true)
  49. sleep(2)
  50. rs.setOutput("left",false)
  51. os.reboot()
  52. else
  53. print("Wrong Password!")
  54. sleep(1)
  55. os.reboot()
  56. end
  57. else
  58. print("Wrong User!")
  59. sleep(1)
  60. os.shutdown()
  61. end