mIRC Home    About    Download    Register    News    Help

Print Thread
on join kick ban #147977 27/04/06 01:21 PM
Joined: Apr 2004
Posts: 18
M
McFish Offline OP
Pikka bird
OP Offline
Pikka bird
M
Joined: Apr 2004
Posts: 18
hi i want on join kick ban addon for bad Channels
example : when someone join the my Channel with #blah will be kicked banned


Thanx

Re: on join kick ban #147978 27/04/06 02:42 PM
Joined: Aug 2005
Posts: 525
S
schaefer31 Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
I'm not quite sure I understood your question. Part of me thinks you want to check if the nick joining your channel is on other, 'bad' channels and if so kick them from yours. And the other part of me thinks you are just being ruthless and wanting to kick/ban anyone who joins your channel. Please be more clear.

Re: on join kick ban #147979 27/04/06 02:59 PM
Joined: Apr 2004
Posts: 18
M
McFish Offline OP
Pikka bird
OP Offline
Pikka bird
M
Joined: Apr 2004
Posts: 18
I mean when someone join my Channel and he is in bad Channels will be kicked banned ....
like if he is in #sex and joined my channel will be kick/ban

Re: on join kick ban #147980 27/04/06 03:57 PM
Joined: Aug 2005
Posts: 525
S
schaefer31 Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
Change only what is in red! The 'bad' channels list is separated by spaces.

mIRC 6.17 is required for the code to work!

Code:
on !*:JOIN:[color:red]#YourChannel[/color]:{
  hadd -mu3 temp.whois $nick $chan
  whois $nick
}

raw 319:*:{
  if ($hget(temp.whois,$2)) {
    var %chans = $regsubex($3-,/(?<=^|) $+ $+([,\\,$prefix,]+/g),)
    var %bad.chans = [color:red]#BadChannel1 #BadChannel2 #BadChannelN[/color]
    var %i = 1, %l = $numtok(%bad.chans,32)
    while (%i <= %l) {
      if ($istok(%chans,$gettok(%bad.chans,%i,32),32)) {
        ban -ku300 $hget(temp.whois,$2) $2 You may not join $hget(temp.whois,$2) while on $gettok(%bad.chans,%i,32) $+ !
        return
      }
      inc %i
    }
  }
}


The user will be banned and kicked from your channel for a period of 5 minutes. If you wish to make it permanent, then change the following line:

Code:
        ban -ku300 $hget(temp.whois,$2) $2 You may not join $hget(temp.whois,$2) while on $gettok(%bad.chans,%i,32) $+ !

To:
Code:
        ban -k $hget(temp.whois,$2) $2 You may not join $hget(temp.whois,$2) while on $gettok(%bad.chans,%i,32) $+ !


Or to change the duration, simply change the '300' value. Keep in mind that means 300 seconds, which is 5 minutes.

Re: on join kick ban #147981 27/04/06 04:21 PM
Joined: Apr 2004
Posts: 18
M
McFish Offline OP
Pikka bird
OP Offline
Pikka bird
M
Joined: Apr 2004
Posts: 18
It doesn't work frown
I'm using mirc v6.14

Re: on join kick ban #147982 27/04/06 04:59 PM
Joined: Feb 2006
Posts: 164
V
vexed Offline
Vogon poet
Offline
Vogon poet
V
Joined: Feb 2006
Posts: 164
Quote:

mIRC 6.17 is required for the code to work!


$regsubex was introduced to mIRC 6.17 that's why it won't work on 6.14 McFish :tongue:

Last edited by vexed; 27/04/06 05:01 PM.
Re: on join kick ban #147983 27/04/06 05:21 PM
Joined: Aug 2005
Posts: 525
S
schaefer31 Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
If you insist on using 6.14, then here is a different method to clean up the channel list that will work for you. The blue line is the only line from the previous code that I changed. It calls an added alias at the bottom.

Code:
on !*:JOIN:[color:red]#YourChannel[/color]:{
  hadd -mu3 temp.whois $nick $chan
  whois $nick
}

raw 319:*:{
  if ($hget(temp.whois,$2)) {
    [color:blue]var %chans = $_noprefix($3-)[/color]
    var %bad.chans = [color:red]#BadChannel1 #BadChannel2 #BadChannelN[/color]
    var %i = 1, %l = $numtok(%bad.chans,32)
    while (%i <= %l) {
      if ($istok(%chans,$gettok(%bad.chans,%i,32),32)) {
        ban -ku300 $hget(temp.whois,$2) $2 You may not join $hget(temp.whois,$2) while on $gettok(%bad.chans,%i,32) $+ !
        return
      }
      inc %i
    }
  }
}

alias _noprefix {
  if (!$isid) return
  var %chans = $1-
  var %i = 1, %l = $numtok(%chans,32), %tmp
  while (%i <= %l) {
    %tmp = $+(%tmp,$chr(32),$chr(35),$gettok($gettok(%chans,%i,32),$iif($numtok($gettok(%chans,%i,32),35) > 1,2,1),35)))
    inc %i
  }
  return %tmp
}

Re: on join kick ban #147984 28/04/06 01:58 AM
Joined: Apr 2004
Posts: 18
M
McFish Offline OP
Pikka bird
OP Offline
Pikka bird
M
Joined: Apr 2004
Posts: 18
Thanx alot