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

Bomber plane

Started by lare290, 10 December 2014 - 03:53 PM
lare290 #1
Posted 10 December 2014 - 04:53 PM
Dunno if this is right area for this, but I try.

Could someone make program for turtle that
1. asks number,
2. then goes straight that amount of blocks,
3. then drops tnt/industrialcraft nuke it is carrying,
4. (optionally) comes back to start location.
Cranium #2
Posted 10 December 2014 - 05:07 PM
Moved to General for program requests.
KingofGamesYami #3
Posted 10 December 2014 - 06:17 PM
I did a really fast write of what you want.


--#get distance
local dist
repeat
  term.write( "Distance: " )
  dist = tonumber( read() )
until dist
--#check fuel
if turtle.getFuelLevel() < dist * 2 then
  error( "Turtle does not have sufficient fuel to accomplish mission", 0 )
end
--#move forward
for i = 1, dist do
  turtle.forward()
end
--#find and drop tnt
for i = 1, 16 do
  turtle.select( i )
  if turtle.getItemCount( i ) > 0 then
	turtle.placeDown()
	rs.setOutput( "bottom", true )
	break
  end
end
--#come back
for i = 1, dist do
  turtle.back()
end
Edited on 10 December 2014 - 05:18 PM
lare290 #4
Posted 10 December 2014 - 07:54 PM
Now could someone just tell me how to paste that to computercraft turtle?
And does this work with IC nuke also, or just with tnt? because i intended it for tekkit classic warfare
KingofGamesYami #5
Posted 10 December 2014 - 09:28 PM
Now could someone just tell me how to paste that to computercraft turtle?
If you have the http api enabled, upload to pastebin and take note of the paste id
www.pastebin.com/*thispart*

Next, place a turtle and type this in

pastebin get *thispart* name

To run it type

name

And does this work with IC nuke also, or just with tnt? because i intended it for tekkit classic warfare

This places something, then applies a redstone signal. Does redstone activate nukes?
lare290 #6
Posted 11 December 2014 - 06:59 AM
So it does work with nukes. And it is so easy to f*ck up with dirt-blocks in its inventory that it isn't even overpowered. Thank you :)/>
The_Cat #7
Posted 11 December 2014 - 05:55 PM
So it does work with nukes. And it is so easy to f*ck up with dirt-blocks in its inventory that it isn't even overpowered. Thank you :)/>

You could make it so if the block changes so its not equal to the nuke/tnt block it would stop and ask for tnt/nuke instead. Or you could have it return if it runs out of nukes/tnt or is removed from inventory.
KingofGamesYami #8
Posted 11 December 2014 - 06:13 PM
-snip-
You could make it so if the block changes so its not equal to the nuke/tnt block it would stop and ask for tnt/nuke instead. Or you could have it return if it runs out of nukes/tnt or is removed from inventory.

This does have room for improvement, he can modify it himself if he likes.