Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- importScript('User:Joeytje50/chatmsg.js')
- $('body').append('<span id="pingsound" style="display:none;"></span>');
- var badwords = 'cunt|cock|fuck|dick|bitch|r.{0,2}tard'; //add more pipe <|> seperated words to this list to expand.
- /* Run this when getting a new message */
- onchatmessage = function(text, rawtext) {
- setTimeout(function() {
- /* Bad words beep */
- 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('<audio src="http://images.wikia.com/joeytje50/images/7/76/Censor_beep.ogg" autoplay="autoplay"></audio>');
- }
- }, 20)
- /* Mark bad words */
- text = text.replace((new RegExp('((^|>|('+badwords+'))[^<]+?)('+badwords+')','ig')), '$1<span class="badword">$4</span>');
- return text; //DO NOT EDIT THIS LINE
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement