mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Nov 2012
Posts: 1
T
Mostly harmless
OP Offline
Mostly harmless
T
Joined: Nov 2012
Posts: 1
I found the perfect script I was looking for to keep my channel clean of badwords. However I need a little help to expand it a bit more. Script:The Script

So as it is when a player says one of the badwords they are kicked and banned for 30 seconds. What I would LIKE it to do is, the nick gets 3 warnings, and on the 4th time the nick gets kicked and banned for 15 minutes. However I dont want it so that Nick A gets 2 warnings Nick B gets 1 warning then the ban.

Can anyone help me? Thank you in advance! smile



Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
I can post a script here after X-Mas, if no one else beats me to it. =)


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
The script you found isn't perfect. There are quite a few redundancies and faulty coding. I've taken the liberty of improving it, along with the replacement of regex in place of istok. Using istok will not prompt the script to watch out for tampered cursed words with punctuation marks or numbers placed in front of at the end:
Code:
alias delword {
  if (!$1) { 
    echo * Please specify something to be removed.
  }
  elseif (!$istok(%badwords,$1,32)) { 
    echo * That word $1 is not on the list.
  }
  else {
    set %badwords $remtok(%badwords,$1,1,32)
    echo * The word $1 has been removed!
  }
}
alias addword {
  if (!$1) { 
    echo * Please specify something to be added.
  }
  elseif ($istok(%badwords,$1,32)) { 
    echo * That word $1 is already in the list 
  }
  else {
    set %badwords $addtok(%badwords,$1,32)
    echo * The new list is --> %badwords
  }
}
on @*:text:*:#: bdwdwkb $1-
on @*:action:*:#: bdwdwkb $1-
on @*:notice:*:#: bdwdwkb $1-
alias -l bdwdwkb {
  if ($regex($1-,$+(/(?<![a-z\d])\Q,$replacecs(%badwords,\E,\\E\Q,$chr(32),\E|\Q),\E(?![a-z\d])/Si))) {
    inc $+(%,$site,#)
    if ($($+(%,$site,#),2) > 3) {
      ban -ku900 # $nick 2 you were warned three times! 15-min time-out for cursing!
      unset $+(%,$site,#) 
    }
    elseif ($($+(%,$site,#),2) == 3) {
      .msg # $nick $+ , please do not use such language in # again. 
    }
    elseif ($($+(%,$site,#),2) == 2) {
      .msg # $nick $+ , please do not use such language in # again. 
    }
    else .msg # $nick $+ , please curb with you gutter mouth!
  }
}
The commands are simply /delword and /addword
Once set, you're good to go.

Obviously this edit can further be improved and optimized using hash tables, but I'll leave it at that with the use of variable.


Link Copied to Clipboard