@name E2 Lister
@inputs 
@outputs 
@persist 
@trigger 
interval(50)
runOnChat(1)

Person = findPlayerByName("Divalent")

if(chatClk(Person)) {
    local Said = Person:lastSaid():lower()
    
    if(Said:find("!list")) {
        hideChat(1)
        
        findByClass(entity():type())
        findExcludeEntity(entity())
        F = findToArray()
        
        printColor(vec(255,255,255),"I've found ",vec(255,0,0),F:count(),vec(255,255,255)," E2(s).")
        printColor(vec(255,255,255),"Here's the info...")
        
        for (I=1, F:count()) {
            printColor(F[I,entity]:owner(),vec(255,255,255),", "+F[I,entity]:getName()+", ",vec(255,255,255),F[I,entity]:cpuUsage()*1000000)
        }
    }
}
