var
list
// Filters
profanity = list("") // Add words that should be filtered here
profanityfix = list("****","*****"," **** ","****"," *** "," ***** "," *** ","***********"," **** "," ****** ","*****","***"," **** ","*****","*****"," **** "," *** ","******","*******","****","*****","***hole","****"," **** ","****") // Add replacements to the filtered words
proc
wordfilter(m as text)
var/p
m = " " + copytext(m,1) + " "
// Profanity
if(profanity.len)
for(var/i=1,i<=profanity.len,i++)
p = findtext(m,profanity[i])
while(p)
m = copytext(m,1,p) + profanityfix[i] + copytext(m,p+length(profanity[i]))
p = findtext(m,profanity[i])
return m
mob/verb
Unmute()
usr.OOCMuted=0
usr.Warning=0
OOC(T as text)
if(WorldMuted){alert("World is muted!"); return}
if(src.OOCMuted){alert("You are OOC Muted!");return}
if(length(T)>349){var/diff=length(T)-349;alert("Your message is too long by [diff] characters"); src<<"[T]";return}//No one likes retyping a long message, give it back to them
if(!T){return}
for(var/mob/M in world)
if(src.Partner){M<<"<b>src:</b>[html_encode(T)]";return}
if(!M.OOCOn){return}
M<<"<b>[src]</font>:</b>[wordfilter(T)]"
if(findtext(T,profanityfix))
if(!src.Warning){usr.Warning+=1; alert("Please refrain from swearing. This is your only warning.");return}
if(src.Warning){world<<"<font color=red>Server Information</font>: [src] has been muted by Brian, The Assistant.";src.OOCMuted=1;src.Warning=0}
else
return
Problem description:
This is supposed to check for any word under the profanityfix var. As it shown here, it'll warn, then mute you no matter what you say(One at a time). I've been at this for a good 2 hours now and i feel i'm getting no where.
I've been away from BYOND for over a year and a half so i'm pretty rusty. Any help is appreciated.
Note: OOCMuted means muted from OOC and Emote as a punishment. Not for toggling.
Edit: removed the swear word list.