gps

Use modems to locate the position of the current turtle or computers.

This works by communicating with other computers (called GPS hosts) that already know their position, finding the distance to those computers (with modem_message), and using that to derive its position from theirs (with a process known as trilateration.

See also

Changes

CHANNEL_GPS = 65534The channel which GPS requests and responses are broadcast on.
locate([timeout=2 [, debug=false]])Tries to retrieve the computer or turtles own location.
CHANNEL_GPS = 65534Source

The channel which GPS requests and responses are broadcast on.

locate([timeout=2 [, debug=false]])Source

Tries to retrieve the computer or turtles own location.

Parameters

  1. timeout? number = 2 The maximum time in seconds taken to establish our position.
  2. debug? boolean = false Print debugging messages

Returns

  1. number This computer's x position.
  2. number This computer's y position.
  3. number This computer's z position.

Or

  1. nil If the position could not be established.