mIRC Homepage
Posted By: Teeks Autokick on certain word - 23/05/05 04:15 PM
I have a script that autokicks whenever someone says a specified word. It's pretty simple, and I got it most of it from the net somewhere.

It's ideal, but I'd like to add a few exempts determined by nicknames (ignore some people, even if they spam the word a billion times!).

The script kicks ops too, which is the idea smile

Code:
On *@:text:*:#: {
  ;Start Insert
  if ($nick) {
    if (word isin $strip($1-))  {
      kick # $nick Stop talking about that bloody word!
    }
  }
  ;End Insert
}


Could someone lend a hand and amend the above so I can include an ignore $nick or something please? I've tried the obvious ones (!= name after $nick etc), but my scripting ability is pretty limited...

Cheers
Posted By: tidy_trax Re: Autokick on certain word - 23/05/05 04:21 PM
Code:
on @*:text:*:#:{
  if (!$istok([color:red]nick1 nick2 nick3 nick4 etc[/color], $nick, 32)) && ($istok($1-, word, 32)) {
    kick $chan $nick Stop talking about that bloody word!
    .ignore $nick
  }
}
Posted By: Teeks Re: Autokick on certain word - 23/05/05 04:52 PM
Excellent, but one small problem! It seems the word cant have a number in there, or the script wont kick.

Some people get around it by replacing some letters with numbers smirk
Posted By: Riamus2 Re: Autokick on certain word - 23/05/05 05:05 PM
Well, that's always a possibility. You can add more "words" to kick on, but a script won't be able to see something like "h3ll" and know that the person is really meaning "hell." You can use many ways to try and catch most things, but in the end, people can fool any script if they really want.

You can replace common changes with a wildcard so that you can catch 3 and e.

You could try something along the lines of this:

Code:
on @*:text:*:#:{
  if (!$istok(nick1 nick2 nick3 nick4 etc, $nick, 32)) && ($istok($replace($1-,0,o), word, 32)) {
    kick $chan $nick Stop talking about that bloody word!
    .ignore $nick
  }
}


So, if something said "w0rd" or "word", it would kick them. You can use the same idea with other words you do. This suggestion is mainly for common changes in letters (3 for e, 0 for o, 5 for s, etc). If people use many other formats to make a word, you are better off using a file with all possibilities of the word(s) you're trying to block and scan the file when people talk.

Also, you can prevent all ops from being kicked by doing this:

Code:
on @*:text:*:#:{
  if ($nick !isop $chan) && (!$istok(nick1 nick2 nick3 nick4 etc, $nick, 32)) && ($istok($replace($1-,0,o), word, 32)) {
    kick $chan $nick Stop talking about that bloody word!
    .ignore $nick
  }
}


Then, you just need to include any other nicks you want excluded within the nick1,nick2,etc part. Of course, if you want some ops to still get kicked, you won't want to do it this way.
Posted By: Teeks Re: Autokick on certain word - 24/05/05 08:41 AM
You misunderstood smile

I meant that if I added any words with numbers (w0rd for example) then the script wouldnt work at all. I added about 8 words in total, and it just wouldnt work at all. Took me a while, but I figured out it was one of the words that had a number (I had to add as many different versions of the word as possible!)

This is just a friendly (funny?!) script I'm running in a channel where virtually everyone is opped. One of the guys is constantly teased with an ex, so I've setup an autokick once she's mentioned.

Is it possible to add multiple replace variables ?

Is it

($replace($1-,0,o)($1-,3,e) or ($replace($1-,0,o)($replace($1-,3,e)

Cheers
Posted By: Kelder Re: Autokick on certain word - 24/05/05 09:50 AM
neither

Try $replace($1-,0,o,3,e,7,t)
Posted By: Teeks Re: Autokick on certain word - 24/05/05 10:01 AM
Awesome!

Er, now to specify which channel? It's kicking some people in other channels, even when they're not saying any specified words smirk
Posted By: SladeKraven Re: Autokick on certain word - 24/05/05 12:38 PM
In the first part of your code:

Code:
on @*:text:*:#:{


The above code means you're matching all text, to only when you're a channel operator in all channels.

# = All channels
#mIRC - Will only trigger on #mIRC
#Hello,#my,#name,#is,#Andy will trigger in these channels.

Code:
on @*:text:*:#Channel1[color:red],[/color]#Channel2[color:red],[/color]#Channel3:{


Which will only work in #Channel1,#Channel2 and #Channel3.

-Andy
Posted By: Teeks Re: Autokick on certain word - 24/05/05 12:52 PM
We're almost there guys...

K, it nearly works. It kicks anyone that says word, the replace command kicks anyone trying to be clever by using numbers, but the problem is, once someone's been kicked, they're kicked whatever they say...

One person called me a git for kicking them (after they said the word), and I kept kicking them for anyword after that!
Posted By: SladeKraven Re: Autokick on certain word - 24/05/05 12:59 PM
What is the full code you're using now? Post it in.. smile

-Andy
Posted By: Teeks Re: Autokick on certain word - 24/05/05 01:29 PM
Code:
on @*:text:*:#channel:{
  if (!$istok(ignoremate, $nick, 32)) && ($istok($replace($1-,0,o,3,e,1,l), hisex, 32)) {
    kick $chan $nick Stop talking about that bloody ex!
  }
}


Edited the names to protect the ... erm, innocent.
© mIRC Discussion Forums