Advertisement
Guest User

Doors

a guest
Mar 28th, 2015
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.35 KB | None | 0 0
  1. password = "1337"
  2.  
  3.  
  4. function checkPassword()
  5.   term.clear()
  6.   term.setCursorPos(1,1)
  7.   term.setTextColor(colors.green)
  8.   print("Enter Your Password")
  9.   term.setTextColor(colors.white)
  10.   input = read("#")
  11.  
  12.   if input == password then
  13.     return true
  14.   else
  15.     return false
  16.   end
  17. end
  18. term.clear()
  19. term.setCursorPos(1,1)
  20. term.setTextColor(colors.blue)
  21. print("Made By TheProjectAce")
  22. sleep(1)
  23. term.setTextColor(colors.white)
  24. while true do
  25. term.clear()
  26. term.setCursorPos(1,1)
  27.  
  28. term.setTextColor(colors.blue)
  29. print("What Do You Wish To Do:")
  30. term.setTextColor(colors.green)
  31. print("1. Open Door")
  32. print("2. Close Door")
  33. print("3. Logout")
  34. term.setTextColor(colors.white)
  35.  
  36. input = read("#")
  37.  
  38. if input == "1" then
  39.   if checkPassword() == true then
  40.     term.clear()
  41.     term.setCursorPos(1,1)
  42.     term.setTextColor(colors.purple)
  43.     print("Opening Doors...")
  44.     term.setTextColor(colors.white)
  45.     sleep(2)
  46.     rs.setOutput("bottom",true)
  47.     sleep(2)
  48.     rs.setOutput("bottom",false)
  49.     term.setCursorPos(1,1)
  50.   else
  51.     term.clear()
  52.     term.setCursorPos(1,1)
  53.     term.setTextColor(colors.red)
  54.     print("Invalid Password")
  55.     sleep(2)
  56.     term.setTextColor(colors.white)
  57.   end
  58. elseif input == "2" then
  59.       if checkPassword() == true then
  60.         term.clear()
  61.         term.setCursorPos(1,1)
  62.         term.setTextColor(colors.purple)
  63.         print("Closing Doors...")
  64.         term.setTextColor(colors.white)
  65.         sleep(2)
  66.         rs.setOutput("bottom",false)
  67.       else
  68.         term.clear()
  69.         term.setCursorPos(1,1)
  70.         term.setTextColor(colors.red)
  71.         print("Invalid Password")
  72.         sleep(2)
  73.         term.setTextColor(colors.white)
  74.       end
  75. elseif input == "3" then
  76.       term.setTextColor(colors.purple)
  77.       print("Loging Out")
  78.       sleep(1)
  79.       term.setTextColor(colors.white)
  80.       shell.run("LoginSystem")
  81. elseif input == "OptOut" then
  82.       term.setTextColor(colors.red)
  83.       print("Bypassing Login/Logout System...")
  84.       print("Also Bypassing DoorsAPI...")
  85.       sleep(2)
  86.       term.setTextColor(colors.white)
  87.       term.clear()
  88.       term.setCursorPos(1,1)
  89.       break
  90. else
  91.   term.clear()
  92.   term.setCursorPos(1,1)
  93.   term.setTextColor(colors.red)
  94.   print("Invalid Number Entry")
  95.   sleep(2)
  96.   term.setTextColor(colors.white)
  97.   term.clear()
  98.   term.setCursorPos(1,1)
  99. end
  100.  
  101. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement