@name auto-"duper"
@inputs 
@outputs 
@persist Count [Find StringArray WeldArray]:array
@trigger 

if (first() | duped()) {
    findIncludePlayerProps(owner())
    findByClass("*")
    Find = findToArray()
}

for (I=1,Find:count()) {
    Ent = Find[I,entity]
    
    Model = Ent:model()
    Pos = Ent:pos()
    Ang = Ent:angles()
    Color = Ent:getColor4()
    Material = Ent:getMaterial()
    Skin = Ent:getSkin()
    
#    WeldNum = Ent:hasConstraints("Weld")
#    for (N=1,WeldNum) {
#        WeldArray[N,entity]=Ent:isConstrainedTo("Weld",N)
#    }
#    WeldString = glonEncode(WeldArray)
    
    StringArray[Count+1,string]=Model
    StringArray[Count+2,vector]=Pos
    StringArray[Count+3,angle]=Ang
    StringArray[Count+4,vector4]=Color
    StringArray[Count+5,string]=Material
    StringArray[Count+6,number]=Skin
    #StringArray[Count+7,string]=WeldString
    Count+=6
}
String = glonEncode(StringArray)
fileWrite("autodupe.txt",String)

interval(120000)
