@name UFO Control chip
@inputs Num:vector
@inputs AdvPod:wirelink
@inputs For:wirelink Aft:wirelink Left:wirelink Right:wirelink
@outputs 
@persist 
@trigger 
interval(50)
#Outputs
W=AdvPod["W",number]
A=AdvPod["A",number]
S=AdvPod["S",number]
D=AdvPod["D",number]
Mouse1=AdvPod["Mouse1",number]
Mouse2=AdvPod["Mouse2",number]
R=AdvPod["R",number]
Space=AdvPod["Space",number]
Shift=AdvPod["Shift",number]
Zoom=AdvPod["Zoom",number]
Alt=AdvPod["Alt",number]
TurnLeftKey=AdvPod["TurnLeftKey",number]
TurnRightKey=AdvPod["TurnRightKey",number]
X=AdvPod["X",number]
Y=AdvPod["Y",number]
Z=AdvPod["Z",number]
PrevWeapon=AdvPod["PrevWeapon",number]
NextWeapon=AdvPod["NextWeapon",number]
AimPos=AdvPod["AimPos",vector]
ThirdPerson=AdvPod["ThirdPerson",number]
Distance=AdvPod["Distance",number]
Light=AdvPod["Light",number]
Active=AdvPod["Active",number]
Team=AdvPod["Team",number]
Health=AdvPod["Health",number]
Armor=AdvPod["Armor",number]
Bearing=AdvPod["Bearing",number]
Elevation=AdvPod["Elevation",number]
Entity=AdvPod["Entity",entity]

V="Vector"
M="Mul"

I=10
Comp=100
F=0#Num:x()*I
R=Num:y()*I
L=Num:y()*I
A=Num:z()*I
T=Num:x()
Ma=30
For:entity():setMass(Ma)
Aft:entity():setMass(Ma)
Right:entity():setMass(Ma)
Left:entity():setMass(Ma)
Con=entity():getConstraints()
Con[0,entity]=entity()
Mass=0
for(C=0,Con:count()){
    Mass+=Con[C,entity]:mass()
    if(Con[C,entity]:isVehicle()){Pod=Con[C,entity]}
}
Const=((gravity()*Mass)/T)/4

#Const=4875.0000228882+323-120

Z=-1
For[M,number]  =Const+F-Comp
For[V,vector]  =vec(0,0,Z)
Aft[M,number]  =Const+A+100
Aft[V,vector]  =vec(0,0,Z)
Left[M,number] =Const+L
Left[V,vector] =vec(0,0,Z)
Right[M,number]=Const+R
Right[V,vector]=vec(0,0,Z)

#E1 code
#X3=extposx()
#Y3=extposy()
#Z3=extposz()
#Xa=X2-X3 Ya=Y2-Y3 Za=Z2-Z3
#Yaw=vecyaw(vector(Xa,Ya,Za))
#SY=sin(Yaw)
#CX=cos(Yaw)
#ConF=S-W
#ConS=A-D
#X1=CX*ConF+SY*ConS
#Y1=SY*ConF+CX*Cons
#Z1=(Space-Alt)*2



Crosshairs=1
#Inputs
#AdvPod["Lock",number]=Lock
#AdvPod["Terminate",number]=Terminate
#AdvPod["Strip Weapons",number]=Strip
#AdvPod["Eject",number]=Eject
#AdvPod["Disable",number]=Disable
AdvPod["Crosshairs",number]=Crosshairs
#AdvPod["Break",number]=Break
#AdvPod["Allow Buttons",number]=Buttons
#AdvPod["Relative",number]=Relative
#AdvPod["Damage Health",number]=DHealth
#AdvPod["Damage Armor",number]=DArmor

XYZ=Pod:pos()-AimPos
Ang=XYZ:toAngle()



