This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
computercraftrules89's profile picture

How to send target to the ICBM launcher

Started by computercraftrules89, 12 November 2012 - 07:51 PM
computercraftrules89 #1
Posted 12 November 2012 - 08:51 PM
Hi all just me again was wondering how to send targets to the ICBM launcher.

I can have it send me what the target is
I can tell it to launch

Would also like to know if theres a way for it to report back if the launcher is powered or not.

My whole idea is a launcher that is remotely controled no user input and you dont have to go down to the thing to know if it is all fueled up.

and would like to know how to use the getmissles for the radar that i have would be a good help.
gknova61 #2
Posted 14 November 2012 - 10:44 AM
This is all the methods for ICBM

You need to wrap the peripheral ofc. Just put this somewhere in your code:
icbm = peripheral.wrap("side_the_launcher_control_panel_is_on")

launch() - launches the missile to its target
getTarget() - returns a table with the x,y,z coords in the launcher control panel
setTarget(x,y,z) - sets the target in the launcher control panel to the given x y z variables
setFrequency(frequency) - sets the frequency in the launcher control panel if it's tier 3
getFrequency() - returns the frequency set in the launcher control panel

Example:
icbm.launch()

There is also methods for the radar station as a wrapped peripheral which you can find at:
http://calclavia.com/universalelectricity/?m=2&p=manual
computercraftrules89 #3
Posted 16 November 2012 - 10:30 PM
thanks for the reply

I know how to do that what im asking is more complicated.

I want to know how I can send targets for a launch through rednet from one computer to the computer connected to the launcher that also has a modem and get it to grab the code I send it and set those targets.

much like this but in reverse

launcher computer that sends target co ords to co ord computer
program that starts the program that sends co ords



rednet.open("top")

while true do
id, msg = rednet.receive()
if msg == "sendtarget" then
shell.run("sendtarget")
break
end
end
sleep(5)
os.reboot()






program that does the sending


rednet.open("top")
sendtarget = peripheral.wrap("left")
local targetX, targetY, targetZ = sendtarget.getTarget()

coordTarg = { tostring(targetX), tostring(targetY), tostring(targetZ) }

coordSerial = textutils.serialize(coordTarg)
rednet.send(16, coordSerial) -- target co ord computer has the id of 16


rednet.open("top")
id, msgSerial = rednet.receive()
coordTarg = textutils.unserialize(msgSerial)

print( coordTarg[1] )
print( coordTarg[2] )
print( coordTarg[3] )
print("1 = X")
print("2 = Y")
print("3 = Z")
sleep(30)
os.reboot()

main console at home that send the promt to get the co ords


rednet.open("top")
rednet.send(14, "sendtarget")
sleep(5)
os.reboot()

So basicly you have a launch computer with security input.
that sends the promt to the launcher computer to tell it to send the co ord computer the targets of the launcher.

launcher computer listens for the promt receives it then it starts the program which sends the co ords to the other computer.
computercraftrules89 #4
Posted 16 November 2012 - 11:58 PM
So you guys and girls out there know what im trying to do here.

Here is some come

this is computer 6 the computer i want to send targets to my launcher computer - one connected to the ICBM(mod) launcher.

my Idea was to have my input read and then put into say like targetX targetY and targetZ.

and then have that put through the setTarget() command

then have serialized on this end and sent to the launcher problem is atm it just resets after i input all the lines


rednet.open("top")

print("Input X co ord")
input = read()
if input == " " then
input = targetX
sleep(5)

else
print("Input Y co ord")
input = read()
if input == " " then
input = targetY
sleep(5)

else
print("Input Z co ords")
input = read()
if input == " " then
input = targetZ

local targetX, targetY, targetZ = setthetarget.setTarget()

setthetarget = { tostring(targetX), tostring(targetY), tostring(targetZ)}

setthetargetSerial = textutils.serialize(setthetarget)

rednet.send(14, setthetarget)
sleep(3)


rednet.close("top")
end

launcher computer


rednet.open("top")

id, msgSerial = rednet.receive()

setthetarget = textutils.unserialize(setthetargetSerial)

setthetargetSerial = peripheral.wrap("left")

setthetargetSerial.setTarget(x, y, z)


so the main problem i have is with the sending end not sending anything
kazagistar #5
Posted 17 November 2012 - 06:15 AM
Please use the code tags to display code.
computercraftrules89 #6
Posted 18 November 2012 - 03:20 AM
Don't know what you mean by code tags but there you go they are in spoilers happy now?
Tiin57 #7
Posted 18 November 2012 - 03:25 AM
Don't know what you mean by code tags but there you go they are in spoilers happy now?
Use

[code] and
computercraftrules89 #8
Posted 18 November 2012 - 04:17 AM
actually tried that didnt work.


hmmm works now random.
Roadhouse699 #9
Posted 08 March 2013 - 03:05 AM
This is all the methods for ICBM

You need to wrap the peripheral ofc. Just put this somewhere in your code:
icbm = peripheral.wrap("side_the_launcher_control_panel_is_on")

launch() - launches the missile to its target
getTarget() - returns a table with the x,y,z coords in the launcher control panel
setTarget(x,y,z) - sets the target in the launcher control panel to the given x y z variables
setFrequency(frequency) - sets the frequency in the launcher control panel if it's tier 3
getFrequency() - returns the frequency set in the launcher control panel

Example:
icbm.launch()

There is also methods for the radar station as a wrapped peripheral which you can find at:
http://calclavia.com...y/?m=2&p=manual
despite the sacregilousness of your pircture, thank you so much!!!!!!!!!!!!!!! I've been looking all over for what the launch panel peripharel is called. I'm going to make a page on the wiki for this program!