mIRC Home    About    Download    Register    News    Help

Print Thread
#154372 29/07/06 12:12 PM
Joined: Jul 2006
Posts: 242
H
HaleyJ Offline OP
Fjord artisan
OP Offline
Fjord artisan
H
Joined: Jul 2006
Posts: 242
Hi
I need help with a ban script that would ban all 10 addresses of a user maybe using the IAL list. I am aware that its not needed to ban all 10 addresses. thanks


Newbie
#154373 29/07/06 12:25 PM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Code:
alias banall {
  if (!$ial($2)) return
  var %i = 1, %addresses
  while (%i <= 10) {
    %addresses = %addresses $address($2,%i)
    if (%i == $modespl) {
      mode $1 + $+ $str(b,%i) %addresses
      %addresses =
    }
    inc %i
  }
  if (%addresses) mode $1 + $+ $str(b,$numtok(%addresses,32)) %addresses
}


/banall #channel <nickname>

#154374 29/07/06 12:29 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Code:
 menu nicklist {
Ban All addresses : ban.all $chan $snicks
}
alias ban.all {
var %a = 1, %b = 1
while %b &lt;= $numtok($2-,44) {
kick $1 $gettok($2-,%b,44)
while %a &lt;= 10 {
.ban $1 $gettok($2-,%b,44) %a
inc %a
}
inc %b
}
}
 

#154375 29/07/06 03:40 PM
Joined: Jul 2006
Posts: 242
H
HaleyJ Offline OP
Fjord artisan
OP Offline
Fjord artisan
H
Joined: Jul 2006
Posts: 242
Hi
Thanks for all the replies, I tried both and they work but they dont ban all ten addresses? I am looking for a +bbbbbbbbbb on one nick which bans all ten of the nicks addresses. these scripts are just banning two of the addresses. thanks


Newbie
#154376 29/07/06 03:44 PM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
I tried it and it bans all ten addresses for me. Are you sure you're using it right? /banall <channel> nickname

#154377 29/07/06 06:16 PM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
Quote:
Code:
alias banall {
  if (!$ial($2)) return
  var %i = 1, %addresses
  while (%i &lt;= 10) {
    %addresses = %addresses $address($2,%i)
    [color:blue]if (%i == $modespl) {[/color]
      mode $1 + $+ $str(b,%i) %addresses
      %addresses =
    }
    inc %i
  }
  if (%addresses) mode $1 + $+ $str(b,$numtok(%addresses,32)) %addresses
}


Won't that only hit modespl once? Maybe mod is a better alternative?

e.g. $modespl = 3

%i = 1 - %i != 3
%i = 2 - %i != 3
%i = 3 - %i == 3 -- matches here, address is reset, but %i keeps += 1
%i = 4 - %i != 3
%i = 5 - %i != 3
%i = 6 - %i != 3 -- Should match here, we have 3 more modes.
...etc.


-KingTomato
#154378 29/07/06 11:59 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
OK, then the only way there should be a problem with this is if mIRC or the IRCd is preventing all 10 from being set at once
Code:
 alias ban.all {
.mode $1 +bbbbbbbbbb $2 1 $2 2 $2 3 $2 4 $2 5 $2 6 $2 7 $2 8 $2 9 $2 10
}

Usage /ban.all <channel> <nick>

Note: There is no error checking in this.

#154379 30/07/06 12:07 AM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
You're right. A second counter should fix it:

Code:
alias banall {
  if (!$ial($2)) return
  var %i = 1, %g = 1, %addresses
  while (%i &lt;= 10) {
    %addresses = %addresses $address($2,%i)
    if (%g == $modespl) {
      mode $1 + $+ $str(b,%g) %addresses
      %addresses =
      %g = 0
    }
    inc %g
    inc %i
  }
  if (%addresses) mode $1 + $+ $str(b,$numtok(%addresses,32)) %addresses
}

#154380 30/07/06 12:25 AM
Joined: Jul 2006
Posts: 242
H
HaleyJ Offline OP
Fjord artisan
OP Offline
Fjord artisan
H
Joined: Jul 2006
Posts: 242
Hi.
Yes i think it may be the IRC server not letting me as it wont ban more then four addresses. On your last script this is the result though.

Haleyj sets mode: +bbbbbb Test!*@* 1!*@* 2!*@* 3!*@* 4!*@* 5!*@*


Newbie
#154381 30/07/06 12:37 AM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
The updated version of mine should work on any irc server.

#154382 30/07/06 01:15 AM
Joined: Jul 2006
Posts: 242
H
HaleyJ Offline OP
Fjord artisan
OP Offline
Fjord artisan
H
Joined: Jul 2006
Posts: 242
Hello,
I tried the updated version of the script and its only banning four addresses. i made sure that the test nick was in the IAL list before doing it.


Newbie
#154383 30/07/06 01:33 AM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Hmm you're right. The thing is, if I echo the command it's executing it looks fine:

Quote:
mode #hixxytest +bbbbbb *!*hixxy@cpc3-linc5-0-0-cust974.nott.cable.ntl.com *!*@cpc3-linc5-0-0-cust974.nott.cable.ntl.com *!*hixxy@*.nott.cable.ntl.com *!*@*.nott.cable.ntl.com hixxy!hixxy@cpc3-linc5-0-0-cust974.nott.cable.ntl.com hixxy!*hixxy@cpc3-linc5-0-0-cust974.nott.cable.ntl.com
mode #hixxytest +bbbb hixxy!*@cpc3-linc5-0-0-cust974.nott.cable.ntl.com hixxy!*hixxy@*.nott.cable.ntl.com hixxy!*@*.nott.cable.ntl.com *!hixxy@cpc?-linc?-?-?-cust???.nott.cable.ntl.com


Even if I copy/paste the command it echos it doesn't work. My only guess is that this is because some of the addresses are already covered by other masks. There's nothing that can be done about this I'm afraid.

You can prove this further by typing this:

Code:
//mode # +bbbbbb $address($me,1) $address($me,2) $address($me,3) $address($me,4) $address($me,5) $address($me,6)


I updated the script again as well.

Code:
alias banall {
  if (!$ial($2)) return
  var %i = 1, %addresses
  while (%i &lt;= 10) {
    %addresses = %addresses $address($2,%i)
    if ($numtok(%addresses,32) == $modespl) {
      mode $1 + $+ $str(b,$numtok(%addresses,32)) %addresses
      %addresses =
    }
    inc %i
  }
  if (%addresses) mode $1 + $+ $str(b,$numtok(%addresses,32)) %addresses
}

#154384 30/07/06 01:58 AM
Joined: Jul 2006
Posts: 242
H
HaleyJ Offline OP
Fjord artisan
OP Offline
Fjord artisan
H
Joined: Jul 2006
Posts: 242
Hi
I think you are right as i echoed my addresses using this code
//echo -a $address($me,1)
and i went through all 10 and some were the same. My question is why does mIRC keep an IAL list of 10 addresses when some are duplicated.


Newbie
#154385 30/07/06 02:03 AM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
If you look closely enough you'll see that they're not duplicated, but covered by wildcards in other masks.

#154386 30/07/06 05:17 AM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
using modulos works nicely as well, instead of an alternate counter or numtok. Most likely (under certain circumstances) faster as well to check a mod of a number, then count the tokens in a string.

if ($calc(%i % $modespl) == 0) { ... }


-KingTomato

Link Copied to Clipboard