Posted 18 August 2012 - 02:33 AM
After seeing Kadecamz's Missile control system, I decided to post my own:
It has 2 methods of authentication: password/launch code and and a disk drive-based password.
It checks the first floppy for a file named "verify" with a special code inside. If that check passes, it asks for a launch code, and checks to see if it's the right one. If that passes, it activates the back redstone output, and it broadcasts the launch code on rednet, so that a separate piece of software can recieve it and launch their missiles.
keyHandle = fs.open("disk/verify", "r")
key = keyHandle.readLine()
print("Press any key to continue to launch sequence.")
while true do
event = os.pullEvent()
if event == "key" then
break
end
end
if key == "A5 C5 B2 F7 E3" then
print("Key Verified.")
os.sleep(1)
print("Confirm Launch (Y/N)>")
confirm = io.read()
if confirm == "y" or confirm == "Y" then
term.clear()
term.setCursorPos(1,1)
term.write("Enter launch code: ")
launchCode = io.read()
if launchCode == "ATCDIN255" then
print("Cancel launch with Ctrl+T.")
print("Launching in ten seconds...")
print("T-minus 10 seconds to launch.")
os.sleep(1)
print("T-minus 9 seconds to launch.")
os.sleep(1)
print("T-minus 8 seconds to launch.")
os.sleep(1)
print("T-minus 7 seconds to launch.")
os.sleep(1)
print("T-minus 6 seconds to launch.")
os.sleep(1)
print("T-minus 5 seconds to launch.")
os.sleep(1)
print("T-minus 4 seconds to launch.")
os.sleep(1)
print("T-minus 3 seconds to launch.")
os.sleep(1)
print("T-minus 2 seconds to launch.")
os.sleep(1)
print("T-minus 1 seconds to launch.")
os.sleep(1)
print("T-minus 0 seconds to launch.")
os.sleep(1)
print("Firing missile.")
redstone.setOutput("back", true)
rednet.open("top")
rednet.broadcast("ATCDIN255")
print("Launch code transmitted.")
print("Automated silos firing.")
os.sleep(1)
redstone.setOutput("back", false)
print("Missile launched.")
else
print("Invalid launch code.")
os.shutdown()
end
else
print("Cancelling launch...")
os.sleep(2)
os.shutdown()
end
else
print("Invalid key.")
os.sleep(2)
os.shutdown()
end
It has 2 methods of authentication: password/launch code and and a disk drive-based password.
It checks the first floppy for a file named "verify" with a special code inside. If that check passes, it asks for a launch code, and checks to see if it's the right one. If that passes, it activates the back redstone output, and it broadcasts the launch code on rednet, so that a separate piece of software can recieve it and launch their missiles.