running code to fetch atis for destination airport and set comm1 accordingly. Works usually well however at times I end up with this:
non objects have no members nasal error
line 838
the code is
- Code: Select all
#Fetch atis if route-manager destination ap changes
setlistener("/autopilot/route-manager/destination/airport", func {
if (getprop("/autopilot/route-manager/destination/airport") != nil ) {
if (getprop("/systems/eap")==1) {
var airport = airportinfo(getprop("autopilot/route-manager/destination/airport"));
var atis = airport.comms('atis');
if (!size(atis))
atis = airport.comms('awos');
if (size(atis)== 0){
print ("no atis data found, comm1 set to 111.1");
setprop("/instrumentation/comm/frequencies/selected-mhz", 111.11);
} else {
setprop("/systems/catis",atis[0]);
setprop("/instrumentation/comm/frequencies/selected-mhz", (getprop("/systems/catis")));
}
}
}});
funny enough comm1 is set to the correct frequency. Could not find an error description in the nasal error wiki
thanks