ZuluScript: Advanced Currency Example 1 Example: At Least 10 Hours as PIC or SIC in Rotorcraft in 90 Days
Initialization script:
  var tottime = 0.0;
Loop script:
  var cat = getfieldstr("Category");
  var role = getfieldstr("Crew Role");
  var flttime = getfieldnum("Day Flight Time") +
   getfieldnum("Night Flight Time");
  
  if (strequal(cat, "Rotorcraft"))
  {
    if (strequal(role, "PIC") || strequal(role, "SIC"))
    {
      tottime = tottime + flttime;
      if (tottime >= 10.0)
        currency_ok = 1;
    }
  }
How it works:
For each flight, we add the values of Day Flight Time and Night Flight Time into a variable called flttime. We check that the category of the aircraft associated with the flight is "Rotorcraft" (this must match exactly with the Category drop-down on the Aircraft Definition screen). If this check passes, we then check that the flight's Crew Role is either PIC or SIC. If this check also passes, we then accumulate flttime into tottime and check the total value of tottime. If it's at least 10.0, the currency is valid.