mIRC Home    About    Download    Register    News    Help

Print Thread
replacing bad words with **'s #148521 06/05/06 11:06 PM
Joined: Apr 2006
Posts: 400
K
Kurdish_Assass1n Offline OP
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Apr 2006
Posts: 400
topic about says it all..
one of my friends had a script, which replaces bad words he says with all *'s.. Ie: crap = ****
please help me out, i just wanna see multiple script, so I can learn how to do them, don't wanna post away on here all of the time, thanks!


-Kurdish_Assass1n
Re: replacing bad words with **'s #148522 07/05/06 12:24 AM
Joined: Dec 2002
Posts: 1,245
M
MikeChat Offline
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
Code:
on *:INPUT:*:{
  var %string = $1-
  if (($left($1,1) isin / $readini($mircini,text,commandchar)) || ($left($$1,1) == !) || ($left($$1,1) == @) || ($ctrlenter == $true)) { return }
  var %tokens = $gettok(%string,0,32)
  var %i = 1
  while (%i <= %tokens) {
    var %check = $gettok(%string,%i,32)
    if (%check isin %naughtywords) {
      var %checkl = $len(%check)
      var %string = $replace(%string,%check, $str(*,%checkl))
    }
    inc %i
  }
  msg $active %string
  halt
}
alias naughtywords { set %naughtywords %naughtywords $$1- }


type naughtywords (any word or words you want the script toreplace)
like /naughtywords poop crap poopyhead
dont use commas, just plain spaces.

Re: replacing bad words with **'s #148523 07/05/06 12:46 AM
Joined: Apr 2006
Posts: 400
K
Kurdish_Assass1n Offline OP
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Apr 2006
Posts: 400
works, but, it shows the word twice, example:
[7:28:39] <@Kurdish_Assass1n> crap
[7:28:39] <@Kurdish_Assass1n> ****

-------

[7:45:16] <@Kurdish_Assass1n> crazy
[7:45:16] <@Kurdish_Assass1n> ***zy

-------
[7:45:50] <@Kurdish_Assass1n> hi guys
[7:45:50] <@Kurdish_Assass1n> hi guys
-------
see what it does?


-Kurdish_Assass1n
Re: replacing bad words with **'s #148524 07/05/06 12:57 AM
Joined: Dec 2002
Posts: 3,547
S
SladeKraven Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
I'd use $addtok() when setting naughty words.

Re: replacing bad words with **'s #148525 07/05/06 01:05 AM
Joined: Nov 2004
Posts: 802
Jigsy Offline
Hoopy frood
Offline
Hoopy frood
Joined: Nov 2004
Posts: 802
replace halt wif haltdef and see what happens ...


What do you do at the end of the world? Are you busy? Will you save us?
Re: replacing bad words with **'s #148526 07/05/06 02:39 AM
Joined: Dec 2002
Posts: 1,245
M
MikeChat Offline
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
Quote:
works, but, it shows the word twice, example:
[7:28:39] <@Kurdish_Assass1n> crap
[7:28:39] <@Kurdish_Assass1n> ****

see what it does?


Did you paste it exactly as I have it here?

the halt at the end should stop it from repeating UNLESS you have another script that is also using on input