N@FRED3 Controller 
I@Distance Bearing Elevation Ranger Sky Water Friend FRED Attack Hunt Move No Not Dive
O@Thrust Fire Turn NextTarg Hovoff FL FR AR AL Strength Grab
MaxDist=200 MaxDist2=1000 MinDist=100 Afterburn=5 
Maxhov=30 Minhov=20 Maxhov2=200 ABHov=5 Hovoff=Moveout Strength=10000 
FRED & Hunt ? NextTarg=1 : NextTarg=0
FRED & Move & !No -> Moveout=1;
FRED & Move & No -> Moveout=0;
FRED & Attack & !Not -> Wep=1;
FRED & Attack & Not -> Wep=0;
FRED & Dive ? Drop=1 : Drop=0
Distance<MaxDist -> Maxang=15 Minang=-15;
Distance>MaxDist2 -> Maxang=1 Minang=-1;
Distance>MaxDist2 -> Maxang=7 Minang=-7;
Friend==18017844 ? Holdfire=1 : Holdfire=0
(Ranger == 10000) & (Water != 10000) -> Ranger = Water ;
(Ranger<10)&(Moveout==0) ? Grab=1 : Grab=0
Thrust = (((Distance > MaxDist) * (Distance < MaxDist2) + ((Distance > MaxDist2) * Afterburn)) -
(Distance < MinDist) * (Distance != 0)) * Moveout
Turn=sgn(Bearing) * Moveout
Fire=((Minang < Bearing)*(Bearing < Maxang) * (Distance != 0) * (Minang < Elevation) * 
(Elevation < Maxang)) * Wep * !Holdfire
Drop==1 ? Divedown=-10 : Divedown=0
Flip=Sky <40 
Height=sin(Elevation)*Distance
(Height < 20) & (Height > -40) ? Chaser=1 : Chaser=3
Chased=(Distance != 0)*0.01
Chase=(( (Height>=(-30))*Chaser-(Height<=(-20))*Chaser))*(Distance != 0)*!(Ranger<Minhov | Flip)+Chased
Hovercontroller=((Ranger<Minhov)-((Ranger>Maxhov)*(Ranger<Maxhov2)+
((Ranger>Maxhov2)*ABHov)))*!Chase+Chase+Divedown
Pitch=extangp()
Roll=extangr()
Sc = 4 Pitch1 =-3.5 Pitch2 =3.5 Roll1= -3.5 Roll2 = 3.5
PC =(Pitch > Pitch1) - (Pitch < Pitch2)
RC = (Roll > Roll1) - (Roll < Roll2)
Ha = PC == 0 & RC == 0
Hover = Ha * Hovercontroller + Flip
I= -((90 < Roll) | (-90 > Roll))
I= ((90 > Roll) | (-90 < Roll))
Flipover = Roll > 170 | Roll < -170
Flipover == 1 -> F=6;
Flipover == 0 -> F=0;
FL = sgn(PC - RC*I)/Sc + Hover - F
FR = sgn(PC + RC*I)/Sc + Hover + F
AR= sgn(-PC + RC*I)/Sc + Hover+ F
AL = sgn(-PC - RC*I)/Sc + Hover -F
