Advertisement
Guest User

Untitled

a guest
Jan 31st, 2015
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. ---[[ Variables
  2. lockCheck = redstone.getInput("back")
  3.  
  4.  
  5. --]]
  6.  
  7. ---[[
  8. function doorLock()
  9. term.clear()
  10. term.setCursorPos(1, 1)
  11. type("Password?")
  12. local pwd = read("*")
  13. if pwd == "26845" then
  14. redstone.setOutput("back", false)
  15. end
  16. if pwd == "lock" then
  17. redstone.setOutput("back", true)
  18. end
  19. end
  20.  
  21. --]]
  22.  
  23. ---[[ Function to wrap input to a new line
  24. function newLine()
  25. local _,cY= term.getCursorPos()
  26. term.setCursorPos(1,cY+1)
  27. end
  28. --]]
  29.  
  30.  
  31.  
  32. ---[[ Main menu
  33. function mainMenu()
  34. term.clear()
  35. term.setCursorPos(1,1)
  36. textutils.slowPrint("What would you like to do?")
  37. sleep(1)
  38. newLine()
  39. sleep(0)
  40. if lockCheck == true then
  41. textutils.slowPrint("1. Disengage Reactor Door Lock")
  42. else
  43. textutils.slowPrint("1. Engage Ractor Door Lock")
  44. end
  45. textutils.slowPrint("2. Grant Shell Access")
  46. textutils.slowPrint("3. Exit")
  47. input = read()
  48. newLine()
  49. if input == "1" then
  50. doorLock()
  51. end
  52. if input == "2" then
  53. shell.run("shell")
  54. end
  55. if input == "3" then
  56. print("Goodbye!")
  57. sleep(1)
  58. os.shutdown()
  59. end
  60. end
  61. --]]
  62.  
  63. mainMenu()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement