←  Ask a Pro

ComputerCraft | Programmable Computers for Minecraft

»

Turtle min down to specified height

f4ls3's Photo f4ls3 08 Dec 2020

Hello everybody,
so Im having an issue that my turtle keeps moving down and doesn't stop at all at any point.
This is my code
function mine ()
	done = false
  
	while not done do
		print("Moving to desired starting height...")
		while not (TURTLE_POSITION.y == heightToStart) do
			turtle.digDown()
			turtle.down()
		end
		print("Starting height reached. Filtering Items...")
		filterItems()
		print("Filtered Items. Starting to mine cuboid...")
		done = true
	end
end

It doesn't even get to the end because it gets stuck at the diging down part
Quote

Lyqyd's Photo Lyqyd 12 Dec 2020

Moved to Ask a Pro.
Quote

Luca_S's Photo Luca_S 12 Dec 2020

Can you post your whole code please? Without that I'd guess that TURTLE_POSITION.y isn't updated which means the loop runs forever.
Quote