@name 
@inputs 
@outputs C C1 S:string S1:string F:string CountA CountB CountD CountE 
@persist C C1 F:string A:array B:array D:array E:array 
@trigger all
interval(10)
if(first()){B=array() E=array() C=1 C1=1}
findInSphere(entity():pos(),10000)
findIncludeClass("player")
findIncludeClass("npc")
findSortByDistance(entity():pos())
A=findToArray()
if (C<=A:count()){
B:setNumber(C,A:entity(C):id())
C+=1} else {C=1}

if (B:count()==A:count()){}
    
Sep="<"    


S1=A:concat(Sep)
S=B:concat(Sep)
D=S:explode(Sep)
Z=D:concat(Sep)
CountB=B:count()
CountA=A:count()
CountD=D:count()

if (C1<=D:count()){
E:setEntity(C1,entity(D:number(C1)))
C1+=1}else{C1=1}

F=E:concat(Sep)
timer("diag",5000)
if(clk("diag")){
    print("Original: "+S1)
    print("Before: "+S)
    print("After: "+Z)
    print("Final: "+F)
    }
