Advertisement
CS8700

ComputerCraft Missile Code

Jul 28th, 2018
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.33 KB | None | 0 0
  1. term.setBackgroundColor(colors.gray)
  2. term.setTextColor(colors.green)
  3. sSide = "back"
  4. password = "1234"
  5. yes = "yes"
  6. term.clear()
  7. term.setCursorPos(1,1)
  8. print("SILO A:")
  9. print("TYPE: CHEMICAL")
  10. print("SUBJECT: VILLAGE")
  11. sleep(1)
  12. write("loading")
  13. textutils.slowWrite("...", 1.5)
  14. sleep(1)
  15. term.clear()
  16. term.setCursorPos(1,2)
  17. print("ENTER AUTHENTIFICATION CODE TO")
  18. print("CONTINUE WITH LAUNCH SEQUENCE")
  19. term.setCursorPos(2,5)
  20. write("CODE:")
  21. input1 = read("*")
  22. term.setTextColor(colors.red)
  23. term.setCursorPos(21,7)
  24. if input1 == password then
  25. term.setTextColor(colors.blue)
  26. print("ACCEPTED")
  27. term.setCursorPos(21,8)
  28. term.setTextColor(colors.green)
  29. write("loading")
  30. textutils.slowWrite("...", 1.5)
  31. term.clear()
  32. term.setCursorPos(2,2)
  33. print("ARE YOU SURE THAT YOU WANT TO LAUNCH?")
  34. term.setCursorPos(5,18)
  35. term.setTextColor(colors.red)
  36. print("THIS PROCESS IS IRREVERSIBLE")
  37. term.setCursorPos(3,3)
  38. term.setTextColor(colors.green)
  39. input2 = read()
  40. if input2 == yes then
  41. term.clear()
  42. term.setCursorPos(1,2)
  43. print("Opening Silo...")
  44. redstone.setBundledOutput(sSide, colors.white)
  45. sleep(1)
  46. redstone.setBundledOutput(sSide, colors.lightGray)
  47. sleep(1)
  48. redstone.setBundledOutput(sSide, colors.lightBlue)
  49. sleep(5)
  50. redstone.setBundledOutput(sSide, 0)
  51. print("Calculating Missile Path...")
  52. sleep(1.5)
  53. print("Locating Target...")
  54. sleep(1.5)
  55. print("Running Aerodynamic Simulation...")
  56. sleep(1.5)
  57. write("Firing in")
  58. textutils.slowWrite(" 3 2 1 ", 2)
  59. print()
  60. term.setTextColor(colors.red)
  61. print("IGNTITION")
  62. redstone.setBundledOutput(sSide, colors.green)
  63. sleep(5)
  64. term.clear()
  65. term.setCursorPos(1,2)
  66. term.setTextColor(colors.green)
  67. print("Closing Silo...")
  68. redstone.setBundledOutput(sSide, colors.blue)
  69. sleep(5)
  70. redstone.setBundledOutput(sSide, colors.black)
  71. sleep(1)
  72. redstone.setBundledOutput(sSide, colors.gray)
  73. sleep(1)
  74. redstone.setBundledOutput(sSide, 0)
  75. term.setCursorPos(13,8)
  76. term.setTextColor(colors.red)
  77. print("AutoShutdown in 5 seconds")
  78. sleep(5)
  79. os.shutdown()
  80. else
  81. term.setTextColor(colors.red)
  82. term.setCursorPos(4,8)
  83. print("Launch Cancelled. AutoShutdown in 5 seconds")
  84. sleep(5)
  85. os.shutdown()
  86. end
  87. else
  88. term.setCursorPos(20,7)
  89. term.setTextColor(colors.red)
  90. print("DENIED")
  91. term.setCursorPos(13,8)
  92. print("AutoShutdown in 5 seconds")
  93. redstone.setBundledOutput(sSide, colors.lime)
  94. sleep(5)
  95. os.shutdown()
  96. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement