This is a read-only snapshot of the ComputerCraft forums,
taken in April 2020.
How to run programs on one computer from another computer
Started by pig101z, 12 May 2013 - 09:14 PMPosted 12 May 2013 - 11:14 PM
i have a icbm mod program and I need to rig one computer to control 12 over rednet I am not good at programing what so ever so please explain in as much detail as possible like where to enter commands or to use the edit program thanks
Posted 13 May 2013 - 01:01 AM
This post reads like "Please tell me how to write my program", which is a bit of a big ask. Better next time you have a go at it before asking for help.
From a system design perspective, you're going to need to have some sort of controller program that is able to send commands to each (or all) of the 12 computers, I assume themselves controlling the ICBMs. How that is going to work will depend entirely on what your system needs to be able to do. Does it need to be able to control all computers in unison or separately? How much security does it require? What sort of operations will the computers need to be able to perform, and how much feedback do you require? These are all questions you'll need to answer before you can start making a program.
Once you've got an idea of what you want your system to do, and written it down/drawn it up nice and clearly you can start thinking about writing it. Judging from the wording of your post I'll assume you're new to computercraft and to lua, so I'd browse through some existing online tutorials, lua-users.org and the computercraft wiki. Then you can have a go at writing your program and, if you're still having issues, post back with your code so we can scrutinize it.
Hope this helps, and good luck :)/>
From a system design perspective, you're going to need to have some sort of controller program that is able to send commands to each (or all) of the 12 computers, I assume themselves controlling the ICBMs. How that is going to work will depend entirely on what your system needs to be able to do. Does it need to be able to control all computers in unison or separately? How much security does it require? What sort of operations will the computers need to be able to perform, and how much feedback do you require? These are all questions you'll need to answer before you can start making a program.
Once you've got an idea of what you want your system to do, and written it down/drawn it up nice and clearly you can start thinking about writing it. Judging from the wording of your post I'll assume you're new to computercraft and to lua, so I'd browse through some existing online tutorials, lua-users.org and the computercraft wiki. Then you can have a go at writing your program and, if you're still having issues, post back with your code so we can scrutinize it.
Hope this helps, and good luck :)/>
Posted 13 May 2013 - 08:25 AM
this is my program it works just fine on one computer
local oldPull = os.pullEvent
os.pullEvent = os.pullEventRaw
local silos = {}
local argv = {…}
local selected = 1
local color = {"silver"}
for i,v in pairs(colors) do
if i ~= "combine" and i ~= "subtract" and i ~= "test" and i ~= "lightGray" then
table.insert(color, i)
end
end
print("Detecting silos…")
for i,side in ipairs(rs.getSides()) do
if argv[1] == "–debug" then
print("Checking: "..side)
end
if peripheral.getType(side) == "cable" then
if argv[1] == "–debug" then
print("Found a peripheral cable.")
end
for i2, color in ipairs(color) do
if argv[1] == "–debug" then
print("Checking: "..side..":"..color)
end
if peripheral.getType(side..":"..color) == "ICBMLauncher" then
print("Silo found on side:"..side..":"..color)
table.insert(silos, {side..":"..color, peripheral.wrap(side..":"..color)})
end
end
elseif peripheral.getType(side) == "ICBMLauncher" then
print("Silo found on side:"..side)
table.insert(silos, {side, peripheral.wrap(side)})
end
end
if #silos == 0 then
print("No silos detected.")
print("Please place a launcher control panel next to the computer.")
os.sleep(2)
return
elseif #silos == 1 then
print("Found 1 silo.")
else
print("Found "..#silos.." silos.")
end
os.sleep(0.75)
local function getPW()
if fs.exists("launchCode") then
term.clear()
term.setCursorPos(5, 8)
write("Please enter a launch code.")
local handle = fs.open("launchCode", "r")
local code = handle.readAll()
handle.close()
local userPW = read()
term.clear()
term.setCursorPos(1,1)
return (code == userPW)
else
return true
end
end
local function printColored(…)
for i=1, arg["n"] do
if type(arg) == "string" then
write(arg)
elseif type(arg) == "number" then
if term.isColor() then
term.setTextColor(arg)
end
end
end
print("")
term.setTextColor(colors.white)
end
local function doCountdown(length)
for i=length, 1, -1 do
term.clear()
term.setCursorPos(12,9)
write("Launching in: "..i.." seconds…")
term.setCursorPos(3,10)
write("Press any key (except escape) to abort launch.")
local timer = os.startTimer(1)
while true do
local event, id = os.pullEvent()
if event == "key" then
if id ~= 1 then
term.setCursorPos(17,11)
write("Aborting launch!")
os.sleep(0.5)
return false
end
elseif event == "timer" then
if id == timer then
break
end
end
end
end
return true
end
while true do
term.clear()
term.setCursorPos(1,1)
printColored(colors.white, "Silo ", colors.lime, tostring(selected), colors.white, " selected.")
print("")
print("Details: ")
print("")
printColored("Frequency: ", colors.lime, tostring(silos[selected][2].getFrequency()))
local targetX, targetY, targetZ = silos[selected][2].getTarget()
print("Targeted: ")
printColored("X: ", colors.lime, tostring(targetX))
printColored("Y: ", colors.lime, tostring(targetY))
printColored("Z: ", colors.lime, tostring(targetZ))
print("")
print("Options: ")
printColored("1. ", colors.lime, "Select Silo")
printColored("2. ", colors.orange, "Set Silo Target")
printColored("3. ", colors.orange, "Set Silo Frequency")
printColored("4. ", colors.red, "Launch")
printColored("5. ", colors.red, "Launch All")
printColored("6. ", colors.orange, "Set All Silo Frequencies")
printColored("7. ", colors.orange, "Set All Silo Targets")
local event, key = os.pullEvent("key")
if key == 2 then
term.clear()
term.setCursorPos(1,1)
print("Detected silos:")
for i,v in ipairs(silos) do
print(i..". Silo on: "..v[1].." side")
end
local x, y = term.getCursorPos()
while true do
term.setCursorPos(x,y)
term.clearLine()
write("Selection> ")
local data = tonumber(read())
if data then
if silos[data] then
selected = data
break
end
end
end
elseif key == 3 then
local x, y, z = 0
while true do
term.setCursorPos(1,7)
term.clearLine()
write("X: ")
local selX = read()
if tonumber(selX) then
x = tonumber(selX)
break
end
end
while true do
term.setCursorPos(1,8)
term.clearLine()
write("Y: ")
local selY = read()
if tonumber(selY) then
y = tonumber(selY)
break
end
end
while true do
term.setCursorPos(1,9)
term.clearLine()
write("Z: ")
local selZ = read()
if tonumber(selZ) then
z = tonumber(selZ)
break
end
end
silos[selected][2].setTarget(x,y,z)
elseif key == 4 then
while true do
term.setCursorPos(1,5)
term.clearLine()
write("Frequency: ")
local selFreq = read()
if tonumber(selFreq) then
silos[selected][2].setFrequency(tonumber(selFreq))
break
end
end
elseif key == 5 then
if getPW() then
if doCountdown(10) then
silos[selected][2].launch()
end
else
term.clear()
term.setCursorPos(12,9)
print("Incorrect code!")
os.sleep(2)
end
elseif key == 6 then
if getPW() then
if doCountdown(10) then
for i,v in ipairs(silos) do
v[2].launch()
os.sleep(3)
end
end
else
term.clear()
term.setCursorPos(12,9)
print("Incorrect code!")
os.sleep(2)
end
elseif key == 7 then
while true do
term.setCursorPos(1,5)
term.clearLine()
write("Frequency: ")
local selFreq = read()
if tonumber(selFreq) then
for i,v in ipairs(silos) do
v[2].setFrequency(tonumber(selFreq))
end
break
end
end
elseif key == 8 then
local x, y, z = 0
while true do
term.setCursorPos(1,7)
term.clearLine()
write("X: ")
local selX = read()
if tonumber(selX) then
x = tonumber(selX)
break
end
end
while true do
term.setCursorPos(1,8)
term.clearLine()
write("Y: ")
local selY = read()
if tonumber(selY) then
y = tonumber(selY)
break
end
end
while true do
term.setCursorPos(1,9)
term.clearLine()
write("Z: ")
local selZ = read()
if tonumber(selZ) then
z = tonumber(selZ)
break
end
end
for i,v in ipairs(silos) do
v[2].setTarget(x,y,z)
end
end
end
os.pullEvent = oldPull
local oldPull = os.pullEvent
os.pullEvent = os.pullEventRaw
local silos = {}
local argv = {…}
local selected = 1
local color = {"silver"}
for i,v in pairs(colors) do
if i ~= "combine" and i ~= "subtract" and i ~= "test" and i ~= "lightGray" then
table.insert(color, i)
end
end
print("Detecting silos…")
for i,side in ipairs(rs.getSides()) do
if argv[1] == "–debug" then
print("Checking: "..side)
end
if peripheral.getType(side) == "cable" then
if argv[1] == "–debug" then
print("Found a peripheral cable.")
end
for i2, color in ipairs(color) do
if argv[1] == "–debug" then
print("Checking: "..side..":"..color)
end
if peripheral.getType(side..":"..color) == "ICBMLauncher" then
print("Silo found on side:"..side..":"..color)
table.insert(silos, {side..":"..color, peripheral.wrap(side..":"..color)})
end
end
elseif peripheral.getType(side) == "ICBMLauncher" then
print("Silo found on side:"..side)
table.insert(silos, {side, peripheral.wrap(side)})
end
end
if #silos == 0 then
print("No silos detected.")
print("Please place a launcher control panel next to the computer.")
os.sleep(2)
return
elseif #silos == 1 then
print("Found 1 silo.")
else
print("Found "..#silos.." silos.")
end
os.sleep(0.75)
local function getPW()
if fs.exists("launchCode") then
term.clear()
term.setCursorPos(5, 8)
write("Please enter a launch code.")
local handle = fs.open("launchCode", "r")
local code = handle.readAll()
handle.close()
local userPW = read()
term.clear()
term.setCursorPos(1,1)
return (code == userPW)
else
return true
end
end
local function printColored(…)
for i=1, arg["n"] do
if type(arg) == "string" then
write(arg)
elseif type(arg) == "number" then
if term.isColor() then
term.setTextColor(arg)
end
end
end
print("")
term.setTextColor(colors.white)
end
local function doCountdown(length)
for i=length, 1, -1 do
term.clear()
term.setCursorPos(12,9)
write("Launching in: "..i.." seconds…")
term.setCursorPos(3,10)
write("Press any key (except escape) to abort launch.")
local timer = os.startTimer(1)
while true do
local event, id = os.pullEvent()
if event == "key" then
if id ~= 1 then
term.setCursorPos(17,11)
write("Aborting launch!")
os.sleep(0.5)
return false
end
elseif event == "timer" then
if id == timer then
break
end
end
end
end
return true
end
while true do
term.clear()
term.setCursorPos(1,1)
printColored(colors.white, "Silo ", colors.lime, tostring(selected), colors.white, " selected.")
print("")
print("Details: ")
print("")
printColored("Frequency: ", colors.lime, tostring(silos[selected][2].getFrequency()))
local targetX, targetY, targetZ = silos[selected][2].getTarget()
print("Targeted: ")
printColored("X: ", colors.lime, tostring(targetX))
printColored("Y: ", colors.lime, tostring(targetY))
printColored("Z: ", colors.lime, tostring(targetZ))
print("")
print("Options: ")
printColored("1. ", colors.lime, "Select Silo")
printColored("2. ", colors.orange, "Set Silo Target")
printColored("3. ", colors.orange, "Set Silo Frequency")
printColored("4. ", colors.red, "Launch")
printColored("5. ", colors.red, "Launch All")
printColored("6. ", colors.orange, "Set All Silo Frequencies")
printColored("7. ", colors.orange, "Set All Silo Targets")
local event, key = os.pullEvent("key")
if key == 2 then
term.clear()
term.setCursorPos(1,1)
print("Detected silos:")
for i,v in ipairs(silos) do
print(i..". Silo on: "..v[1].." side")
end
local x, y = term.getCursorPos()
while true do
term.setCursorPos(x,y)
term.clearLine()
write("Selection> ")
local data = tonumber(read())
if data then
if silos[data] then
selected = data
break
end
end
end
elseif key == 3 then
local x, y, z = 0
while true do
term.setCursorPos(1,7)
term.clearLine()
write("X: ")
local selX = read()
if tonumber(selX) then
x = tonumber(selX)
break
end
end
while true do
term.setCursorPos(1,8)
term.clearLine()
write("Y: ")
local selY = read()
if tonumber(selY) then
y = tonumber(selY)
break
end
end
while true do
term.setCursorPos(1,9)
term.clearLine()
write("Z: ")
local selZ = read()
if tonumber(selZ) then
z = tonumber(selZ)
break
end
end
silos[selected][2].setTarget(x,y,z)
elseif key == 4 then
while true do
term.setCursorPos(1,5)
term.clearLine()
write("Frequency: ")
local selFreq = read()
if tonumber(selFreq) then
silos[selected][2].setFrequency(tonumber(selFreq))
break
end
end
elseif key == 5 then
if getPW() then
if doCountdown(10) then
silos[selected][2].launch()
end
else
term.clear()
term.setCursorPos(12,9)
print("Incorrect code!")
os.sleep(2)
end
elseif key == 6 then
if getPW() then
if doCountdown(10) then
for i,v in ipairs(silos) do
v[2].launch()
os.sleep(3)
end
end
else
term.clear()
term.setCursorPos(12,9)
print("Incorrect code!")
os.sleep(2)
end
elseif key == 7 then
while true do
term.setCursorPos(1,5)
term.clearLine()
write("Frequency: ")
local selFreq = read()
if tonumber(selFreq) then
for i,v in ipairs(silos) do
v[2].setFrequency(tonumber(selFreq))
end
break
end
end
elseif key == 8 then
local x, y, z = 0
while true do
term.setCursorPos(1,7)
term.clearLine()
write("X: ")
local selX = read()
if tonumber(selX) then
x = tonumber(selX)
break
end
end
while true do
term.setCursorPos(1,8)
term.clearLine()
write("Y: ")
local selY = read()
if tonumber(selY) then
y = tonumber(selY)
break
end
end
while true do
term.setCursorPos(1,9)
term.clearLine()
write("Z: ")
local selZ = read()
if tonumber(selZ) then
z = tonumber(selZ)
break
end
end
for i,v in ipairs(silos) do
v[2].setTarget(x,y,z)
end
end
end
os.pullEvent = oldPull
Posted 13 May 2013 - 10:21 AM
Please can you usethis is my program it works just fine on one computer
local oldPull = os.pullEvent
os.pullEvent = os.pullEventRaw
local silos = {}
local argv = {…}
local selected = 1
local color = {"silver"}
for i,v in pairs(colors) do
if i ~= "combine" and i ~= "subtract" and i ~= "test" and i ~= "lightGray" then
table.insert(color, i)
end
end
print("Detecting silos…")
for i,side in ipairs(rs.getSides()) do
if argv[1] == "–debug" then
print("Checking: "..side)
end
if peripheral.getType(side) == "cable" then
if argv[1] == "–debug" then
print("Found a peripheral cable.")
end
for i2, color in ipairs(color) do
if argv[1] == "–debug" then
print("Checking: "..side..":"..color)
end
if peripheral.getType(side..":"..color) == "ICBMLauncher" then
print("Silo found on side:"..side..":"..color)
table.insert(silos, {side..":"..color, peripheral.wrap(side..":"..color)})
end
end
elseif peripheral.getType(side) == "ICBMLauncher" then
print("Silo found on side:"..side)
table.insert(silos, {side, peripheral.wrap(side)})
end
end
if #silos == 0 then
print("No silos detected.")
print("Please place a launcher control panel next to the computer.")
os.sleep(2)
return
elseif #silos == 1 then
print("Found 1 silo.")
else
print("Found "..#silos.." silos.")
end
os.sleep(0.75)
local function getPW()
if fs.exists("launchCode") then
term.clear()
term.setCursorPos(5, 8)
write("Please enter a launch code.")
local handle = fs.open("launchCode", "r")
local code = handle.readAll()
handle.close()
local userPW = read()
term.clear()
term.setCursorPos(1,1)
return (code == userPW)
else
return true
end
end
local function printColored(…)
for i=1, arg["n"] do
if type(arg) == "string" then
write(arg)
elseif type(arg) == "number" then
if term.isColor() then
term.setTextColor(arg)
end
end
end
print("")
term.setTextColor(colors.white)
end
local function doCountdown(length)
for i=length, 1, -1 do
term.clear()
term.setCursorPos(12,9)
write("Launching in: "..i.." seconds…")
term.setCursorPos(3,10)
write("Press any key (except escape) to abort launch.")
local timer = os.startTimer(1)
while true do
local event, id = os.pullEvent()
if event == "key" then
if id ~= 1 then
term.setCursorPos(17,11)
write("Aborting launch!")
os.sleep(0.5)
return false
end
elseif event == "timer" then
if id == timer then
break
end
end
end
end
return true
end
while true do
term.clear()
term.setCursorPos(1,1)
printColored(colors.white, "Silo ", colors.lime, tostring(selected), colors.white, " selected.")
print("")
print("Details: ")
print("")
printColored("Frequency: ", colors.lime, tostring(silos[selected][2].getFrequency()))
local targetX, targetY, targetZ = silos[selected][2].getTarget()
print("Targeted: ")
printColored("X: ", colors.lime, tostring(targetX))
printColored("Y: ", colors.lime, tostring(targetY))
printColored("Z: ", colors.lime, tostring(targetZ))
print("")
print("Options: ")
printColored("1. ", colors.lime, "Select Silo")
printColored("2. ", colors.orange, "Set Silo Target")
printColored("3. ", colors.orange, "Set Silo Frequency")
printColored("4. ", colors.red, "Launch")
printColored("5. ", colors.red, "Launch All")
printColored("6. ", colors.orange, "Set All Silo Frequencies")
printColored("7. ", colors.orange, "Set All Silo Targets")
local event, key = os.pullEvent("key")
if key == 2 then
term.clear()
term.setCursorPos(1,1)
print("Detected silos:")
for i,v in ipairs(silos) do
print(i..". Silo on: "..v[1].." side")
end
local x, y = term.getCursorPos()
while true do
term.setCursorPos(x,y)
term.clearLine()
write("Selection> ")
local data = tonumber(read())
if data then
if silos[data] then
selected = data
break
end
end
end
elseif key == 3 then
local x, y, z = 0
while true do
term.setCursorPos(1,7)
term.clearLine()
write("X: ")
local selX = read()
if tonumber(selX) then
x = tonumber(selX)
break
end
end
while true do
term.setCursorPos(1,8)
term.clearLine()
write("Y: ")
local selY = read()
if tonumber(selY) then
y = tonumber(selY)
break
end
end
while true do
term.setCursorPos(1,9)
term.clearLine()
write("Z: ")
local selZ = read()
if tonumber(selZ) then
z = tonumber(selZ)
break
end
end
silos[selected][2].setTarget(x,y,z)
elseif key == 4 then
while true do
term.setCursorPos(1,5)
term.clearLine()
write("Frequency: ")
local selFreq = read()
if tonumber(selFreq) then
silos[selected][2].setFrequency(tonumber(selFreq))
break
end
end
elseif key == 5 then
if getPW() then
if doCountdown(10) then
silos[selected][2].launch()
end
else
term.clear()
term.setCursorPos(12,9)
print("Incorrect code!")
os.sleep(2)
end
elseif key == 6 then
if getPW() then
if doCountdown(10) then
for i,v in ipairs(silos) do
v[2].launch()
os.sleep(3)
end
end
else
term.clear()
term.setCursorPos(12,9)
print("Incorrect code!")
os.sleep(2)
end
elseif key == 7 then
while true do
term.setCursorPos(1,5)
term.clearLine()
write("Frequency: ")
local selFreq = read()
if tonumber(selFreq) then
for i,v in ipairs(silos) do
v[2].setFrequency(tonumber(selFreq))
end
break
end
end
elseif key == 8 then
local x, y, z = 0
while true do
term.setCursorPos(1,7)
term.clearLine()
write("X: ")
local selX = read()
if tonumber(selX) then
x = tonumber(selX)
break
end
end
while true do
term.setCursorPos(1,8)
term.clearLine()
write("Y: ")
local selY = read()
if tonumber(selY) then
y = tonumber(selY)
break
end
end
while true do
term.setCursorPos(1,9)
term.clearLine()
write("Z: ")
local selZ = read()
if tonumber(selZ) then
z = tonumber(selZ)
break
end
end
for i,v in ipairs(silos) do
v[2].setTarget(x,y,z)
end
end
end
os.pullEvent = oldPull
Spoiler
and tags in the future? It makes code a LOT easier to read, and ignore :)/>
Posted 13 May 2013 - 11:37 AM
Now I'm not a pro but I think it'd be easier to help you if you
1. Stated more specifically what you are having issues with and
2. Pasted the code (with code tags as shown above) reduced as much as possible. Like, make a small program for the basic function of what you want to do first (launch an ICBM?) and if it doesn't work post here.
As said I'm not a pro and the help I could give is minor but I think others too might be more interested in aiding you if you put a little more effort into the post.
1. Stated more specifically what you are having issues with and
2. Pasted the code (with code tags as shown above) reduced as much as possible. Like, make a small program for the basic function of what you want to do first (launch an ICBM?) and if it doesn't work post here.
As said I'm not a pro and the help I could give is minor but I think others too might be more interested in aiding you if you put a little more effort into the post.
Posted 13 May 2013 - 03:35 PM
what I need to know is how to do I use rednet to send a run program command to a 2nd computer and basically control computer 2 on computer 1 sorry if this sounds wired I got a concussion today and I am out of it
Posted 13 May 2013 - 03:38 PM
You can launch programs with shell.run("programname"), you could use that to set up a system where it waits for a rednet message, if it is "launch" or whatever you want to call it, use shell.run("launchmissile1") or something similiar. Maybe this helps?
Posted 13 May 2013 - 03:45 PM
close but I need to broadcast it using rednet.broadcast to say run missile_silo_command and then send it the number 5 and it will relize that is the launch command and fire the missile
Posted 13 May 2013 - 03:53 PM
this is what I need it to do basically Computer1:rednet.broadcast("run missile_silo_control") computer2:running missile_silo_control computer1:("5") -5 luanches the missiles computer2:fireing missiles I need to do this over rednet using rednet.broadcast("")
Posted 13 May 2013 - 05:42 PM
So what you need is a monitoring program on computer 2 that is waiting for a rednet signal from computer 1. when you send a signal from computer 1, computer 2 will run shell.run("program", "arg1", "arg2"). That is unless your program running on computer 2 has a GUI then it won't work no matter what(as far as i am aware).
Posted 13 May 2013 - 05:50 PM
That is unless your program running on computer 2 has a GUI then it won't work no matter what(as far as i am aware).
Correct me if I'm wrong, but I think this mod he uses runs on peripherals. So what you are saying is a quick summary of what he has ahead of him :P/>
Posted 13 May 2013 - 05:56 PM
That is unless your program running on computer 2 has a GUI then it won't work no matter what(as far as i am aware).
Correct me if I'm wrong, but I think this mod he uses runs on peripherals. So what you are saying is a quick summary of what he has ahead of him :P/>
Well yes but it looks like the program is meant to run on an advanced computer with click support so i don't think that will work.
Edit: OP, I would recommend learning LUA before continuing any farther with this as it looks like you need to recode your program.
Posted 13 May 2013 - 06:17 PM
I have another program that might work this is what it is print("preparing launch")
print("set the target")
icbm = peripheral.wrap("right")
input = io.read()
icbm.setTarget(x,height,z)
icbm.canLaunch()
print("final launch checks…")
local side = "front"
local otherside = "right"
local op = "no"
while true do
print("are you sure you want to fire?")
input = io.read()
if input == op then
print("whoops, don't want to nuke them")
return
else
rs.setOutput(side,true)
textutils.slowPrint("…..")
print("firing")
rs.setOutput(otherside,true)
sleep(1)
rs.setOutput(otherside,false)
rs.setOutput(side,false)
end
end
print("set the target")
icbm = peripheral.wrap("right")
input = io.read()
icbm.setTarget(x,height,z)
icbm.canLaunch()
print("final launch checks…")
local side = "front"
local otherside = "right"
local op = "no"
while true do
print("are you sure you want to fire?")
input = io.read()
if input == op then
print("whoops, don't want to nuke them")
return
else
rs.setOutput(side,true)
textutils.slowPrint("…..")
print("firing")
rs.setOutput(otherside,true)
sleep(1)
rs.setOutput(otherside,false)
rs.setOutput(side,false)
end
end
Posted 13 May 2013 - 06:26 PM
I have another program that might work this is what it isSpoiler
print("preparing launch")
print("set the target")
icbm = peripheral.wrap("right")
input = io.read()
icbm.setTarget(x,height,z)
icbm.canLaunch()
print("final launch checks…")
local side = "front"
local otherside = "right"
local op = "no"
while true do
print("are you sure you want to fire?")
input = io.read()
if input == op then
print("whoops, don't want to nuke them")
return
else
rs.setOutput(side,true)
textutils.slowPrint("…..")
print("firing")
rs.setOutput(otherside,true)
sleep(1)
rs.setOutput(otherside,false)
rs.setOutput(side,false)
end
end
People told you so often, please use the code tags, and I have no experience with this icbm stuff, but what this is, is pretty much some weird use of variables, and I don't see the point of the peripheral. But it asks if you want to launch, if you type anything but "no" it triggers some redstone in a certain sequence. Maybe you could show your setup with a screenshot and link us to somewhere, where we can read about this icbm peripheral.
Also, following a simple starting tutorial on Lua and how to use it, will help you understand a lot of this stuff yourself since it's not hard at all!
Posted 13 May 2013 - 06:44 PM
ok look I do not know how to use this code tag bull I have a concussion and I don't want to figure out how to use it right now so LAY OFF!!
Posted 13 May 2013 - 08:19 PM
Look, theres an example in the fourth post. Use
and
(without the spaces) around the code.print("hi")
putsprint("hi")
But don't use spoilers just for code, and -snip- out stuff thats excessively long or not related