Posted 05 October 2015 - 06:18 PM
Hey all, I've got a mining shaft program on my turtle but the timing gets messed up by gravel, so I've tried making it so it detects gravel and clears it before continuing but for some reason it gets stuck in the while loop when it detects the gravel and even when the gravel is gone it won't go out of the loop. I've confirmed this by adding a variable and incrementing it and printing it out. I also set it to print the data.name and it reads gravel for as manay gravel as there are to be mined but then it just spits out emptyness.
I can't figure out what I'm doing wrong, I create the while loop, set the condition and then have it recheck the condition each time it loops then set it to end when it's false.
Anyway, here's my code.
Thanks for your time.
I can't figure out what I'm doing wrong, I create the while loop, set the condition and then have it recheck the condition each time it loops then set it to end when it's false.
Anyway, here's my code.
local success, data = turtle.inspect()
while data.name == "minecraft:gravel" do
turtle.dig()
local success, data = turtle.inspect()
sleep (0,10)
end
turtle.forward
Thanks for your time.