it's doesn't work for me
give me many errors
I have' copy it and when I try to run it
this is what I get
:global gpstext [/file get gps.txt contents];
[admin@3GRouter] > :local longstart [:find $gpstext "longitude" -1];
[admin@3GRouter] > :local longend [:find $gpstext "\n" $longstart];
syntax error (line 1 column 38)
[admin@3GRouter] > :local latstart [:find $gpstext "latitude" -1];
[admin@3GRouter] > :local latend [:find $gpstext "\n" $latstart];
syntax error (line 1 column 37)
[admin@3GRouter] > :local validstart [:find $gpstext "valid" -1];
[admin@3GRouter] > :local validend [:find $gpstext "\n" $validstart];
syntax error (line 1 column 39)
[admin@3GRouter] > :local valid false;
[admin@3GRouter] >
[admin@3GRouter] > :if ([:find $gpstext "yes" $validstart] > 0) do={:set valid tru
e;};
syntax error (line 1 column 29)
[admin@3GRouter] >
[admin@3GRouter] >
[admin@3GRouter] > :global longitude [:pick $gpstext ($longstart + 12) $longend];
syntax error (line 1 column 37)
[admin@3GRouter] > :local degreestart [:find $longitude " " -1];
syntax error (line 1 column 28)
[admin@3GRouter] > :local minutestart [:find $longitude " " $degreestart];
syntax error (line 1 column 28)
[admin@3GRouter] > :local secondstart [:find $longitude "'" $minutestart];
syntax error (line 1 column 28)
[admin@3GRouter] > :local secondend [:find $longitude "'" $secondstart];
syntax error (line 1 column 26)
[admin@3GRouter] >
[admin@3GRouter] > :local longdegree;
[admin@3GRouter] > :local longdegreelink;
[admin@3GRouter] >
[admin@3GRouter] > :if ([:pick $longitude 0 1] = "W") do={
syntax error (line 1 column 14)
[admin@3GRouter] > :set longdegree "-";
expected variable name (line 1 column 10)
[admin@3GRouter] > :set longdegreelink "W";
expected variable name (line 1 column 10)
[admin@3GRouter] > } else={
[admin@3GRouter] > :set longdegree "+";
expected variable name (line 1 column 10)
[admin@3GRouter] > :set longdegreelink "E";
expected variable name (line 1 column 10)
[admin@3GRouter] > };
[admin@3GRouter] >
[admin@3GRouter] > :set longdegree ($longdegree . [:pick $longitude 2 $minutestart
]);
expected variable name (line 1 column 6)
[admin@3GRouter] > :set longdegreelink ($longdegreelink . [:pick $longitude 2 $min
utestart]);
expected variable name (line 1 column 6)
[admin@3GRouter] > :local longmin [:pick $longitude ($minutestart + 1) $secondstar
t];
syntax error (line 1 column 24)
[admin@3GRouter] > :local longsec [:pick $longitude ($secondstart + 2) $secondend]
;
syntax error (line 1 column 24)
[admin@3GRouter] > :local longfract ((([:tonum $longmin] * 6000) + ([:tonum $longs
ec] * 100)) / 36);
syntax error (line 1 column 30)
[admin@3GRouter] > :global newlong ($longdegree . "." . $longfract);
syntax error (line 1 column 19)
[admin@3GRouter] > :global newlonglink ($longdegreelink . "." . $longfract);
syntax error (line 1 column 23)
[admin@3GRouter] >
[admin@3GRouter] > :global latitude [:pick $gpstext (latstart + 11) $latend];
syntax error (line 1 column 51)
[admin@3GRouter] > :set degreestart [:find $latitude " " -1];
expected variable name (line 1 column 6)
[admin@3GRouter] > :set minutestart [:find $latitude " " $degreestart];
expected variable name (line 1 column 6)
[admin@3GRouter] > :set secondstart [:find $latitude "'" $minutestart];
expected variable name (line 1 column 6)
[admin@3GRouter] > :set secondend [:find $latitude "'" $secondstart];
expected variable name (line 1 column 6)
[admin@3GRouter] >
[admin@3GRouter] > :local latdegree;
[admin@3GRouter] > :local latdegreelink;
[admin@3GRouter] >
[admin@3GRouter] > :if ([:pick $latitude 0 1] = "N") do={
syntax error (line 1 column 14)
[admin@3GRouter] > :set latdegree "+";
expected variable name (line 1 column 10)
[admin@3GRouter] > :set latdegreelink "N";
expected variable name (line 1 column 10)
[admin@3GRouter] > } else={
[admin@3GRouter] > :set latdegree "-";
expected variable name (line 1 column 10)
[admin@3GRouter] > :set latdegreelink "S";
expected variable name (line 1 column 10)
[admin@3GRouter] > };
[admin@3GRouter] >
[admin@3GRouter] > :set latdegree ($latdegree . [:pick $latitude 2 $minutestart]);
expected variable name (line 1 column 6)
[admin@3GRouter] > :set latdegreelink ($latdegreelink . [:pick $latitude 2 $minute
start]);
expected variable name (line 1 column 6)
[admin@3GRouter] > :local latmin [:pick $latitude ($minutestart + 1) $secondstart]
;
syntax error (line 1 column 23)
[admin@3GRouter] > :local latsec [:pick $latitude ($secondstart + 2) $secondend];
syntax error (line 1 column 23)
[admin@3GRouter] > :local latfract ((([:tonum $latmin] * 6000) + ([:tonum $latsec]
* 100)) / 36);
syntax error (line 1 column 29)
[admin@3GRouter] > :global newlat ($latdegree . "." . $latfract);
syntax error (line 1 column 18)
[admin@3GRouter] > :global newlatlink ($latdegreelink . "." . $latfract);
syntax error (line 1 column 22)
[admin@3GRouter] >
[admin@3GRouter] > :global coordinates ($newlong . "," . $newlat);
syntax error (line 1 column 23)
[admin@3GRouter] >
[admin@3GRouter] > :global linkout "
http://maps.google.com
<name> -- name of the new global variable
<value> -- new value of variable
[admin@3GRouter] > :global linkout "http://maps.google.comq=$newlonglink+$newlatli
nk";
expected end of command (line 1 column 42)
[admin@3GRouter] > :global SMlinkout "
http://www.openstreetmap.org/
<name> -- name of the new global variable
<value> -- new value of variable
[admin@3GRouter] > :global SMlinkout "
http://www.openstreetmap.org/lat=$newlat&lon
=$newlong&zoom=8&layers=M";
expected end of command (line 1 column 53)
[admin@3GRouter] >
[admin@3GRouter] > :global kmlout "<
<name> -- name of the new global variable
<value> -- new value of variable
[admin@3GRouter] > :global kmlout "<xml version=\"1.0\" encoding=\"UTF-8\"
<name> -- name of the new global variable
<value> -- new value of variable
[admin@3GRouter] > :global kmlout "<xml version=\"1.0\" encoding=\"UTF-8\">
[admin@3GRouter] > <kml xmlns=\"
http://www.opengis.net/kml/2.2\">
expected command name (line 1 column 1)
[admin@3GRouter] > <Placemark>
expected command name (line 1 column 3)
[admin@3GRouter] > <name>My router</name>
expected command name (line 1 column 5)
[admin@3GRouter] > <description>My router's location</description>
expected command name (line 1 column 5)
[admin@3GRouter] > <Point>
expected command name (line 1 column 5)
[admin@3GRouter] > <coordinates>$coordinates</coordinates>
expected command name (line 1 column 7)
[admin@3GRouter] > </Point>
expected command name (line 1 column 5)
[admin@3GRouter] > </Placemark>
expected command name (line 1 column 3)
[admin@3GRouter] > </kml>
expected command name (line 1 column 1)
[admin@3GRouter] > ";
expected command name (line 1 column 1)
[admin@3GRouter] >
[admin@3GRouter] > :if (valid) do={
{... :global oldpos;
{...
{... :if ($oldpos != $coordinates) do={
syntax error (line 4 column 22)
[admin@3GRouter] > /file set [/file find name=gps.kml] contents=$kmlout
[admin@3GRouter] > /tool e-mail
[admin@3GRouter] /tool e-mail> send to=$email subject="Router move" body="
Move to $linkout\r\n$SMlinkout" file=gps.kml
syntax error (line 1 column 18)
[admin@3GRouter] /tool e-mail> :set oldpos $coordinates;
expected variable name (line 1 column 14)
[admin@3GRouter] /tool e-mail> };
[admin@3GRouter] /tool e-mail> } else={
[admin@3GRouter] /tool e-mail> /tool e-mail
[admin@3GRouter] /tool e-mail> send to=$email subject="Router gps positio
n invalid" body="Router gps position invalid"
syntax error (line 1 column 19)
[admin@3GRouter] /tool e-mail> };
how can it be?
what have I done wrong?