This is the final code I ended up with.
Tikibar, I adapted the property from the MD-11s file, how is it so far???
- Code: Select all
var locarmcheck = func {
var locdefl = getprop("instrumentation/nav/heading-needle-deflection");
if (locdefl < 8 and locdefl > -8) {
setprop("/autopilot/locks/heading", "nav1-hold");
setprop("/controls/switches/loc1", 0);
setprop("/controls/switches/hdgl", 0);
setprop("/controls/switches/navl", 0);
setprop("/controls/switches/aplatmode", 2);
setprop("/controls/switches/aphldtrk", 1);
} else {
return 0;
}
}
Note that everything after the first setprop does: Set the timer to off, set the hdg and nav modes to off, sets the lateral mode for the anaunciator to LOC, sets the mode to TRK.
Regards,