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

Automated TNT Cannon Help

Started by rimp, 02 October 2012 - 02:15 AM
rimp #1
Posted 02 October 2012 - 04:15 AM
I need some help mainly with coding turltes. I am doing as much research as I can but would like to speed things along with this project as I have many planned for CC. My goal is to automate a TNT cannon using turtles to reload it. I have figured out all but this part of it.

Needs:
I need either one or many turtles to walk forward say 5 blocks and then place TNT in the right spots then move back so they are not blown away. This all needs to be done throught rednet so I can control it all with one terminal on the control/obsrvation deck.

Any help, tips, or guidance tward my goal is much appreciated.
KaoS #2
Posted 02 October 2012 - 07:30 AM
well firstly I wouldn't worry about moving the turtle away, just make him place the TNT higher up so when it is activated it falls down to a safe distance, now all you need is a placing code and in order for us to assist you we will need to know how you want it placed

PS: placing the TNT higher up is actually almost essential in effective TNT cannons as you can then place wires etc to activate the TNT without it getting blown up
hego555 #3
Posted 04 October 2012 - 07:22 AM
Wow this is such a epic idea… i must do this!
MatazaNz #4
Posted 04 October 2012 - 07:31 AM
The general concept is fairly simple. Give all the turtles the same loading programs similar to this:

while true do
  id, msg = rednet.receive()
  if msg == "loadcommand" and id == <id of pc> then -- replace loadcommand with the command you are using.
    load()
  end
end

then make a load() function in the same programs, then set them up how you would like.