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

Turtle Tunnel Placer

Started by FNCPro, 26 June 2013 - 08:12 AM
FNCPro #1
Posted 26 June 2013 - 10:13 AM
I didn't find any program for a turtle that placed a tunnel instead of digging one.
So I made one my self.
It makes a tunnel that specifies any block you put in the turtle(automatically switches to next slot if it runs out)

Here is a diagram(sort of)

B = block

	 B
   B B
   B B
	 B
It just has a 1x2 tunnel for now
2 blocks up
1 block sideways.
I may make a 2x2 and 3x3 tunnel maker if I have the time.
Type this into your turtle, WITH HTTP API ENABLED!

pastebin get rJnA3A6b tunnelp

Fill up the turtle with the materials, type tunnelp, and then type a number on how long you want it to run.
Requires HTTP API to be enabled to get the Pastebin program.
To get the program and write it yourself on to the turtle/place it in the turtle from the save folder, just go to
http://pastebin.com/rJnA3A6b to go to the Pastebin link.

OK, if anyone can fix that diagram, I would be happy, the code box formatted it incorrectly…
GamerNebulae #2
Posted 26 June 2013 - 03:46 PM
I added a few critical parts in your program. It now has a fuel - and item checker. If it runs out of fuel or blocks it will pause and wait till the conditions are good again. Also I cleaned it up a bit.


function ClearScreen()
  term.clear()
  term.setCursorPos(1,1)
end

function CheckFuel()
  while turtle.getFuelLevel() < 10 do
    ClearScreen()
    print("Out of fuel!")
  end
end
function CheckInv()
  for x = 1,16 do
	itemCount = itemCount + turtle.getItemCount(x)
  end
  while itemCount < 8 do
	ClearScreen()
	print("Out of blocks!")
  end
end

local cycles = 0

print("How long do you want it to run??")
cycles = read()
for i = 0, cycles do
  CheckFuel()
  CheckInv()
  turtle.forward()
  turtle.turnRight()
  turtle.place()
  turtle.turnLeft()
  turtle.turnLeft()
  turtle.place()
  turtle.turnRight()
  turtle.up()
  turtle.turnLeft()
  turtle.place()
  turtle.turnRight()
  turtle.turnRight()
  turtle.place()
  turtle.turnLeft()
  turtle.placeUp()
  turtle.down()
end
Tigerlife #3
Posted 28 June 2013 - 01:25 AM
just use this one: pastebin get heaXtLn3 tunnelp working 3x3tunneling with replace walls and floor, just make sure theres no items in inv before u start except the ones u want the tunnel made of. you can call it yours :P/>
Tigerlife #4
Posted 28 June 2013 - 02:03 AM
I didn't find any program for a turtle that placed a tunnel instead of digging one. So I made one my self. It makes a tunnel that specifies any block you put in the turtle(automatically switches to next slot if it runs out) Here is a diagram(sort of)
 B = block B B B B B B 
It just has a 1x2 tunnel for now 2 blocks up 1 block sideways. I may make a 2x2 and 3x3 tunnel maker if I have the time. Type this into your turtle, WITH HTTP API ENABLED!
 pastebin get rJnA3A6b tunnelp 
Fill up the turtle with the materials, type tunnelp, and then type a number on how long you want it to run. Requires HTTP API to be enabled to get the Pastebin program. To get the program and write it yourself on to the turtle/place it in the turtle from the save folder, just go to http://pastebin.com/rJnA3A6b to go to the Pastebin link. OK, if anyone can fix that diagram, I would be happy, the code box formatted it incorrectly…
here just use this one: pastebin get heaXtLn3 tunnelp working 3x3tunneling with replace walls and floor, just make sure theres no items in inv before u start except the ones u want the tunnel made of. you can call it yours :P/>
Niseg #5
Posted 30 June 2013 - 07:43 AM
Actually a tunnel is a special case of a rectangular room where the narrow side or the rectangle is open . My build script can build a "tunnel" but it will have closed narrow sides.It will also build it in a circular manner which is probably the optimal method. It can also build a diagonal tunnel using a parallelogram build (but not the roof). I bet the shape builder can do it too . Using a filler is always the fastest way but fillers can't build complex shapes.