showing ban/unban affect

Paste Your small code(s) here, ex. small aliases, identifiers

showing ban/unban affect

Postby vodkaplayer » Thu Jul 17, 2008 6:18 pm

tested on mIRC 6.31
this script require at least that the $chan(#).ial return $true
else looping $ialchan() won't work...

[20:17] --> MODE: (VodkaPlayer) set modes: (+bbb *!*@172.21.195-77.rev.gaoland.net *!*@quakenet.org *!*@go.moo.oh.yes.they.do)
[20:17] this (*!*@172.21.195-77.rev.gaoland.net) ban affect 4 nicks (+ROBOT-2 +ROBOT-3 ROBOT-4 |bowser|).
[20:17] this (*!*@quakenet.org) ban affect 2 nicks (triviabot wowbot).
[20:17] this (*!*@go.moo.oh.yes.they.do) ban affect 1 nicks (fishbot).



this code use on rawmode event instead of using on ban or unban events
the rawmode event trigger only one time for example when using
/mode # +bbb banmask banmask2 banmask3
where the on ban event will trigger 3 times
it's the point...

the alias in order
-ban.nicks
set the max number of nicks that may be affect by a ban (20 is fine)
-show.ban
set 1 to show all nicks being affected by the banmask affect 1/0
-show.unban
set 1 to show all nicks wich are no longer banned when a banmask is removed 1/0
Code: Select all
alias -l ban.nicks { return 20 }
alias -l show.ban { return 1 }
alias -l show.unban { return 1 }

on ^*:RAWMODE:#: {
  echo -t # --> MODE: ( $+ $nick $+ ) set modes: ( $+ $1- $+ )
  if ($mode(0).ban) && ($show.ban == 1) {
    var %i = 1, %b, %a
    while ($mode(%i).ban) {
      var %x = 1, %b = $v1
      while ($ialchan(%b,$chan,%x).pnick) {
        var %a = $addtok(%a,$v1,32) 
        if ($numtok(%a,32) >= $ban.nicks) { var %a = $+(%a,...) | break }
        inc %x
      }
      if (%a) { echo -t # this ( $+ %b $+ ) ban affect $numtok(%a,32) nicks ( $+ $sorttok(%a,32,c) $+ ). }
      var %a | inc %i
    }
  }
  if ($mode(0).unban) && ($show.unban == 1) {
    var %i = 1, %b, %a
    while ($mode(%i).unban) {
      var %x = 1, %b = $v1
      while ($ialchan(%b,$chan,%x).pnick) {
        var %a = $addtok(%a,$v1,32)
        if ($numtok(%a,32) >= $ban.nicks) { var %a = $+(%a,...) | break }
        inc %x
      }
      if (%a) { echo -t # this ( $+ %b $+ ) unban affect $numtok(%a,32) nicks ( $+ $sorttok(%a,32,c) $+ ). }
      var %a | inc %i
    }
  }
  halt
}
vodkaplayer
 

Return to Mirc Scripting Snippets

Who is online

Users browsing this forum: No registered users and 1 guest

cron