This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Tasty_Noob's profile picture

Finding the coords of the turtle.

Started by Tasty_Noob, 06 October 2012 - 11:29 AM
Tasty_Noob #1
Posted 06 October 2012 - 01:29 PM
I want to make a program, and I need the turtle to return to a certain spot. I need the program to find out this spot itself. IS there any way to do that?
Luanub #2
Posted 06 October 2012 - 02:12 PM
Setup 4 or more gps host within the turtles modem range and use the following command to get the x,y,z of the turtle.

local x,y,z = gps.locate()

For more information read:
GPS API
GPS Program
PixelToast #3
Posted 06 October 2012 - 05:36 PM
just search youtube for a gps tutorial

also please dont double post, when your question isnt answered just say it wasnt instead of making a new thread
JJRcop #4
Posted 06 October 2012 - 11:30 PM
A hacky way would be to write a program in startup that over-writes the gps functions/turtle movement functions. The movements would edit a file containing coords. And the gps would return those coords.
Luanub #5
Posted 07 October 2012 - 12:30 AM
There's no need to do that you can just make an API with modified functions that do just as you say and call them instead of the original gps functions. That way if you have a need for the original gps functions they are still there.