bad word replacer

By SnoooP on Mar 30, 2005

This scriptwill say (censored) instead of a bad word, the third line is wear you add the words then the fourth is what you want it to sya instead,

on *:INPUT:*: { 
  if (/* !iswm $1) || ($ctrlenter) { 
    var %acros = shit,fuck,slut,slapper,slag,cunt,dick,ass,arse,fuck,niger,mother fucker,wanka,wanker,fanny,fucker,
    var %expand = (Censored);(Censored);(Censored);(Censored);(Censored);(Censored);(Censored);(Censored);(Censored);(Censored);(Censored);(Censored);(Censored);(Censored);(Censored);(Censored);(Censored);(Censored);

    var %x = $numtok(%acros,44) 
    while (%x) { 
      var %w = $gettok(%acros,%x,44) 
      var %xx = $findtok($1-,%w,0,32) 
      while (%xx) { 
        tokenize 32 $reptok($1-,%w,$gettok(%expand,%x,59),%xx,32) 
        dec %xx 
      } 
      dec %x 
    } 
    msg $target $1- 
    halt 
  } 
}
Sign in to comment.
Pangaea   -  Apr 02, 2012

Abcdefmonkey crikey .. thanks. and its working very well up to an extent. but here is the "tricky" part of the problem, both chans have the same name. This is working . if on chan1 someone types a line.. the bot will msg the same chan with the word censored.. but on the other server (same chan name) the bad word is still getting thru.. and i suppose also the bot shouldn't be messaging the source channel if someone talks there.

Im trying to make other scripts to go with this multiserver setup i have, but im finding everything is so much harder because both chan have the same name... ive kinda shot myself in the foot ;)

However I can perhaps fiddle about with things here to make this work.. i think the main ingredients are all there.

Superb job thanks :D

 Respond  
Abcdefmonkey   -  Apr 02, 2012

Well, @Pangaea it will work for your bot. I tried it myself. Change the first line to this

on *:TEXT:*:#: { 

Then replace this line

 msg $target $1- 

Just change $target to the channel name you want it relayed to. Cheers :)

Edit: here's what you need.. i made the changes for you

on *:TEXT:*:#: { 
    var %acros = shit,fuck,slut,slapper,slag,cunt,dick,ass,arse,fuck,niger,mother fucker,wanka,wanker,fanny,fucker,
    var %expand = (Censored);(Censored);(Censored);(Censored);(Censored);(Censored);(Censored);(Censored);(Censored);(Censored);(Censored);(Censored);(Censored);(Censored);(Censored);(Censored);(Censored);(Censored);

    var %x = $numtok(%acros,44) 
    while (%x) { 
      var %w = $gettok(%acros,%x,44) 
      var %xx = $findtok($1-,%w,0,32) 
      while (%xx) { 
        tokenize 32 $reptok($1-,%w,$gettok(%expand,%x,59),%xx,32) 
        dec %xx 
      } 
      dec %x 
    } 
    msg #RELAY-CHANNEL $1- 
    halt 
  } 
 Respond  
Pangaea   -  Apr 02, 2012

yea.. tricky.. i guess something like this would have to be implemented into the relay code itself .. hell it was worth a try ;)

cheers :D

EDIT.. is there such a thing as an "on msg" event?.. or equivalent by on msg, i mean a state where it has text in buffer or whatever and its about to deploy.. um.. lol .. im crazy

 Respond  
Abcdefmonkey   -  Apr 02, 2012

ON TEXT events are processed as the text is being messaged to the channel. ON INPUT works as the user (you) input the text. Using an ON INPUT on a bot wouldn't work due to the fact it would only trigger if the bot itself typed the words that triggered it. :p

 Respond  
Pangaea   -  Apr 02, 2012

oh.. i kinda always thought on text events where processed if the text has already been messaged to channel.

ill give it a shot tho , cheers :)

EDIT.. naw.. tho i didnt think that would work anyway for the reasons i stated above

IF i myself manually talk thru the bot using its client the words are censored on both chans (using on input) .. but wont work while relaying chan text from one chan to the other

 Respond  
Abcdefmonkey   -  Apr 02, 2012

@Pangaea this snippet uses on INPUT... changing it to on TEXT would work, from a bot's perspective.

 Respond  
Pangaea   -  Apr 01, 2012

no sure how this works, .. i added it to a bot that is linking 2 channels hopeing it would filter out words said in one chan before sending it to the other chan.

perhaps i got the wrong end of the stick

 Respond  
Anti   -  Jul 19, 2007

LOL... i found out something about this script it does block when i say /me F**KS .. i like to say that alot all though it\'s a really great idea good job

 Respond  
DarthReven   -  Mar 30, 2005

then you should contact the admin on that server

 Respond  
DarthReven   -  Mar 30, 2005

if your server suports +G then you don\'t really have that problem

 Respond  
SnoooP   -  Mar 30, 2005

true, but on some servers you get banned for swearing and sometimes people cant help it and dont realise that they are doing it. but if this isin the remotes it could stop them getting banned, its happened to me alot so i like it :)

 Respond  
brottor   -  Mar 30, 2005

if i have had the privilege to give a score i would give a 6 it is nicely scripted but completely useless

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.