There are a few ways.

$count(string,thing to count) would probably be the simplest solution.

example
$count(this is some hmm i don't hmm what the hmm,hmm)
that would give 3

on *:TEXT:*MingLee*:#: {
writeini -n Emotes.ini $+(#,-,$date) MingLee $calc($readini(Emotes.ini,$+(#,-,$date),MingLee) + $count($1-,MingLee))
}


http://scripting.pball.win
My personal site with some scripts I've released.