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

New to ComputerCraft and having some difficulty with turtle functionality.

Started by Nadr0j, 26 August 2012 - 08:49 PM
Nadr0j #1
Posted 26 August 2012 - 10:49 PM
I'm sure this is a very simple fix. So far, I've been unable to find a way to make my turtle turn around once it hits bedrock. I figure that I could write something like this -

x = 1

while x do
.turtle.digDown()
.turtle.down()
….if turtle.down() is false then
……for i=1, x do
……..turtle.up()

end

As I'm new to lua, my syntax is clearly sub par.

Thanks for reading.
cant_delete_account #2
Posted 26 August 2012 - 11:06 PM
Use:

if turtle.dig() == false then
print("We can't mine this block!")
end
to check if the block it's trying to mine is bedrock or an unbreakable block.