Considering you already have the framework for the update every 5 minutes, you can just do something similar to:
NPC Code:
function checkPlayers() {
for (temp.pl : allplayers) {
if (temp.pl.level.size <= 0) {
//This is an RC
temp.rccount ++;
} else {
//This is a player
temp.pcount++;
}
}
//Then store temp.rccount and temp.pcount here
}
Also possibly onPlayerLogout()