if (getprop("/ECAM/msg/line" ~ line) == "" and me.active == 1 and me.msg != "") { # at empty line. Also checks if message is not blank to allow for some warnings with no displayed msg, eg stall
if (getprop("/controls/flight/flap-pos") > 2 and getprop("/position/gear-agl-ft") < 750 and getprop("/gear/gear[1]/position-norm") != 1 and getprop("/FMGC/status/phase") == 5) {
# if ((getprop("/controls/flight/flap-pos") > 2 and getprop("/position/gear-agl-ft") < 750 and getprop("/gear/gear[1]/position-norm") != 1 and (getprop("/FMGC/status/phase") != 3 and getprop("/FMGC/status/phase") != 4 and getprop("/FMGC/status/phase") != 5)) or ((getprop("/engines/engine[0]/n1-actual") < 75.0 and getprop("/engines/engine[1]/n1-actual") < 75.0) and getprop("/position/gear-agl-ft") < 750 and getprop("/gear/gear[1]/position-norm") != 1 and (getprop("/FMGC/status/phase") != 3 and getprop("/FMGC/status/phase") != 4 and getprop("/FMGC/status/phase") != 5 and getprop("/FMGC/status/phase") != 6)) or (((getprop("/engines/engine[0]/n1-actual") < 77.0 and getprop("/controls/engines/engine[1]/cutoff-switch") == 0) or (getprop("/engines/engine[1]/n1-actual") < 77.0 and getprop("/controls/engines/engine[0]/cutoff-switch") == 0) and getprop("/position/gear-agl-ft") < 750 and getprop("/gear/gear[1]/position-norm") != 1 and (getprop("/FMGC/status/phase") != 3 and getprop("/FMGC/status/phase") != 4 and getprop("/FMGC/status/phase") != 5 and getprop("/FMGC/status/phase") != 6))) {
if ((((getprop("/FMGC/status/phase") >= 1 and getprop("/FMGC/status/phase") <= 2) or (getprop("/FMGC/status/phase") >= 9 and getprop("/FMGC/status/phase") <= 10) and (wow and getprop("/engines/engine[0]/state") == 3)) or getprop("/FMGC/status/phase") == 6) and getprop("/systems/failures/pack1") == 1) {
pack1_fault.active = 1;
} else {
pack1_fault.active = 0;
}
if (pack1_fault.active == 1 and getprop("/controls/pneumatic/switches/pack1") == 1) {
pack1_fault_subwarn_1.active = 1;
} else {
pack1_fault_subwarn_1.active = 0;
}
if ((((getprop("/FMGC/status/phase") >= 1 and getprop("/FMGC/status/phase") <= 2) or (getprop("/FMGC/status/phase") >= 9 and getprop("/FMGC/status/phase") <= 10) and (wow and getprop("/engines/engine[1]/state") == 3)) or getprop("/FMGC/status/phase") == 6) and getprop("/systems/failures/pack2") == 1) {
pack2_fault.active = 1;
} else {
pack2_fault.active = 0;
}
if (pack2_fault.active == 1 and getprop("/controls/pneumatic/switches/pack2") == 1) {
if (getprop("/controls/pneumatic/switches/ram-air") == 1) {
ram_air.active = 1;
} else {
ram_air.active = 0;
}
if (getprop("/controls/electrical/switches/emer-gen") == 1 and getprop("/controls/hydraulic/rat-deployed") == 1 and !wow) {
emer_gen.active = 1;
} else {
emer_gen.active = 0;
}
if ((getprop("/FMGC/status/phase") >= 2 and getprop("/FMGC/status/phase") <= 7) and getprop("controls/flight/speedbrake") != 0) {
spd_brk.active = 1;
} else {
spd_brk.active = 0;
}
if (getprop("/systems/thrust/state1") == "IDLE" and getprop("/systems/thrust/state2") == "IDLE" and getprop("/FMGC/status/phase") >= 6 and getprop("/FMGC/status/phase") <= 7) {
spd_brk.colour = "g";
} else if ((getprop("/FMGC/status/phase") >= 2 and getprop("/FMGC/status/phase") <= 5) or ((getprop("/systems/thrust/state1") != "IDLE" or getprop("/systems/thrust/state2") != "IDLE") and (getprop("/FMGC/status/phase") >= 6 and getprop("/FMGC/status/phase") <= 7))) {
spd_brk.colour = "a";
}
if (getprop("services/fuel-truck/enable") == 1 and getprop("/ECAM/left-msg") != "TO-MEMO" and getprop("/ECAM/left-msg") != "LDG-MEMO") {
refuelg.active = 1;
} else {
refuelg.active = 0;
}
if (getprop("/consumables/fuel/total-fuel-lbs") < 6000 and getprop("/ECAM/left-msg") != "TO-MEMO" and getprop("/ECAM/left-msg") != "LDG-MEMO") { # assuming US short ton 2000lb
if (getprop("/systems/fuel/x-feed") == 1 and getprop("controls/fuel/x-feed") == 1) {
fuelx.active = 1;
} else {
fuelx.active = 0;
}
if (getprop("/FMGC/status/phase") >= 3 and getprop("/FMGC/status/phase") <= 5) {
fuelx.colour = "a";
} else {
fuelx.colour = "g";
}
if (getprop("/controls/hydraulic/ptu") == 1 and ((getprop("/systems/hydraulic/yellow-psi") < 1450 and getprop("/systems/hydraulic/green-psi") > 1450 and getprop("/controls/hydraulic/elec-pump-yellow") == 0) or (getprop("/systems/hydraulic/yellow-psi") > 1450 and getprop("/systems/hydraulic/green-psi") < 1450))) {
ptu.active = 1;
} else {
ptu.active = 0;
}
if (getprop("/controls/hydraulic/rat-deployed") == 1) {
rat.active = 1;
} else {
rat.active = 0;
}
if (getprop("/FMGC/status/phase") >= 1 and getprop("/FMGC/status/phase") <= 2) {
rat.colour = "a";
} else {
rat.colour = "g";
}
if (getprop("/controls/switches/leng") == 1 or getprop("/controls/switches/reng") == 1 or getprop("/systems/electrical/bus/dc1") == 0 or getprop("/systems/electrical/bus/dc2") == 0) {