mIRC Home    About    Download    Register    News    Help

Print Thread
#109769 01/02/05 06:17 AM
Joined: Jan 2005
Posts: 25
L
Ameglian cow
OP Offline
Ameglian cow
L
Joined: Jan 2005
Posts: 25
trying to get my swear script a little more refined, stole it from some help site somewhere, only to find it was a bit limited.

on *:TEXT:*:#channel: {
var %i = 0
while (%i < $numtok(%swear.words,32)) {
inc %i
var %current.word = $gettok(%swear.words,%i,32)
if ($istok($strip($1-),%current.word,32) == $true) {
/notice $nick You said %current.word $+ . Please refrain from saying that again. (Auto Response)
}
}
}

Problem is, punctuation causes the script to miss the word, so right now my swear word variable is pretty big.

any ideas on how to get it to check for the word, regardless of punctuation?

(examples: f*ck. hell? etc etc)

#109770 01/02/05 02:03 PM
Joined: Mar 2004
Posts: 175
Vogon poet
Offline
Vogon poet
Joined: Mar 2004
Posts: 175
Code:
on *:TEXT:*:#channel: {
  var %i = 1
  while ($gettok(%swear.words,%i,32)) {
    var %current.word = $v1
    if ($istok($remove($strip($1-),$chr(44),.,?,;,:),%current.word,32) == $true) {
      notice $nick You said %current.word $+ . Please refrain from saying that again. (Auto Response)
    }
    inc $i
  }
}

You can add more punctuation to $remove.


- Relinsquish

Link Copied to Clipboard