ID:144815
 
Credit to Kajika for making the text filter

Code:
mob
verb
Say(msg as text)
if(!msg)return
msg = html_encode(msg)
view() << "[usr] says: [wordfilter(msg)]"
Shout(msg as text)
if(!msg)return
msg = html_encode(msg)
world << "<b>[usr] shouts: [wordfilter(msg)]</b>"

var
list
// Emoticons
// Emoticons are special, the filtered words are icon_states
// NOTE: DON'T filter to the original text or it will cause an infinite loop
emoticons = list( "^_^" , ":)" , "=)" , ">:(" , ">=(" , ";_;" , \
":(" , "=(" , ">:)" , ">=)" , ">:D" , ">=D" , ":D" , "=D" , ":P" \
, "=P" , "(Xsmile)" , "(WEE)")// Smilies
emoticons2= list( "^_^" , ":)" , ":)" , ">:(" , ">:(" , ";_;" , \
":(" , ":(" , ">:)" , ">:)" , ">:)" , ">:)" , ":D" , ":D" , ":P" \
, ":P" , "(Xsmile)" , "(WEE)")// icon_states for smilies

proc
wordfilter(m as text)
var/icon/I = 'EmotIcons.dmi' // Emoticons icon file
var/p
m = " " + copytext(m,1) + " "
// Emoticons
if(emoticons.len)
for(var/i=1,i<=emoticons.len,i++)
p = findtext(m,emoticons[i])
while(p)
m = copytext(m,1,p) + "[html_decode(m)]<img class=icon src=\ref[I] \
iconstate='
[emoticons2[i]]'>[html_encode(m)]" \
+ copytext(m,p+length(emoticons[i]))
p = findtext(m,emoticons[i])
return m


Problem description:

Whenever I use the say or shout verbs, the game crashes. What could be causing it?
Your word is filtered to be the same word, it hasn't made it an icon yet and thus it's a neverending loop, making it crash.
In response to SpikeNeedle
I'm always looking for this sort of text thing.

What does that mean, Spike? Its confusing.

EDIT: Does it mean he doesn't delete the text emotion so it goes into a endless loop of iconed ones, crashing the client?