/BANSYNC Channel Ban Synchronization

By FollowTheSchism on Feb 01, 2012

Syntax: /BANSYNC #your-channel #target-channel

I figured this command could be somewhat useful, though I know this script could be made in a better way (I might get around to updating it). Basically, you can synchronize your channel banlist with the banlist of another channel, making it easy for you to keep out known "bad eggs."

Synchronizing the banlist of #SimplicityX to the banlist of #Staff.
2:06:24 am | Simplicity sets mode: +bbbbbbbbbbbb test!testing@testing01 test!testing@testing02 test!testing@testing03 test!testing@testing04 test!testing@testing05 test!testing@testing06 test!testing@testing07 test!testing@testing08 test!testing@testing09 test!testing@testing10 test!testing@testing11 test!testing@testing12
2:06:24 am |
Simplicity sets mode: +bbbbbbbbbbbb test!testing@testing13 test!testing@testing14 test!testing@testing15 test!testing@testing16 test!testing@testing17 test!testing@testing18 test!testing@testing19 test!testing@testing20 test!testing@testing21 test!testing@testing22 test!testing@testing23 test!testing@testing24
2:06:25 am | * Simplicity sets mode: +bbbbbbbbbbbb test!testing@testing25 test!testing@testing26 test!testing@testing27 test!testing@testing28 test!testing@testing29 test!testing@testing30 test!testing@testing31 test!testing@testing32 test!testing@testing33 test!testing@testing34 test!testing@testing35 test!testing@testing36

Edit [February 1st, 2012] -- Had fun looking at Shinu's mass voice script to accommodate a comment.

alias bansync {
  echo -a Synchronizing the banlist of $1 to the banlist of $+($2,.)
  var %x $ibl($2,0)
  while %x {
    var %y $addtok(%y,$ibl($2,%x),32)
    if $numtok(%y,32) == $modespl { mode $1 + $+ $str(b,$modespl) %y | var %y $null }
    dec %x
  }
  if %y { mode $1 + $+ $str(b,$modespl) %y }
}

Comments

Sign in to comment.
FollowTheSchism   -  Feb 06, 2012

@KinKinnyKith -- Thank you for the compliment. I haven't tested your script response yet, but from a glance it looks like it works well.

@Frine -- No problem. I accept script requests, so if you have anything you'd like me to try my hand at, shoot me a PM.

 Respond  
KinKinnyKith   -  Feb 04, 2012

Nice 8)

Sharing a modification that was requested to handle the case where the ban list is not populated for the source channel, and also bot trigger:

on *:text:!bansync*:#: { if (($nick isop $chan) || ($nick ishop $chan)) { bansync $2 $$3 } }
alias bansync {
  if (($me !isop $1) && ($me !ishop $1)) { echo -a Not an operator on $1 | return }
  if ($me !ison $$2) { echo -a Not on channel $2 | return }
  echo -a Synchronizing the banlist of $1 to the banlist of $+($2,.)
  if (!$chan($2).ibl) { set -e %BanSync $1 $2 | .enable #BanSync | .timerBanSyncTimeout 1 8 modesync $1 $2 timeout | mode $2 +b }
  else { modesync $1 $2 }
}
#BanSync off
raw 368:*: { .timerBanSyncTimeout off | .disable #BanSync | if (%BanSync) { modesync %BanSync | unset %BanSync } }
#BanSync end
alias -l modesync {
  if ($3) { .disable #BanSync }
  var %x $ibl($2,0)
  while %x {
    var %y $addtok(%y,$ibl($2,%x),32)
    if $numtok(%y,32) == $modespl { mode $1 + $+ $str(b,$modespl) %y | var %y $null }
    dec %x
  }
  if %y { mode $1 + $+ $str(b,$modespl) %y }
}
 Respond  
Frine   -  Feb 03, 2012

thank you..

 Respond  
FollowTheSchism   -  Feb 01, 2012

@jaytea -- So have $1 sync to $2 and $2 sync to $1? Or have it unset bans in $1 that match bans in $2? Both seem plausible and very possible. Explain more if I'm mistaken, please; it's 2:31 AM here. :)

 Respond  
jaytea   -  Feb 01, 2012

good idea! how about the reverse process if it's possible that $1 is also a source of bans?

 Respond  
FollowTheSchism   -  Feb 01, 2012

@Savage_CL -- There you go.

 Respond  
Savage_CL   -  Feb 01, 2012

I suggest you make use of $ibl and $modespl

 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.