Sorry for the simple question, but I am at work and have no way to test for the answer.
When turtle.dig() is successful, but the block cannot be picked up, does it return true or false?
The documentation is unclear.
It returns true if a block broke, regardless of drops.
As GopheraAtl said it will return true regardless, but fi you wanted to tell if it dropped or not you could check the counts of the slots before digging, and then check the count after digging, to see if the block was dropped or not…
I've tried that in coding for turtles when they hit bedrock to come back, but I kept getting the "attempt to call a nil" error. I assumed after numerous failures that "if turtle.dig() == true" doesn't work. Should I true "if turtle.dig(true)" or something along those lines instead? I'm not sure that would work either. Anyway, the documentation I've read states the bool return is "success", not "true".
Any help would be appreciated.
This should be in its own topic, not someone else's…
But a quick answer…
if turtle.dig() then
should work, its the same as doing
if turtle.dig() == true then
if it doesn't work then chances are its another problem, like trying to run a turtle program on a computer ( the computer can move, so it doesn't know about the turtle api, it sees any turtle function as nil )