TGps = class

Class describing char navigation, available by GPS

Name Result Description Code Params Examples
LoadBase Integer Load GPS base, returns number of uploaded points
function LoadBase(const FilePath: String): Integer;

const FilePath - path to GPS database file (*.db3))

Gps.LoadBase(ExePath+'\gps_map.db3');
  • Examples found for this method:
GetPath Integer Routes from point (X1, Y1, Z1) to (X2, Y2, Z2) and records the points of this route in GPS.Items. Returns the length of the route laid.
function GetPath(X1, Y1, Z1, X2, Y2, Z2: Single): Integer;

X1, Y1, Z1 - starting point coordinates 

X2, Y2, Z2 - final point coordinates

Print(GPS.GetPath(User.X, User.Y, User.Z, X, Y, Z));   // Routes from current user coordinates to point (X, Y, Z), also prints the length of the route laid
GetPathByName Integer Routes to point by name and records the points of this route in GPS.Items. Returns the length of the route laid.
function GetPathByName(X1, Y1, Z1: Single; PointName: String): Integer;

X1, Y1, Z1 - starting point coordinates 

PointName - final point name

Print(GPS.GetPathByName(User.X, User.Y, User.Z, 'spot_exp_10_20'));   // Routes from current user coordinates to point called 'spot_exp_10_20', also prints the length of the route laid
Count Integer Returns number of points after building route
function Count: Integer;
There are no arguments
for i:= 0 to GPS.Count-1 do begin..  // Checking list of points
Items TGpsPoint Returns point with specified index
function Items(Index: Integer): TGpsPoint;

Index - index of point

for i:= 0 to GPS.Count-1 do Print('('+ IntToStr(GPS.Items(i).X) +', '+ IntToStr(GPS.Items(i).Y) +', '+ IntToStr(GPS.Items(i).Z) +')');  // prints all points in the route

Objects

Name Class Description
GPS TGps GPS database control

Methods

Name Result Description
TGps.Items TGpsPoint Returns point with specified index
TBot.GPS TGps