Posted 13 May 2012 - 12:56 AM
Hi,
i writing on a script, that let the turtle return to a specific point to drop its inventory. I want to do all the positioning through gps locations. Is it possible to find out in wich direction the turtle faces? I need this for the moving, maybe there is another way to do this.
at the moment i do it with this:
I hope i say clear what i want. Thanks for help :P/>/>
i writing on a script, that let the turtle return to a specific point to drop its inventory. I want to do all the positioning through gps locations. Is it possible to find out in wich direction the turtle faces? I need this for the moving, maybe there is another way to do this.
at the moment i do it with this:
function axis()
x1 , y1, z1 = gps.locate( 2, false )
while turtle.detect() do
turtle.dig()
end
turtle.forward()
x2 , y2 , z3=gps.locate( 2, false )
if x2-x1 == 1 and y2-y1 ==0 then
dir="X"
elseif x2-x1 == -1 and y2-y1 ==0 then
dir="-X"
elseif x2-x1 == 0 and y2-y1 ==1 then
dir="Y"
elseif x2-x1 == 0 and y2-y1 ==-1 then
dir="-Y"
else
dir="something went terrible wrong"
end
return(dir)
end
I hope i say clear what i want. Thanks for help :P/>/>