mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Apr 2006
Posts: 400
K
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
Joined: Dec 2002
Posts: 1,245
M
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.

Joined: Apr 2006
Posts: 400
K
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
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
I'd use $addtok() when setting naughty words.

Joined: Nov 2004
Posts: 842
Hoopy frood
Offline
Hoopy frood
Joined: Nov 2004
Posts: 842
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?
Joined: Dec 2002
Posts: 1,245
M
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


Link Copied to Clipboard