mIRC Home    About    Download    Register    News    Help

Print Thread
Autokick on certain word #121043 23/05/05 04:15 PM
Joined: May 2005
Posts: 6
T
Teeks Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
T
Joined: May 2005
Posts: 6
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

Re: Autokick on certain word #121044 23/05/05 04:21 PM
Joined: Nov 2003
Posts: 2,327
T
tidy_trax Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
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
  }
}


New username: hixxy
Re: Autokick on certain word #121045 23/05/05 04:52 PM
Joined: May 2005
Posts: 6
T
Teeks Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
T
Joined: May 2005
Posts: 6
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

Re: Autokick on certain word #121046 23/05/05 05:05 PM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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.


Invision Support
#Invision on irc.irchighway.net
Re: Autokick on certain word #121047 24/05/05 08:41 AM
Joined: May 2005
Posts: 6
T
Teeks Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
T
Joined: May 2005
Posts: 6
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

Re: Autokick on certain word #121048 24/05/05 09:50 AM
Joined: Apr 2003
Posts: 701
K
Kelder Offline
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
neither

Try $replace($1-,0,o,3,e,7,t)

Re: Autokick on certain word #121049 24/05/05 10:01 AM
Joined: May 2005
Posts: 6
T
Teeks Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
T
Joined: May 2005
Posts: 6
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

Re: Autokick on certain word #121050 24/05/05 12:38 PM
Joined: Dec 2002
Posts: 3,547
S
SladeKraven Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
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

Re: Autokick on certain word #121051 24/05/05 12:52 PM
Joined: May 2005
Posts: 6
T
Teeks Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
T
Joined: May 2005
Posts: 6
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!

Re: Autokick on certain word #121052 24/05/05 12:59 PM
Joined: Dec 2002
Posts: 3,547
S
SladeKraven Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
What is the full code you're using now? Post it in.. smile

-Andy

Re: Autokick on certain word #121053 24/05/05 01:29 PM
Joined: May 2005
Posts: 6
T
Teeks Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
T
Joined: May 2005
Posts: 6
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.