mIRC Home    About    Download    Register    News    Help

Print Thread
Empty the ban list #172127 06/03/07 12:10 AM
Joined: Mar 2006
Posts: 25
T
tekano Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Mar 2006
Posts: 25
I was just playing around a bit with this here:

Code:
on *:TEXT:!empty:#spelletjes: {
  if (($nick isop #) || ($nick ishop #)) {
    set %testbans $ibl(#spelletjes,0)
    while %testbans > 30 {
      mode $chan -bbbbbbbb $ibl(#spelletjes,%testbans) $ibl(#spelletjes,$calc(%testbans - 1)) $ibl(#spelletjes,$calc(%testbans - 2)) $ibl(#spelletjes,$calc(%testbans - 3)) $ibl(#spelletjes,$calc(%testbans - 4)) $ibl(#spelletjes,$calc(%testbans - 5)) $ibl(#spelletjes,$calc(%testbans - 6)) $ibl(#spelletjes,$calc(%testbans - 7))
      dec %testbans 8
    }
  }
}


and came to the conclusion that I must be missing something here. the while is always correct until %testbans goes under 30, wich is when the script should stop. There are like 260 bans in the ban list.

I must be forgetting something here...

Last edited by tekano; 06/03/07 12:35 AM.
Re: Empty the ban list [Re: tekano] #172301 08/03/07 06:59 PM
Joined: Sep 2003
Posts: 38
S
snabbi Offline
Ameglian cow
Offline
Ameglian cow
S
Joined: Sep 2003
Posts: 38
You don't specify what is going wrong. What is your problem?

As extra suggestions I would recomment:
making the -bbb part more flexible than just those 8 bans. Build a script for matching the number of -b's with the number of bans in the address list. If it exeeds the max number of -b's then group these unban statements

There is no need to use set here, you are using %testban as a temporary var, so just use var.

Re: Empty the ban list [Re: tekano] #172393 09/03/07 01:25 PM
Joined: Jul 2006
Posts: 242
H
HaleyJ Offline
Fjord artisan
Offline
Fjord artisan
H
Joined: Jul 2006
Posts: 242
type /clearbans in any channel window to clear the ban list
Code:
alias clearbans {
  if ($me !isop $chan) { echo $active ABORTED: You need to be opped on the channel. | return }
  echo $active Clearing bans on $chan
  var %i = 1, %bans
  while (%i <= $ibl($chan,0)) {
    %bans = %bans $ibl($chan,%i)
    if ($numtok(%bans,32) == $modespl) {
      mode $chan $str(-b,$modespl) %bans
      %bans = ""
    }
    inc %i
  }
  if (%bans) mode $chan $+($str(-b,$numtok(%bans,32))) %bans
}


Newbie
Re: Empty the ban list [Re: HaleyJ] #172952 18/03/07 04:37 PM
Joined: Aug 2003
Posts: 20
S
SGR Offline
Ameglian cow
Offline
Ameglian cow
S
Joined: Aug 2003
Posts: 20
On a large number of bans do not the above posted scripts run the risk of the issuer exceeding their SendQ limit server-side for most networks - hence them getting booted off?

I don't know where mIRC's internal anti-flood system works with regards to this, but my suggestion would be the following:

Where possible consider using services' commands to perform this action (on networks with service bots similar to QuakeNet's "Q" or DALnet's "ChanServ" there is usually a method to clear a channels modes with a single request to a service bot (re-setting a few channel modes is a fairly trivial affair if it clears all modes).

Otherwise, perhaps throttle the mode changes with a timer, or dump the commands to a file and play it with a reasonable delay setting.

Re: Empty the ban list [Re: tekano] #173947 01/04/07 01:36 AM
Joined: Nov 2006
Posts: 1,559
H
Horstl Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
a timed solution sending one line each second would be e.g.
Code:
; syntax: allunban #somechan

alias allunban {
  var %b.num = $ibl($1,0), %l.nr = 1, %b.nr = 1
  while (%b.num > 0) {
    var %do = $iif((%b.num > $modespl),$modespl,%b.num), %b.string
    while ($numtok(%b.string,32) < %do) { var %b.string = $addtok(%b.string,$ibl($1,%b.nr),32) | inc %b.nr }
    .timer 1 %l.nr mode $1 $+(-,$str(b,%do)) %b.string
    inc %l.nr | dec %b.num %do
  }
}

Re: Empty the ban list [Re: Horstl] #174011 01/04/07 07:01 PM
Joined: Jan 2005
Posts: 192
Brax Offline
Vogon poet
Offline
Vogon poet
Joined: Jan 2005
Posts: 192
(General reply)

In Undernet I find that I also can use /mode #channel -b *
Since I don't recall coding such alias I guess it's IRCu feature... maybe some other networks support it as well?


echo -a $signature