Coordinate Based Movement lets you move your turtles based on world coordinates. It also lets you use an offset to get over obstacles.

Before you can use CBM you must first have a GPS satellite placed in the world. When setting up your GPS satellite I recommend using the coordinates found in the debug console. You can access the debug console by pressing F3.
You can copy the code below or download in game using my package donwloader
Notice: Connection from turtle to GPS satellite may fail during bad weather!
move-to
Spoiler


tArgs = { ... }
rednet.open("right")
local function turn(to)
while dir~=to do
turtle.turnRight()
if dir == 4 then
dir = 1
else
dir = dir + 1
end
end
end
local function getDir()
x, y,  z = gps.locate()
turtle.forward()
local x1, y1, z1 = gps.locate()
if z>z1 then
return 1
end
if z<z1 then
return 3
end
if x>x1 then
return 4
end
if x<x1 then
return 2
end
end
local function xAxis()
if x<x1 then
turn(2)
else
turn(4)
end
while x~=x1 do
if turtle.detect()==true then
break
end
turtle.forward()
x,y,z = gps.locate()
end
end
local function zAxis()
if z<z1 then
turn(3)
else
turn(1)
end
while z~=z1 do
if turtle.detect()==true then
break
end
turtle.forward()
x,y,z = gps.locate()
end
end
local function yAxis()
while y~=y1 do
if y>y1 then
turtle.down()
else
turtle.up()
end
x, y, z = gps.locate()
end
end
local function doOffset()
curOffset=0
while curOffset~=offset do
turtle.up()
curOffset=curOffset + 1
end
end
if tArgs[3]==nil then
print("Usage: move-to <X> <Y> <Z> [offset]")
print("These coordinates should match the ones in the debug console")
print("Press F3 to get cordnaits")
print("Offset is used to move the turtle up x number of blocks before moving")
print("If your turtle starts spining in place then it may need an offset to get around an obstical")
return
end
x1 = tonumber(tArgs[1])
y1 = tonumber(tArgs[2])
z1 = tonumber(tArgs[3])
offset = tonumber(tArgs[4])
if offset~=nil then
doOffset()
end
dir = getDir()
while x~=x1 or z~=z1 or y~=y1 do
x, y, z = gps.locate()
xAxis()
x, y, z = gps.locate()
zAxis()
x, y, z = gps.locate()
yAxis()
end
x = nil
y = nil
z = nil
x1 = nil
y1 = nil
z1 = nil