@name Multi Field Generator
@inputs EMP:wirelink Stasis:wirelink Attraction:wirelink
@inputs Repulsion:wirelink Pressure:wirelink
@inputs 
@outputs 
@persist Set:table Type:string
@trigger all
Time=500
interval(Time)
if (first()) {Set=table()}

Divider="<"
On="on"
Off="off"
Dist="Distance: "
Multi="Multiplier: "
D="D"
M="M"
S="S"
Ac="Att"
Re="Rep"
Pr="Press"
St="Stay"
Ec="ECM"
Om="Omni"
C1=", "
Help="Commands: "+On+C1+Off+C1+Ac+C1+Re+C1+Pr+C1+St+C1+Ec+C1+"1st < is Distance 2nd < is Multiplier"
Helpme="Help"

Chat = entity():owner():lastSaid()
When = entity():owner():lastSaidWhen()
C=Chat:find(Om) 
EMP1=Chat:find(Ec)
Stasis1=Chat:find(St)
Press=Chat:find(Pr)
Acc=Chat:find(Ac)
Rep=Chat:find(Re)
On1=Chat:find(On)
Off1=Chat:find(Off)
Help1=Chat:find(Helpme)

K = (curtime() - entity():owner():lastSaidWhen()) < Time*2/1000
if (C&K) { 
    if(Help1){print(Help)}
    if(On1){Power=1}
    elseif(Off1){Power=0}else{Power=-1}
    if(Chat:find(Divider)){Find=Chat:explode(Divider)}
    Type=""
    if(Acc){Type=Ac}
    elseif(Stasis1){Type=St}
    elseif(Rep){Type=Re}
    elseif(EMP1){Type=Ec}
    elseif(Press){Type=Pr}
    if(Type!=""){
        Dis=Find:string(2):toNumber()
if(Dis>0) {Set:setNumber(Type+D,Dis)} 
print(Dist+toString(Set:number(Type+D)))
        Mul=Find:string(3):toNumber() 
if(Mul>0){Set:setNumber(Type+M,Mul)}
print(Multi+toString(Set:number(Type+M)))

if(Power>-1){Set:setNumber(Type+S,Power)} 
print(Type+": "+toString(Set:number(Type+S)))
}
}
#@inputs EMP:wirelink Stasis:wirelink Attraction:wirelink
#@inputs Repulsion:wirelink Pressure:wirelink
A="Active"
Mu="Multiplier"
Di="Distance"

EMP:setNumber(A,Set:number(Ec+S))
EMP:setNumber(Di,Set:number(Ec+D))
EMP:setNumber(Mu,Set:number(Ec+M))
Stasis:setNumber(A,Set:number(St+S))
Stasis:setNumber(Mu,Set:number(St+M))
Stasis:setNumber(Di,Set:number(St+D))
Repulsion:setNumber(A,Set:number(Re+S))
Repulsion:setNumber(Di,Set:number(Re+D))
Repulsion:setNumber(Mu,Set:number(Re+M))
Attraction:setNumber(A,Set:number(Ac+S))
Attraction:setNumber(Mu,Set:number(Ac+M))
Attraction:setNumber(Di,Set:number(Ac+D))
Pressure:setNumber(A,Set:number(Pr+S))
Pressure:setNumber(Di,Set:number(Pr+D))
Pressure:setNumber(Mu,Set:number(Pr+M))

