--COMBAT_LOG_EVENT_UNFILTERED GROUP_ROSTER_UPDATE
function(event,_,subevent)
    if (event == "COMBAT_LOG_EVENT_UNFILTERED" and subevent == "UNIT_DIED") or event == "GROUP_ROSTER_UPDATE" then
        aura_env.members = GetNumGroupMembers()
        aura_env.membersAlive = GetNumGroupMembers()
        if IsInRaid("player") == true then
            for i = 1, GetNumGroupMembers() do
                if UnitIsDeadOrGhost("raid" .. i) or not UnitIsConnected("raid" .. i) then
                    aura_env.membersAlive = aura_env.membersAlive - 1
                end
            end
        else
            aura_env.membersAlive = aura_env.membersAlive + 1
            for i = 1, GetNumGroupMembers() do
                if UnitIsDeadOrGhost("party" .. i) or not UnitIsConnected("party" .. i) then
                    aura_env.membersAlive = aura_env.membersAlive - 1
                end
            end
        end
        if UnitIsDeadOrGhost("player") then
            aura_env.membersAlive = aura_env.membersAlive - 1
        end
    end
end

--DISPLAY
function()
    if aura_env.membersAlive and aura_env.members then
        return "Alive: " .. aura_env.membersAlive .. "/" .. aura_env.members
    else 
        return ""
    end
end

--INIT
aura_env.members = 0
aura_env.membersAlive = 0