@name Port Key Collector
@inputs 
@outputs 
@persist E2:array Count C
@trigger all

if(duped()){selfDestruct()}
if(first()){C=1}
E=entity()
findByClass(E:type())
findIncludePlayerProps(E:owner())
findSortByDistance(E:pos())
E2=findToArray()

Count=E2:count()
while(C<=Count){
    E1=E2:entity(C)
    weld(E,E1,0,0)
    print("welding chip: "+C+"/"+Count)
    C++
}
print("welding completed")
