Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NM = 0--Nuclear Missiles
- CM = 0--Chemical Missiles
- FM = 0--Fire Missiles
- SM = 0--Strike Missiles
- EMP = 0--EMP Missiles
- DEFCON = 3--currently must be manually changed
- SiloID = 1-- ID of the Silo
- NE = 1
- MilitaryBaseID = 0
- KeyCardCode = "disk/passcode"
- LaunchCode = 11111
- local function centerText(text)
- local x,y = term.getSize()
- local x2,y2 = term.getCursorPos()
- term.setCursorPos(math.ceil((x / 2) - (text:len() / 2)), y2)
- print(text)
- end
- local function centerText2(text)
- local x,y = term.getSize()
- local x2,y2 = term.getCursorPos()
- term.setCursorPos(math.ceil((x / 2) - (text:len() / 2)), y2)
- textutils.slowPrint(text)
- end
- function Logo()
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColor( colors.yellow )
- print("///////////////////////////////////////////////////////////")
- term.setTextColor( colors.white )
- centerText("----------LRAMLS_V1.2.0-----------")
- term.setTextColor( colors.yellow )
- print("///////////////////////////////////////////////////////////")
- term.setTextColor( colors.red )
- centerText(" `.:` ")
- centerText(" .+/:- `+o. ")
- centerText(" .ohhh/` /h:")
- centerText(" ohhhyy: yh.")
- centerText(" `//` /yy: sh+")
- centerText(" /hy/:hh:")
- centerText(" -sys/--:yhhho ")
- centerText("`+ss- -+syhysohh+`")
- centerText("yy+` `+hs")
- term.setTextColor( colors.yellow )
- print("///////////////////////////////////////////////////////////")
- term.setTextColor( colors.white )
- print("PROPERTY OF USSR, Version 1.2.0, 1/13/21, Long Range Automated Defense System")
- term.setTextColor( colors.yellow )
- print("//////////////////////////////////////////////////////////")
- term.setTextColor( colors.white )
- end
- function NetworkSetup()
- local wireless = peripheral.wrap("front")
- rednet.open("front")
- local id, message, protocol = rednet.receive(MilitaryBaseID)
- if message == "DEFCON 4" then
- if DEFCON == 3 then
- DEFCON = 4
- end
- elseif message == "DEFCON 3" then
- if DEFCON == 4 or 2 then
- DEFCON = 3
- end
- elseif message == "DEFCON 2" then
- if DEFCON == 3 then
- DEFCON = 2
- end
- elseif message == LaunchCode then
- if DEFCON == 2 and disk.getLabel("top") == KeyCardCode then
- print("DEFCON 1 IS NOW IN EFFECT, DEPLOYING PAYLOAD")
- fs.open(os.day() .. "NUCLEAR REPORT", W)
- h.write("NUCLEAR EVENT DETECTED, SILO IS ARMED, LAUNCHING MISSILES.\n")
- h.write("Date and Time of Event\n")
- h.write(os.day())
- redstone.setOutput("right", t)
- sleep(10)
- redstone.setOutput("left", t)
- sleep(5)
- redstone.setOutput("bottom", t)
- h.write("Completing Event Log\n")
- h.write("Missiles Deployed: N"..NM..", CH"..CM..", FM"..FM..", SM"..SM..", EMP"..EMP..'\n')
- h.write("USSR LRADS SILO #"..SiloID.."\n")
- h.write(" `-- \n")
- h.write(" .oho. .s. \n")
- h.write(" -hsoo. +y \n")
- h.write(" ` .oo-sh \n")
- h.write(" .++o+/yhh+ \n")
- h.write("ss. .--`-so \n")
- h.write("END OF REPORT")
- h.close()
- DEFCON = 1
- Logo()
- sleep(8)
- os.shutdown()
- end
- end
- end
- function System()
- while true do
- event = os.pullEvent()
- if event == "redstone" then
- shell.run("clear")
- if rs.getInput("back") then
- print("MISSILE DETECTED")
- if disk.isPresent("top") then
- h = fs.open(KeyCardCode, "r")
- if disk.getLabel("top") == KeyCardCode then
- print("Silo is active")
- if DEFCON == 2 then
- print("DEFCON 1 IS NOW IN EFFECT, DEPLOYING PAYLOAD")
- fs.open(os.day() .. "NUCLEAR REPORT", W)
- h.write("NUCLEAR EVENT DETECTED, SILO IS ARMED, LAUNCHING MISSILES.\n")
- h.write("Date and Time of Event\n")
- h.write(os.day())
- redstone.setOutput("right", t)
- sleep(10)
- redstone.setOutput("left", t)
- sleep(5)
- redstone.setOutput("bottom", t)
- h.write("Completing Event Log\n")
- h.write("Missiles Deployed: N"..NM..", CH"..CM..", FM"..FM..", SM"..SM..", EMP"..EMP..'\n')
- h.write("USSR LRADS SILO #"..SiloID.."\n")
- h.write(" `-- \n")
- h.write(" .oho. .s. \n")
- h.write(" -hsoo. +y \n")
- h.write(" ` .oo-sh \n")
- h.write(" .++o+/yhh+ \n")
- h.write("ss. .--`-so \n")
- h.write("END OF REPORT")
- h.close()
- DEFCON = 1
- Logo()
- sleep(8)
- os.shutdown()
- else
- h = fs.open("NUCLEAR REPORT", "w")
- h.write("NUCLEAR EVENT DETECTED, SILO WAS INACTIVE\n")
- h.write("Date and Time of Event\n")
- h.write(os.day())
- h.write("Missiles Deployed: N"..NM..", CH"..CM..", FM"..FM..", SM"..SM..", EMP"..EMP..'\n')
- h.write("USSR LRADS SILO #"..SiloID.."\n")
- h.write(" `-- \n")
- h.write(" .oho. .s. \n")
- h.write(" -hsoo. +y \n")
- h.write(" ` .oo-sh \n")
- h.write(" .++o+/yhh+ \n")
- h.write("ss. .--`-so \n")
- h.write("END OF REPORT")
- h.close()
- Logo()
- sleep(8)
- os.shutdown()
- end
- else
- print("INCORRECT KEY")
- end
- else
- print("SILO IS INACTIVE")
- end
- else
- print("ALL CLEAR")
- if disk.isPresent("top") then
- h = fs.open(KeyCardCode, "r")
- if disk.getLabel("top") == KeyCardCode then
- print("MISSILE SILO IS CURRENTLY PRIMED")
- else
- Logo()
- print("INCORRECT KEY")
- end
- else
- Logo()
- print("SILO IS INACTIVE")
- end
- end
- end
- end
- end
- Logo()
- System()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement