N@FRED Controller
I@Distance Bearing Elevation Wep Move
O@Thrust Fire Turn Hover
MaxDist=200 MaxDist2=1000 MinDist=100 Afterburn=5 Maxang=15 Minang=-15
Maxhov=30 Minhov=20 Maxhov2=200 ABHov=5
Thrust = (((Distance > MaxDist) * (Distance < MaxDist2) + ((Distance > MaxDist2) * Afterburn)) -
(Distance < MinDist) * (Distance != 0)) * Move
Turn=sgn(Bearing)
Fire=((Minang < Bearing)*(Bearing < Maxang) * (Distance != 0) * (Minang < Elevation) * 
(Elevation < Maxang)) * Wep
Hover=((Distance < Minhov)-(Distance > Maxhov) * (Distance < Maxhov2) + 
((Distance > Maxhov2) * ABHov)) * Move