General
CowScript uses Rhino a JavaScript engine. Therefor you can use the usual
JavaSript style code. There are geocaching specific commands.
Commands
cls()
Clears the log output screen.
print(Object,...)
Prints the arguments to the log output screen.
addPoint(String name, String coordinates)
This will add a waypoint to the Geocache this script belongs to. It accepts all the usual formats (DMS, DM, D)
distance(String coordinates,String coordinates2)
Returns the distance between the two points.
project(String coordinates, String distance, String angle)
Returns the coordinates of a point projected by distance meters in angle (relative to true north )direction. Example
// Comment 1
A=4;
B=8;
C=11;
D=6;
E=2;
F=4;
G=10;
/*
* Comment 2
*/
koords = "N51° "+(C-G-1)+""+A+"."+(2*F+1)+ "" +(D-A-2)+""+ E +" E 013° "+F+""+(G-B) + "."+D+""+(E-2)+""+(D/2);
koords2 = "N51° 04.999 E 013° 43.999";
cls();
print(koords);
print(koords2);
addPoint("Final", koords);
addPoint("Final2", koords2);