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

2x2 Jungle Tree Feller

Started by fauxiss, 13 January 2013 - 01:32 PM
fauxiss #1
Posted 13 January 2013 - 02:32 PM
I made a simple jungle tree feller. (Will only take out the trunk, not the branches)

Code

function fuel()
	if turtle.getFuelLevel() < 10 then
		turtle.select(16)
		turtle.refuel(1)
		turtle.select(1)
	end
end
function detectdown()
	turtle.select(15)
	while turtle.compareDown() do
		fuel()
		turtle.digDown()
		turtle.down()
	end
end
function cut()
	fuel()
	turtle.dig()
	turtle.turnRight()
	turtle.dig()
	turtle.turnLeft()
end
fuel()
turtle.dig()
turtle.forward()
turtle.select(15)
while turtle.compareUp() do
	cut()
	fuel()
	turtle.digUp()
	turtle.up()
end
cut()
fuel()
turtle.forward()
turtle.turnRight()
turtle.dig()
turtle.forward()
fuel()
detectdown()

Instructions:
1. Place the turtle here:


2. Place your fuel in slot #16 (use a lava bucket - 1000 moves).
3. Place 1 jungle log in slot #15


Please note that this program will work with any 2x2 tree that is added with any mod. The only thing you will have to change is the type of log in slot 15. The turtle will come down by itself.
unobtanium #2
Posted 14 January 2013 - 10:19 AM
Hey,
i have an idea for making this a bit more usefriendly. :D/>
If you place the turtle in front of the tree, you simply let it dig out the first one in front of it and let it place this one into slot 15. The user doesnt need to do it manually :D/>
And another way cutting down a 2x2 tree is:
- if it goes up it cuts down the block in front and above.
- if it goes down it cuts down the block in front and below.
So you dont have to turn left and right and may safe a bit of time :D/>

edit: i was looking on your code and found a problem that may happen. If the turtle compares slot 15 with the blocks it chops down, and then has to refuel, it doesnt select slot 15 again and tries to compare wood with fuel :D/>
simply put turtle.select(15) at the end of the refuel function.