Advertisement
Guest User

startup

a guest
Nov 24th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.75 KB | None | 0 0
  1. local mon = peripheral.wrap("monitor_4")
  2. local password = "boom"
  3. local opentime = 5
  4. local number = 5
  5.  
  6. while true do
  7.  
  8. mon.setBackgroundColor(colors.lightBlue)
  9. mon.clear()
  10. mon.setCursorPos(7,2)
  11. mon.write("Main Base Reactor")
  12.  
  13.  
  14. term.setBackgroundColor(colors.black)
  15. term.clear()
  16. term.setCursorPos(14,1)
  17. term.setTextColor(colors.blue)
  18. term.write("Reactor Access Terminal")
  19.  
  20. term.setTextColor(colors.red)
  21. term.setCursorPos(15,15)
  22. term.write("Attempts Remaining " .. number)
  23. term.setCursorPos(1,3)
  24. term.setTextColor(colors.yellow)
  25. term.write("Enter Access Code: ")
  26.  
  27. input = read("*")
  28.  
  29. if input == password then
  30.  
  31.   term.setCursorPos(1,5)
  32.   term.setTextColor(colors.green)
  33.   term.write("Mag-Locks Disengaging")
  34.   term.setCursorPos(1,6)
  35.   term.write("Please Wait")
  36.   mon.setBackgroundColor(colors.green)
  37.   mon.clear()
  38.   mon.setCursorPos(5,2)
  39.   mon.setTextColor(colors.black)
  40.   mon.write("Mag-Locks Disengaging")
  41.   sleep(2)
  42.   term.setCursorPos(1,8)
  43.   term.write("Mag-Locks Released")
  44.   mon.clear()
  45.   mon.setCursorPos(5,2)
  46.   mon.write("Mag-Locks Released")
  47.   sleep(1)
  48.   mon.setCursorPos(5,3)
  49.   term.setCursorPos(1,9)
  50.   sleep(1)
  51.   mon.write("Doors Open")
  52.   term.write("Doors Open")
  53.   rs.setOutput("left", true)
  54.   sleep(opentime)
  55.   rs.setOutput("left", false)
  56.   number = 5
  57.  
  58. else
  59.  
  60.   term.setCursorPos(1,5)
  61.   term.setTextColor(colors.red)
  62.   term.write("Code Incorrect")
  63.   sleep(1)
  64.   number = number - 1
  65.  
  66.     if number == 0 then
  67.       term.setBackgroundColor(colors.red)
  68.       term.clear()
  69.       term.setCursorPos(10,8)
  70.       term.setTextColor(colors.white)
  71.       term.write("ALARM ACTIVATED TERMINAL LOCKED")
  72.       rs.setOutput("right", true)
  73.       sleep(15)
  74.       number = 5
  75.       rs.setOutput("right", false)
  76.     end
  77.  
  78. end
  79. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement