ID:139523
 
    proc/filterMessage(Message/m)
set background=1
if(!m.content) return m.content
if(!filtered_words.len) return m.content
var/list/punc=list(".",",","/",";",":","\[","\]","=","+","-","_",")","(","*","&","^","%","$","#","@","!","`","~","|","<",">","?")
for(var/P in punc)
var/text=findtext(m.content,P)
if(text)
var/check=copytext(m.content,text-1,text)
if(check!=" " && !check in punc)
var/part_1=copytext(m.content,1,text)
var/part_2=copytext(m.content,text+1)
m.content=part_1+" "+part_2
var/list/filter_check=dd_text2list(m.content," ")
for(var/S in filtered_words)
if(filter_check.Find(S))
filter_check[filter_check.Find(S)] = filtered_words[S]
m.content=dd_list2text(filter_check," ")
return m.content


All of this works just fine as a language filter, except the fact that I cannot catch curses when they are capitalized. In my language list, they are all not capitalized, and since it is searching a list, it searches for the exact match. Is there a way, other than the simple ckey(), which will not give the result I am looking for, to search through a list case insensitively?

Hi Albro,

From what we discussed I really think ckey should work here, but otherwise, a quick look in the Reference yields this nice proc: http://www.byond.com/members/?command=reference&path=proc/ lowertext.
In response to Toadfish
And about restoring the letters that were capitalized?
In response to Albro1
Well, you don't have to restore anything if you don't modify the original string, right? lowertext just returns a version of the string all in lower case letters.
In response to Toadfish
I got you. Thanks, Toadfish.
In response to Albro1
No problem. Good luck with the chat system. Now I really need to catch some sleep...