mIRC Home    About    Download    Register    News    Help

Print Thread
kick script #147078 13/04/06 03:27 PM
Joined: Mar 2005
Posts: 74
K
KidSol Offline OP
Babel fish
OP Offline
Babel fish
K
Joined: Mar 2005
Posts: 74
how do i make a kick script when it trigger on certain words.

it'll give warning on the first time and then the second time it'll kick the person who trigger it

i wanted to setup a few words together so i don't have to repeat again the whole scripting.
i want to to trigger by a few types of words.

example
<123> kkkk
<bot> Warning, You are not allow to say "kkkk" in this channel.
<123> zzzz
*123 was kicked by bot

Code:
on *:text::#channel:{
If (zzzz | kkkk)
 kick $nick
}


sorry, i'm not good in coding.

Re: kick script #147079 13/04/06 03:55 PM
Joined: Aug 2005
Posts: 525
S
schaefer31 Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
Fair warning, I didn't test this, but it should work. Words are separated by a |

If two or more 'bad words' are in the same line, then it kicks with no warning. Otherwise if only 1 word is in a line, then it first gives a warning, and on second time it kicks and resets the counter.

Edit: Made a couple small corrections and changed it so it tracks by the user's address and not their nick.

Code:
on @*:TEXT:*:[color:red]#Channel[/color]:{
  if ($regex($1-,/\b([color:red]zzzz[/color]|[color:red]kkkk[/color])\b/igS)) {
    if ($regml(0) &gt;= 2) kick $chan $nick 
    else {
      var %address = $remove($address($nick,2),*,!,@)
      hinc -m Warnings %address
      if ($hget(Warnings,%address) == 1) msg $chan Warning $nick $+ , You are not allowed to say $regml(1) in this channel.
      else kick $chan $nick
      hdel Warnings %address
    }
  }
}

Last edited by schaefer31; 13/04/06 04:46 PM.
Re: kick script #147080 14/04/06 08:43 AM
Joined: Mar 2005
Posts: 74
K
KidSol Offline OP
Babel fish
OP Offline
Babel fish
K
Joined: Mar 2005
Posts: 74
the warning works but it's not kicking the person out of the channel.
might be error in the kicking part

thx

Re: kick script #147081 14/04/06 03:58 PM
Joined: Aug 2005
Posts: 525
S
schaefer31 Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
The code was fine, I just forgot a set of braces.

Code:
on @*:TEXT:*:[color:red]#Channel[/color]:{
  if ($regex($1-,/\b([color:red]zzzz[/color]|[color:red]kkkk[/color])\b/igS)) {
    if ($regml(0) &gt;= 2) kick $chan $nick 
    else {
      var %address = $remove($address($nick,2),*,!,@)
      hinc -m Warnings %address
      if ($hget(Warnings,%address) == 1) msg $chan Warning $nick $+ , You are not allowed to say $regml(1) in this channel.
      else [color:red]{[/color]
        kick $chan $nick
        hdel Warnings %address
      [color:red]}[/color]
    }
  }
}