@name D-Link (Simple)
@inputs 
@outputs 
@persist Self
@trigger 

#D-Link Network Code Copy and paste this into your contraption
    
    gSetGroup("Network Name Here")
    runOnLast(1)
    Diag=0
    NetMax=16 #this is the maximum number of networked items, surplus are removed
    ID="ID"
    EID=entity():id()
    EIDS=toString(EID)
    if(!Self){
        NetT=glonDecodeTable(gGetStr(ID)) Scan=gGetStr(ID) Brk="<"
            for(C=1,NetMax){if(!Scan:find(Brk+C+Brk)){Self=C break}} 
            if(!Self){if(Diag){print("Self Destructing Excess Clones!")} selfDestructAll()
            }
        NetT[EIDS,string]=Brk+Self+Brk
        gSetStr(ID,glonEncode(NetT))
            if(Diag){print("Self="+Self)} #you can remove this if you want it's diagnostic
    }
    

    if(last()){
        NetT=glonDecodeTable(gGetStr(ID))
        NetT[EIDS,string]=""
        gSetStr(ID,glonEncode(NetT))
        if(Diag){print("ID "+Self+" Deleted")} #diagnostic non critical
        
    }
    #End of D-Link Network Code
