mIRC Homepage

Empty the ban list

Posted By: tekano

Empty the ban list - 06/03/07 12:10 AM

I was just playing around a bit with this here:

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...
Posted By: snabbi

Re: Empty the ban list - 08/03/07 06:59 PM

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.
Posted By: HaleyJ

Re: Empty the ban list - 09/03/07 01:25 PM

type /clearbans in any channel window to clear the ban list
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
Posted By: SGR

Re: Empty the ban list - 18/03/07 04:37 PM

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.
Posted By: Horstl

Re: Empty the ban list - 01/04/07 01:36 AM

a timed solution sending one line each second would be e.g.
; 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
Posted By: Brax

Re: Empty the ban list - 01/04/07 07:01 PM

(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?
© 2022 mIRC Discussion Forums