User:Joeytje50/chat-pings.js

/* Script to beep when people say bad words. This is helpful to notice spammers or trolls. To import this script, add the following to your /chat.js page:

importScript('User:Joeytje50/chat-badwords.js'); onchatmessage = function(text, rawtext) { badWordsBeep; return text; //DO NOT EDIT THIS LINE }

Or just add  badWordsBeep;   to the onchatmessage function, if you already defined it. If you do not understand the previous sentence, just do the above. Also, if you haven't imported User:Joeytje50/chatmsg.js you should add the following above this script's import:

importScript('User:Joeytje50/chatmsg.js');

var badwords = 'arse|blow ?job|boner|bitch|clit|cunt|cock|dick|fag|fuck|gay|jerk|nigger|nigga|r.{0,2}tard|wank|whore|badwordstest'; if (!$('#pingsound').length) { $('body').append(' '); }

function badWordsBeep { text = text.replace((new RegExp('((^|>|('+badwords+'))[^<]+?)('+badwords+')','ig')), '$1 $4 '); setTimeout(function {		if ($('.Chat ul li:last-child:not(.you):not(.inline-alert) .message .badword').length && $('.Chat ul li:last-child .message').html.match(new RegExp(badwords, 'i'))) {			$('#pingsound').html(' ');		}	}, 20) }