mIRC Home    About    Download    Register    News    Help

Print Thread
#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.
Joined: Sep 2003
Posts: 38
S
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.

Joined: Jul 2006
Posts: 242
H
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
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.

Joined: Nov 2006
Posts: 1,559
H
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
  }
}

Joined: Jan 2005
Posts: 192
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

Link Copied to Clipboard