mIRC Homepage
Posted By: sner Multiple unban hostmask - 26/02/07 03:46 PM

It will only -b *!*@hostmask 1 at a time =(

Code:
on 1*:ban:#:{
  timer 1 800 /mode # -b $banmask
}

How will i make a code for multiple unban .. more than 3 hostmask at once?

for instance..
* MYNICK sets mode: -bbb *!*@hostmask *!*@hostmask *!*@hostmask
Posted By: Riamus2 Re: Multiple unban hostmask - 26/02/07 08:10 PM
I think I'd use a variable... (untested):

Code:
on *:ban:#:{
  var %bans = %bans $banmask
  if ($numtok(%bans,32) == 6) {
    .timer 1 800 mode $chan -bbbbbb %bans
    unset %bans
  }
  .timerUnban 1 2 DoUnban %bans
}

alias DoUnban {
  if ($1) { .timer 1 800 mode $chan - $+ $str(b,$0) $1- }
}


Basically, that will put all bans done in a 2 second time frame (this covers all multiple bans since they happen all at once) into a variable. It will then set a timer to unban them. If more than 6 are done within that timeframe, then they will go onto a separate timer because most networks don't allow more than 6 bans/unbans in a single mode. Note that if your network allows FEWER than 6 at once, you'll need to change the 6 to whatever is allowed. If you don't know, just try banning 10 addresses at once and see what the output shows... if it's 6 at once or 5 or whatever.

As I said, this is untested, but it should work.
Posted By: sner Re: Multiple unban hostmask - 27/02/07 02:23 AM

Thank you for the reply sensei Riamus2 im pretty much sure this will work! =)
Posted By: sner Re: Multiple unban hostmask - 27/02/07 01:34 PM

Hello mate! i've tested the code you've posted last night..
Code:
on *:ban:#:{
  var %bans = %bans $banmask
  if ($numtok(%bans,32) == 6) {
    .timer 1 800 mode $chan -bbbbbb %bans
    unset %bans
  }
  .timerUnban 1 2 DoUnban %bans
}

alias DoUnban {
  if ($1) { .timer 1 800 mode $chan - $+ $str(b,$0) $1- }
}

here's the result..
Quote:
* tester` sets mode: +bbbbbb *!*@whatz.* *!*@whast.* *!*@whatd.* *!*@wshat.* *!*@whgat.* *!*@wjhat.*
* tester` sets mode: -b *!*@whatz.*
* tester` sets mode: -b *!*@whast.*
* tester` sets mode: -b *!*@whatd.*
* tester` sets mode: -b *!*@wshat.*
* tester` sets mode: -b *!*@whgat.*
* tester` sets mode: -b *!*@wjhat.*

Still the same, it will unban 1 at a time.. =(

Posted By: Riamus2 Re: Multiple unban hostmask - 27/02/07 02:40 PM
Code:
on *:ban:#:{
  set -u820 %bans %bans $banmask
  if ($numtok(%bans,32) == 6) {
    .timer 1 800 mode $chan -bbbbbb %bans
    unset %bans
  }
  .timerUnban 1 2 DoUnban $chan %bans
}

alias DoUnban {
  if ($1) { .timer 1 800 mode $1 - $+ $str(b,$0) $2- }
}


Should work now. It unbans in reverse for some strange reason, but it works.
Posted By: sner Re: Multiple unban hostmask - 27/02/07 02:59 PM
WOOOOOHOOOOOOOOO!! it works flawlessly mate! you are the maaan! Riamus2 =)

i wish i could have brainpower like yours.. thnx a mucho again bro =)

Guys, if you need mass unban script .. use those codes what sensei Riamus2 posted..
© mIRC Discussion Forums