It works by (Or atleast what I am trying to do) having you enter the number of which missile silo you want to launch.
Then it broadcasts a custom code depending on the 1-6 number you chose.
Then another computer built on an obsidian tower picks that up and then broadcasts another code
Then two computers hooked up to wireless redstone blocks pick those up, and one of them will give a redstone pulse to the wireless transmitter block that gets sent to the missile silo, launching the missile.
I am 100% SURE this is an error with the code (BTW, no error message or anything)
This code is where the launch person enters the silo number to launch
term.clear()
sleep(0)
term.setCursorPos(1,1)
sleep(0)
rednet.open("top")
print(os.getComputerID())
print(" ")
print("Enter the silo number to launch,")
print(" ")
print("[1]")
print("[2]")
print("[3]")
print("[4]")
print("[5]")
print("[6]")
print("or all")
print(" ")
write("Launch silo number ")
numl = read()
print("Launching silo number "..numl)
rednet.broadcast("launchnumber"..numl)
sleep(3)
shell.run("startup")
if numl == "all" then
rednet.broadcast("launchall")
print("Launching all missiles.")
sleep(3)
shell.run("startup")
end
This is the code on the obsidian tower.
print(os.getComputerID())
print(" ")
print(" ")
while true do
rednet.open("top")
id, msg = rednet.receive()
if id == "1" and msg == "launchnum1" then
rednet.broadcast("launch1")
print("1launch")
elseif id == "1" and msg == "launchnum2" then
rednet.broadcast("launch2")
elseif id == "1" and msg == "launchnum3" then
rednet.broadcast("launch3")
elseif id == "1" and msg == "launchnum4" then
rednet.broadcast("launch4")
elseif id == "1" and msg == "launchnum5" then
rednet.broadcast("launch5")
elseif id == "1" and msg == "launchnum6" then
rednet.broadcast("launch6")
elseif id == "1" and msg == "launchall" then
rednet.broadcast("lanall")
end
end
This is the code for the two receiving computers that emmit a redstone pulse to launch the missiles
rs.setOutput("front",false)
rs.setOutput("right",false)
rs.setOutput("left",false)
print("This sends to 3-6 missiles")
rednet.open("top")
id, msg = rednet.receive()
if id == "2" and msg == "launch4" then
rs.setOutput("front",true)
sleep(1)
shell.run("startup")
elseif id == "2" and msg == "launch5" then
rs.setOutput("left",true)
sleep(1)
shell.run("startup")
elseif id == "2" and msg == "launch6" then
rs.setOUtput("right",true)
sleep(1)
shell.run("startup")
end
and
rs.setOutput("front",false)
rs.setOutput("left",false)
rs.setOutput("right",false)
print("This sends to 1-3 missiles")
rednet.open("top")
id, msg = rednet.receive()
if id == "2" and msg == "launch1" then
rs.setOutput("front",true)
sleep(1)
shell.run("startup")
if id == "2" and msg == "launch2" then
rs.setOutput("left",true)
sleep(1)
shell.run("startup")
if id == "2" and msg == "launch3" then
rs.setOutput("right",true)
sleep(1)
shell.run("startup")
end
end
end
Hope you guys can help
Please don't put it all into one computer, i like it using four computers.