I wasn't expecting you to put the echo there, I was just using that to show the numbers it returns, if there's a channel with 7 voices and 23 not-status, those identifiers would return the 7 and 23, which you could use to choose someone like $rand(1,7) or $rand(1,23). I thought you were wanting a push in the right direction, not for someone to rewrite your script.

Are you making the assumption that 100% of the people in the channel are playing? Because if so, that looks like it removed 90% of what the script is doing, because that way there's no need to build a list by !add'ing people then keeping track when people /part or /quit. If you want it to exclude the nick running the script, that adds a little bit of complexity, but if you want to support widescale opt-out, then it might simply have the script tweaked so that when people want to add themselves to the list, it would use the identifiers in my echo command to identify which team to add them to.