Writing your own scripts

Scripts for daily results

SeeYou will calculate the day performance items like Marking Distance, speed, start and finish times etc.  It is the responsibility of the script to determine how many POINTS are awarded for the achieved  performance. 

To start a new contest or contest class, you have to make an empty text file first. The naming convention  is "class_name.cuc" where CUC extension is required and is also associated to SeeYou by default. One of the ways to create an empty text file is to open Notepad and select Save As... then give it a name "class_name.cuc". 

SeeYou Competition scripts are implemented using the Innerfuse Pascal Scripts (http://www.carlo-kok.com). They are very basic Pascal routines with some exceptions. Please consult the Competition Support forum for those. 

You can either write SeeYou in Edit->Contest properties->Scoring scripts or in Notepad or any other Text  editor of your choice. It is important to keep the general structure of the script: 


Program Scoring_Script_Name;


... // Your script here


and to number the scripts sequentially:







See below for available variables to the Daily Script.

Scripts for total results

You can also write a script for Total results. Procedure is the same way as for daily scripts, but the header must be [TotalScript]. See below for available variables to the Total Script. 

How does it work?

A TPilots record is provided by SeeYou to the Scoring script. TPilots record and a couple other fields determine all the information required to calculate the scoring for a given contest day. This is the definition of the TPilot record: 


Pilots[i] = record (values are Double if not indicated otherwise)

  • sstart start time displayed in results sets in seconds
  • sfinish finish time displayed in results sets in seconds (negative values - no finish) 
  • sdis distance shown in results in meters (negative values will be shown in parenthesis)
  • sspeed speed shown in results in m/s (negative values will be shown in parenthesis)
  • points points shown in results
  • pointString: string; a string representation of points for custom output
  • Hcap handicap factor as declared in pilot setup
  • penalty penalty points defined in Day performance dialog
  • start start time of task (-1 if no start)
  • finish finish time of task (-1 if no finish)
  • dis flown distance
  • speed speed of finished taks (-1 if no finish, takes into account task time)
  • tstart start time of task with time (-1 if no start)
  • tfinish finish time of task with time
  • tdis flown distance in task time
  • tspeed flown distance divided by task time
  • takeoff takeoff time (-1 if no takeoff)
  • landing landing time (-1 if no landing)
  • phototime outlanding time (-1 if no outlanding)
  • isHc set to TRUE if not competing is used
  • FinishAlt altitude of task finish
  • DisToGoal distance between Task landing point and flight landing point
  • Tag string value as defined in Day performace dialog
  • Leg,LegT array of TLeg records; info about each leg, LegT for timeout calculation
  • Warning: String; used to set up a user warning
  • CompID: String; Competition ID of the glider
  • PilotTag: String; string value as defined in Pilot edit dialog
  • user_str1,user_str2,user_str3: String; user strings, use for anything
  • td1,td2,td3: Double; temprary variables, use for anything

TLeg = record; holding leg information

  • start,finish,d,crs Double; time in seconds, distance in meters, crs in radians
  • td1,td2,td3 Double; variables may be used as temporary variables  

Other variables

  • info1..info2 informational strings shown on results
  • DayTag string value as defined in Day properties dialog
  • ShowMessage( s:string ); use this to debug your scripts 

Task = record; holding basic information about task

  • TotalDis: Double; task distance in meters
  • TaskTime: Integer; task time in second  
  • NoStartBeforeTime: Integer; start time in second
  • Point: Array of TTaskPoint; description of task
TTaskPoint = record; holding basic information about taskpoint and leg
  • lon,lat: Double; 
  • d,crs: Double; distance, course to next point
  • td1,td2,td3 Double; variables may be used as temporary variables


Pilots = record

  • Total : Double; total points (default value is sum of DayPoints, not 0)
  • TotalString : String; if this is not empty, total points will be shown as the string defined in this value 
  • DayPts : array of Double; Points from each day as calculated in daily scripts
  • DayPtsString : array of String; Same functionality as TotalString