Niederlenz, on 07 February 2013 - 11:50 PM, said:
How do I get the coords of my turtle like this?
There is a program that CC comes with called "gps" to Quote the help file from it
Quote
gps can be used to host a GPS server over rednet, or determine a position using trilateration.
Type "help gpsapi" for help using GPS functions in lua programs.
ex:
"gps locate" will connect to nearby GPS servers, and try to determine the position of the computer or turtle.
"gps host" will try to detemine the position, and host a GPS server if successful.
"gps host 10 20 30" will host a GPS server, using the manually entered position 10,20,30.
Take care when manually entering host positions. If the positions entered into multiple GPS host
are not consisent, the results of locate calls will be incorrect.
Type "help gpsapi" for help using GPS functions in lua programs.
ex:
"gps locate" will connect to nearby GPS servers, and try to determine the position of the computer or turtle.
"gps host" will try to detemine the position, and host a GPS server if successful.
"gps host 10 20 30" will host a GPS server, using the manually entered position 10,20,30.
Take care when manually entering host positions. If the positions entered into multiple GPS host
are not consisent, the results of locate calls will be incorrect.
if you want to get that information from inside a program you can use the gps api to quote the help files.
Quote
Functions in the GPS API:
gps.locate( timeout )
The locate function will send a signal to nearby gps servers, and wait for responses before the timeout. If it receives enough responses to determine this computers position then x, y and z co-ordinates will be returned, otherwise it will return nil. If GPS hosts do not have their positions configured correctly, results will be inaccurate.
gps.locate( timeout )
The locate function will send a signal to nearby gps servers, and wait for responses before the timeout. If it receives enough responses to determine this computers position then x, y and z co-ordinates will be returned, otherwise it will return nil. If GPS hosts do not have their positions configured correctly, results will be inaccurate.











