64 posts
Location
Finland
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.
3790 posts
Location
Lincoln, Nebraska
Posted 10 December 2014 - 05:07 PM
Moved to General for program requests.
3057 posts
Location
United States of America
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
64 posts
Location
Finland
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
3057 posts
Location
United States of America
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?
64 posts
Location
Finland
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 :)/>
121 posts
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.
3057 posts
Location
United States of America
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.