# A320 FBW System by Joshua Davidson (it0uchpods/411)
# V0.8
var roll_input = func {
if (getprop("/it-autoflight/output/ap1") == 0 and getprop("/it-autoflight/output/ap2") == 0 and ((getprop("/it-fbw/law") == "NORMAL") or (getprop("/it-fbw/law") == "ALTERNATE"))) {
var ail = getprop("/controls/flight/aileron");
if (ail >= 0.05 and ail < 0.15) {
var rfbw = getprop("/it-fbw/roll-deg");
setprop("/it-fbw/roll-deg", rfbw + "0.01");
} else if (ail >= 0.15 and ail < 0.3) {
var rfbw = getprop("/it-fbw/roll-deg");
setprop("/it-fbw/roll-deg", rfbw + "0.05");
} else if (ail >= 0.3 and ail < 0.5) {
var rfbw = getprop("/it-fbw/roll-deg");
setprop("/it-fbw/roll-deg", rfbw + "0.1");
} else if (ail >= 0.5 and ail < 0.7) {
var rfbw = getprop("/it-fbw/roll-deg");
setprop("/it-fbw/roll-deg", rfbw + "0.2");
} else if (ail >= 0.7 and ail <= 1) {
var rfbw = getprop("/it-fbw/roll-deg");
setprop("/it-fbw/roll-deg", rfbw + "0.3");
}
if (ail <= -0.05 and ail > -0.15) {
var rfbw = getprop("/it-fbw/roll-deg");
setprop("/it-fbw/roll-deg", rfbw - "0.01");
} else if (ail <= -0.15 and ail > -0.3) {
var rfbw = getprop("/it-fbw/roll-deg");
setprop("/it-fbw/roll-deg", rfbw - "0.05");
} else if (ail <= -0.3 and ail > -0.5) {
var rfbw = getprop("/it-fbw/roll-deg");
setprop("/it-fbw/roll-deg", rfbw - "0.1");
} else if (ail <= -0.5 and ail > -0.7) {
var rfbw = getprop("/it-fbw/roll-deg");
setprop("/it-fbw/roll-deg", rfbw - "0.2");
} else if (ail <= -0.7 and ail >= -1) {
var rfbw = getprop("/it-fbw/roll-deg");
setprop("/it-fbw/roll-deg", rfbw - "0.3");
}
}
if (getprop("/it-fbw/roll-deg") >= 30) {
if (getprop("/it-fbw/law") == "NORMAL") {
if (ail > 0.4) {
if (getprop("/it-fbw/roll-deg") >= 65) {
setprop("/it-fbw/roll-deg", "65");
}
} else {
setprop("/it-fbw/roll-deg", "30");
}
}
}
if (getprop("/it-fbw/roll-deg") <= -30) {
if (getprop("/it-fbw/law") == "NORMAL") {
if (ail < -0.4) {
if (getprop("/it-fbw/roll-deg") <= -65) {
setprop("/it-fbw/roll-deg", "-65");
}
} else {
setprop("/it-fbw/roll-deg", "-30");
}
}
}
if (getprop("/gear/gear[0]/wow") == 1) {
setprop("/it-fbw/roll-deg", "0");
}
settimer(roll_input, 0.01);
}
var pitch_input = func {
if (getprop("/it-autoflight/output/ap1") == 0 and getprop("/it-autoflight/output/ap2") == 0 and ((getprop("/it-fbw/law") == "NORMAL") or (getprop("/it-fbw/law") == "ALTERNATE"))) {