My mining turtle is working well now (finally) and I have managed to build in a tracking system, so that if the server crashes, they can figure out where they were before and continue on.
The problem I am having is in my 'goForward' function (below). I think my if statement, where it figures out what way it is facing etc., takes too long. So the server can crash between the turtle moving forward and updating its position.
function goForward() refuel() while (not turtle.forward()) do cChest() turtle.dig() turtle.attack() sleep(0.2) end trackPos() if facing == "N" then yPos = yPos + 1 elseif facing == "S" then yPos = yPos - 1 elseif facing == "E" then xPos = xPos - 1 elseif facing == "W" then xPos = xPos + 1 end trackPos() nMoved = nMoved + 1 end
Hopefully my problem makes sense, let me know if you have any suggestions!
Note: I don't want to use a gps system