mIRC Homepage
Posted By: FilteredRiddle Auto Unban Chanserv Bans - 23/07/16 03:32 PM
I have some restricted channels, where the vast majority of people who get banned are actual members who forgot to identify first, pinged, failed to identify quickly enough, etc.

I would like a script which automatically unbans those banned by ChanServ. If it could delineate between ChanServ autobans and OPs banning that'd be great, though I don't believe it's possible.

Please help?
Posted By: KindOne Re: Auto Unban Chanserv Bans - 24/07/16 04:07 AM
You could apply channel mode +R or +r (depends on ircd / services) to only allow identified nicks in.

Grant them access to use ChanServ's UNBAN command on themselves, assuming that command exists on the network.


I /think/ this is valid, I didn't test it.

on @:ban:#channel:{ if ($nick == ChanServ) { mode $chan -b $banmask } }
Posted By: FilteredRiddle Re: Auto Unban Chanserv Bans - 24/07/16 12:15 PM
The channel is +r, which is why people get banned if they haven't identified for some reason.

I'll give that script a go!
Posted By: FilteredRiddle Re: Auto Unban Chanserv Bans - 25/07/16 08:41 PM
Unfortunately, the script doesn't seem to work.

As a more detailed example, when this happens:

[14:34:25] * User (User@swc-irc.2jr.f9f.fsnneb.IP) has joined #cmg-channel
[14:34:25] * ChanServ sets mode: +b *!*@swc-irc.2jr.f9f.fsnneb.IP
[14:34:25] * User was kicked by ChanServ (You are not authorized to be on this channel)

I'd like a script which causes me to automatically do this:

FilteredRiddle sets mode: -b *!*@swc-irc.2jr.f9f.fsnneb.IP
Posted By: CtrlAltDel Re: Auto Unban Chanserv Bans - 26/07/16 01:45 AM
This works for me on DALnet:
Code:
on me:*:kick:#channelname: {
  if (restricted channel isin $1-) {
    msg ChanServ@services.dal.net unban $1
  }
}
Posted By: FilteredRiddle Re: Auto Unban Chanserv Bans - 26/07/16 08:29 PM
I tried this, but it does not appear to work for me either.
Posted By: Dazuz Re: Auto Unban Chanserv Bans - 27/07/16 11:23 AM
Code:
on *:kick:#CHANNEL: {
  if ($nick == ChanServ) && ($1- == You are not authorized to be on this channe) && ($me isop #) {
    var %a = $address($knick,5),%x 1,%b
    while ($ibl(#,%x)) { if ($v1 iswm %a) var %b = %b $v1 | inc %x }
    massmode # -b %b
  }
}

alias massmode {
  while ($3) {
    mode $1 $left($2,1) $+ $str($right($2,1),$modespl) $gettok($3-,1- $+ $modespl,32)
    tokenize 32 $1-2 $gettok($3-,$calc(1+$modespl) $+ -,32)
  }
}

Remember to change the #CHANNEL on the kick event.

The massmode alias is a bit overkill, but it's there just in case there's somehow more than $modespl amount of bans matching the user who got kicked.
Posted By: FilteredRiddle Re: Auto Unban Chanserv Bans - 27/07/16 10:36 PM
In my remote tab, I put:

Code:
on *:kick:#cmg-channel: {
  if ($nick == ChanServ) && ($1- == You are not authorized to be on this channe) && ($me isop #) {
    var %a = $address($knick,5),%x 1,%b
    while ($ibl(#,%x)) { if ($v1 iswm %a) var %b = %b $v1 | inc %x }
    massmode # -b %b
  }
}

alias massmode {
  while ($3) {
    mode $1 $left($2,1) $+ $str($right($2,1),$modespl) $gettok($3-,1- $+ $modespl,32)
    tokenize 32 $1-2 $gettok($3-,$calc(1+$modespl) $+ -,32)
  }
}


#cmg-channel is the channel in question. However, upon someone getting banned, I still had to manually unban them:

[16:20:33] * User (User@swc-irc.9s2.4pn.7aksvo.IP) has joined #cmg-channel
[16:20:33] * ChanServ sets mode: +b *!*@swc-irc.9s2.4pn.7aksvo.IP
[16:20:33] * User was kicked by ChanServ (You are not authorized to be on this channel)
[16:30:54] * FilteredRiddle sets mode: -b *!*@swc-irc.9s2.4pn.7aksvo.IP

Is there something I'm doing wrong here? frown
Posted By: Dazuz Re: Auto Unban Chanserv Bans - 27/07/16 11:38 PM
Looks like I missed one "L" from the end of the kick reason. Fixed version:

Code:
on *:kick:#CHANNEL: {
  if ($nick == ChanServ) && ($1- == You are not authorized to be on this channel) && ($me isop #) {
    var %a = $address($knick,5),%x 1,%b
    while ($ibl(#,%x)) { if ($v1 iswm %a) var %b = %b $v1 | inc %x }
    massmode # -b %b
  }
}

alias massmode {
  while ($3) {
    mode $1 $left($2,1) $+ $str($right($2,1),$modespl) $gettok($3-,1- $+ $modespl,32)
    tokenize 32 $1-2 $gettok($3-,$calc(1+$modespl) $+ -,32)
  }
}
Posted By: FilteredRiddle Re: Auto Unban Chanserv Bans - 29/07/16 08:20 PM
It appears to work!

[14:01:59] * Test|19660 (6b029375@swc-irc.lh6.kde.veueic.IP) has joined #cmg-channel
[14:02:00] * ChanServ sets mode: +b *!*@swc-irc.lh6.kde.veueic.IP
[14:02:00] * Test|19660 was kicked by ChanServ (You are not authorized to be on this channel)
[14:02:00] * FilteredRiddle sets mode: -b *!*@swc-irc.lh6.kde.veueic.IP
[14:02:00] * FilteredRiddle sets mode: +e FilteredRiddle!*@*
[14:02:00] * ChanServ sets mode: +v FilteredRiddle
-
© mIRC Discussion Forums