Banlist copier(UPDATE!!)

By XpLoiTeR on Jan 20, 2006

banlist copier is lil code allowing u to copy a banlist from chan to chan. ex: /copyban #channel1 #channel2 <- that wll read all the bans in #channel1 and bans it in #channel2 .. handy for channel owners
note: in my network the most number of bans at the same time is 12 ( +bbbbbbbbbbbb) so i added this line to maximize the banlist to 24 ban pertime if the user has more than 24 ban the command can be repeated..
if anyone has suggestion i will be glad to hear it

alias copyban {
  if ($1 ischan) && ($2 ischan) {
    if ($me isop $2) || ($me ishop $2) {
      mode $1 +b
      var %x $ibl($1,0)
      var %y 0
      while (%y <= %x) {
        var %banlist = $(%banlist,$ibl($1,%y))
        inc %y
      }
      mode $2 $+(+,$str(b,$ibl($1,0))) %banlist
      if ($ibl($1,0) > 12) { mode $2 $+(+,$str(b,$ibl($1,0))) %banlist }
    }
else { echo -a ur not op on $2 }
  }
else { echo -a ur not on the channels }
}

Comments

Sign in to comment.
noMen   -  Jan 22, 2006

btw this snippet is a nice idea! usefull

 Respond  
noMen   -  Jan 22, 2006

ehmmm ... I think: var %banlist = %banlist $ibl($1,%y)
otherwise you get one giant address or is mode # +bbbbbbbbbbbb xxx!yyy@zzzxxx!yyy@zzzxxx!yyy@zzzxxx!yyy@zzzxxx!yyy@zzzxxx!yyy@zzzxxx!yyy@zzzxxx!yyy@zzzxxx!yyy@zzzxxx!yyy@zzzxxx!yyy@zzzxxx!yyy@zzz able to parse it?

 Respond  
Yoinx   -  Jan 22, 2006

i think the line
var %banlist = $(%banlist,$ibl($1,%y))
is supposed to be
var %banlist = $+(%banlist,$ibl($1,%y))

 Respond  
noMen   -  Jan 22, 2006

Strange, I get %banlist!@ in the ibl of the second channel??????

 Respond  
xDaeMoN   -  Jan 22, 2006

Use $modespl to check how many modes are allowed that you can set at a time on your network/server.

See .help $modespl

 Respond  
XpLoiTeR   -  Jan 20, 2006

$true ;D

 Respond  
KuTsuM   -  Jan 20, 2006

You can also save time by using the var command only once:
/var %x = 1,%y = $ibl($1,0)

 Respond  
XpLoiTeR   -  Jan 20, 2006

corne no u didnt get it..lol i was acting like n idiot and trying to get the total number of banlist of a channel which has not bans :S:S i think am drunk :D anyway its ok now ..workin!

 Respond  
XpLoiTeR   -  Jan 20, 2006

for channels $active may include pvts,status window ... anyway its removed :D $ibl($1,0) faster n much better

 Respond  
Corne   -  Jan 20, 2006

Maybe your banlist is not updated. Try: /mode #channel -b to updated it and $chan(#).ibl will return $true if its updated and false if its not.

 Respond  
tank59   -  Jan 20, 2006

Works for me...
Try replacing # with $active.

 Respond  
XpLoiTeR   -  Jan 20, 2006

ooh...i missed sth..ur rite forgive me....updated!

 Respond  
XpLoiTeR   -  Jan 20, 2006

nope....it wont work...try it //echo -a $ibl(#,0) wont get the total bans of the channel...try it..its not workin here

 Respond  
KuTsuM   -  Jan 20, 2006

First while loop is useless. In the time it takes to get the value into the var %x, you could have just used var %y = 1,%x = $ibl($1,0) to get the same value.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.