mIRC Home    About    Download    Register    News    Help

Print Thread
Multiple unban hostmask #171611 26/02/07 03:46 PM
Joined: Feb 2007
Posts: 28
S
sner Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Feb 2007
Posts: 28

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

Re: Multiple unban hostmask [Re: sner] #171620 26/02/07 08:10 PM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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.


Invision Support
#Invision on irc.irchighway.net
Re: Multiple unban hostmask [Re: Riamus2] #171644 27/02/07 02:23 AM
Joined: Feb 2007
Posts: 28
S
sner Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Feb 2007
Posts: 28

Thank you for the reply sensei Riamus2 im pretty much sure this will work! =)

Re: Multiple unban hostmask [Re: sner] #171668 27/02/07 01:34 PM
Joined: Feb 2007
Posts: 28
S
sner Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Feb 2007
Posts: 28

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.. =(


Re: Multiple unban hostmask [Re: sner] #171680 27/02/07 02:40 PM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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.


Invision Support
#Invision on irc.irchighway.net
Re: Multiple unban hostmask [Re: Riamus2] #171682 27/02/07 02:59 PM
Joined: Feb 2007
Posts: 28
S
sner Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Feb 2007
Posts: 28
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..