Posted 18 June 2016 - 07:56 PM
I made a code earlier to try to make an autohoe turtle. Assume that the turtle, when the program is ran, has a hoe in its left hand, and a pickaxe its in the selected slot. When I run, it gives no errors, it just doesnt work.
local t = 0
local i = 0
repeat
i=i+1
turtle.forward()
turtle.digDown()
if turtle.detect() then
if t==0 then
t=1
turtle.turnLeft()
turtle.equipLeft()
turtle.dig()
turtle.forward()
turtle.equipLeft()
turtle.digDown()
turtle.turnLeft()
turtle.equipLeft()
turtle.dig()
turtle.equipLeft()
turtle.digDown()
end
if t==1 then
t=0
turtle.turnRight()
turtle.forward()
turtle.digDown()
turtle.turnRight()
end
end
until i==32