Advertisement
Marlingaming

USSR MAD LRADS 1.2.0

Jan 8th, 2021 (edited)
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.67 KB | None | 0 0
  1. NM = 0--Nuclear Missiles
  2. CM = 0--Chemical Missiles
  3. FM = 0--Fire Missiles
  4. SM = 0--Strike Missiles
  5. EMP = 0--EMP Missiles
  6. DEFCON = 3--currently must be manually changed
  7. SiloID = 1-- ID of the Silo
  8. NE = 1
  9. MilitaryBaseID = 0
  10. KeyCardCode = "disk/passcode"
  11. LaunchCode = 11111
  12.  
  13. local function centerText(text)
  14. local x,y = term.getSize()
  15. local x2,y2 = term.getCursorPos()
  16. term.setCursorPos(math.ceil((x / 2) - (text:len() / 2)), y2)
  17. print(text)
  18. end
  19.  
  20. local function centerText2(text)
  21. local x,y = term.getSize()
  22. local x2,y2 = term.getCursorPos()
  23. term.setCursorPos(math.ceil((x / 2) - (text:len() / 2)), y2)
  24. textutils.slowPrint(text)
  25. end
  26. function Logo()
  27. term.clear()
  28. term.setCursorPos(1,1)
  29. term.setTextColor( colors.yellow )
  30. print("///////////////////////////////////////////////////////////")
  31. term.setTextColor( colors.white )
  32. centerText("----------LRAMLS_V1.2.0-----------")
  33. term.setTextColor( colors.yellow )
  34. print("///////////////////////////////////////////////////////////")
  35. term.setTextColor( colors.red )
  36. centerText(" `.:` ")
  37. centerText(" .+/:- `+o. ")
  38. centerText(" .ohhh/` /h:")
  39. centerText(" ohhhyy: yh.")
  40. centerText(" `//` /yy: sh+")
  41. centerText(" /hy/:hh:")
  42. centerText(" -sys/--:yhhho ")
  43. centerText("`+ss- -+syhysohh+`")
  44. centerText("yy+` `+hs")
  45. term.setTextColor( colors.yellow )
  46. print("///////////////////////////////////////////////////////////")
  47. term.setTextColor( colors.white )
  48. print("PROPERTY OF USSR, Version 1.2.0, 1/13/21, Long Range Automated Defense System")
  49. term.setTextColor( colors.yellow )
  50. print("//////////////////////////////////////////////////////////")
  51. term.setTextColor( colors.white )
  52. end
  53. function NetworkSetup()
  54. local wireless = peripheral.wrap("front")
  55. rednet.open("front")
  56. local id, message, protocol = rednet.receive(MilitaryBaseID)
  57. if message == "DEFCON 4" then
  58. if DEFCON == 3 then
  59. DEFCON = 4
  60. end
  61. elseif message == "DEFCON 3" then
  62. if DEFCON == 4 or 2 then
  63. DEFCON = 3
  64. end
  65. elseif message == "DEFCON 2" then
  66. if DEFCON == 3 then
  67. DEFCON = 2
  68. end
  69. elseif message == LaunchCode then
  70. if DEFCON == 2 and disk.getLabel("top") == KeyCardCode then
  71. print("DEFCON 1 IS NOW IN EFFECT, DEPLOYING PAYLOAD")
  72. fs.open(os.day() .. "NUCLEAR REPORT", W)
  73. h.write("NUCLEAR EVENT DETECTED, SILO IS ARMED, LAUNCHING MISSILES.\n")
  74. h.write("Date and Time of Event\n")
  75. h.write(os.day())
  76. redstone.setOutput("right", t)
  77. sleep(10)
  78. redstone.setOutput("left", t)
  79. sleep(5)
  80. redstone.setOutput("bottom", t)
  81. h.write("Completing Event Log\n")
  82. h.write("Missiles Deployed: N"..NM..", CH"..CM..", FM"..FM..", SM"..SM..", EMP"..EMP..'\n')
  83. h.write("USSR LRADS SILO #"..SiloID.."\n")
  84. h.write(" `-- \n")
  85. h.write(" .oho. .s. \n")
  86. h.write(" -hsoo. +y \n")
  87. h.write(" ` .oo-sh \n")
  88. h.write(" .++o+/yhh+ \n")
  89. h.write("ss. .--`-so \n")
  90. h.write("END OF REPORT")
  91. h.close()
  92. DEFCON = 1
  93. Logo()
  94. sleep(8)
  95. os.shutdown()
  96. end
  97. end
  98. end
  99. function System()
  100. while true do
  101. event = os.pullEvent()
  102. if event == "redstone" then
  103. shell.run("clear")
  104. if rs.getInput("back") then
  105. print("MISSILE DETECTED")
  106. if disk.isPresent("top") then
  107. h = fs.open(KeyCardCode, "r")
  108. if disk.getLabel("top") == KeyCardCode then
  109. print("Silo is active")
  110. if DEFCON == 2 then
  111. print("DEFCON 1 IS NOW IN EFFECT, DEPLOYING PAYLOAD")
  112. fs.open(os.day() .. "NUCLEAR REPORT", W)
  113. h.write("NUCLEAR EVENT DETECTED, SILO IS ARMED, LAUNCHING MISSILES.\n")
  114. h.write("Date and Time of Event\n")
  115. h.write(os.day())
  116. redstone.setOutput("right", t)
  117. sleep(10)
  118. redstone.setOutput("left", t)
  119. sleep(5)
  120. redstone.setOutput("bottom", t)
  121. h.write("Completing Event Log\n")
  122. h.write("Missiles Deployed: N"..NM..", CH"..CM..", FM"..FM..", SM"..SM..", EMP"..EMP..'\n')
  123. h.write("USSR LRADS SILO #"..SiloID.."\n")
  124. h.write(" `-- \n")
  125. h.write(" .oho. .s. \n")
  126. h.write(" -hsoo. +y \n")
  127. h.write(" ` .oo-sh \n")
  128. h.write(" .++o+/yhh+ \n")
  129. h.write("ss. .--`-so \n")
  130. h.write("END OF REPORT")
  131. h.close()
  132. DEFCON = 1
  133. Logo()
  134. sleep(8)
  135. os.shutdown()
  136. else
  137. h = fs.open("NUCLEAR REPORT", "w")
  138. h.write("NUCLEAR EVENT DETECTED, SILO WAS INACTIVE\n")
  139. h.write("Date and Time of Event\n")
  140. h.write(os.day())
  141. h.write("Missiles Deployed: N"..NM..", CH"..CM..", FM"..FM..", SM"..SM..", EMP"..EMP..'\n')
  142. h.write("USSR LRADS SILO #"..SiloID.."\n")
  143. h.write(" `-- \n")
  144. h.write(" .oho. .s. \n")
  145. h.write(" -hsoo. +y \n")
  146. h.write(" ` .oo-sh \n")
  147. h.write(" .++o+/yhh+ \n")
  148. h.write("ss. .--`-so \n")
  149. h.write("END OF REPORT")
  150. h.close()
  151. Logo()
  152. sleep(8)
  153. os.shutdown()
  154. end
  155. else
  156. print("INCORRECT KEY")
  157. end
  158. else
  159. print("SILO IS INACTIVE")
  160. end
  161. else
  162. print("ALL CLEAR")
  163. if disk.isPresent("top") then
  164. h = fs.open(KeyCardCode, "r")
  165. if disk.getLabel("top") == KeyCardCode then
  166. print("MISSILE SILO IS CURRENTLY PRIMED")
  167. else
  168. Logo()
  169. print("INCORRECT KEY")
  170. end
  171. else
  172. Logo()
  173. print("SILO IS INACTIVE")
  174. end
  175. end
  176. end
  177. end
  178. end
  179. Logo()
  180. System()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement