$$loop row as speechdata index as speechindex select count(*) from speechdata where playerindex='%%player.playerindex%%'$$ $$speechcount=speechdata.0$$ $$endloop$$ $$if (speechcount !EQUALS "0")$$ $$loop row as speechdata index as speechindex select count(*),* from speechdata where playerindex='%%player.playerindex%%' group by speech order by count(*) desc limit %%MAXSPEECHLINES%%$$ $$coloured=colouredtext2html(speechdata.speech)$$ $$endloop speech$$
Last $$MAXSPEECHLINES$$ Quotes
$$coloured$$
$$endif$$