Posted 21 April 2013 - 09:09 AM
Hi! :D/>
Im currently trying to improve my obsidian mining turtle.
By executing this command I want it to keep mining whatever is in front of it in a line, until it cant detect anything, and then find another line next to it.
But I am getting an error: 'end' expected (to close 'if' at line 22)
Hope you can help :)/>
Edit: Its still not finished, just in case you wondered.
Im currently trying to improve my obsidian mining turtle.
By executing this command I want it to keep mining whatever is in front of it in a line, until it cant detect anything, and then find another line next to it.
But I am getting an error: 'end' expected (to close 'if' at line 22)
function diggy()
while turtle.detect() do
turtle.dig()
turtle.forward()
end
end
while not turtle.detect() do
turtle.turnRight()
if turtle.detect() then
turtle.dig()
turtle.forward()
turtle.turnRight()
if turtle.detect() then diggy()
if not turtle.detect() then
turtle.turnLeft()
end
else
turtle.turnLeft()
if turtle.detect() then
turtle.dig()
turtle.forward()
turtle.turnLeft()
if turtle.detect() then diggy()
if not turtle.detect() then
turtle.turnRight()
end
Hope you can help :)/>
Edit: Its still not finished, just in case you wondered.