Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.clear()
- term.setCursorPos(1,1)
- print("==========================================")
- print(" Skynet Defense Systems ")
- print("==========================================")
- rednet.open("back")
- -----------------------------SiloFunction----------------------------
- allSilos = {}
- function getSilos()
- allSilos = {}
- rednet.broadcast("CheckIn")
- checking = true
- while checking do
- x = nil
- y = nil
- x,y = rednet.receive(2)
- if x ~= nil and y ~= nil then
- table.insert(allSilos, y)
- else
- checking = false
- end
- end
- end
- ---------------------To get the active silos ID's---------------------
- while true do
- print("==========================================")
- print(" Launch Interface ")
- print("==========================================")
- print("[1] ListSilos")
- print("[2] Launch")
- input = read()
- if input == "1" then
- getSilos()
- term.setCursorPos(1,20)
- print("List of available silos:")
- for _,ID in pairs(allSilos) do
- print("Silo #"..ID.." ready for launch.")
- end
- ---------------------------Launch Control-----------------------------
- elseif input == "2" then
- print("Enter # of launches.")
- local launches = read()
- print("Location Tracking...")
- print("X:")
- tonumber(read())
- print("Y:")
- tonumber(read())
- print("Z:")
- tonumber(read())
- local lauchCoords = textutils.serialize({x=x, y=y, z=z})
- for i=1,tonumber(launches) do
- for _,silo in pairs(allSilos) do
- rednet.send(tonumber(silo),launchCoords)
- sleep(4)
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement