blackvenomm666 commented on a Page, Blacklist  -  Dec 06, 2010

simple edit turned it into a dialog.
added a version checker since chatspace/ircd/unreal use different identifiers for the hostmask 1/2/3 i had it check the version and set the identifier accordingly for the type of site it is being opened on

Image

on @1:JOIN:#:{
  var %z = 1
  while ($read(Blacklist.txt,%z)) {
    if ($address($nick,1) == $read(Blacklist.txt,%z)) {
      mode $chan +b $address($nick,%banmask)
      kick $chan $nick 07B14lacklisted
      halt
    }
    else {
      inc %z
    }
  }
}
Menu Menubar,Nicklist,Channel {
  Blacklist.System
  .Blacklist.System: dialog $iif($dialog(Blacklist.System),-v,-md Blacklist.System) Blacklist.System
}
Dialog Blacklist.System {
  Title "Blacklistsystem"
  Size -1 -1 110 177
  Option dbu
  text "blacklisted", 1, 02 0 100 8
  list 2, 02 10 50 100, hsbar vsbar
  text "Nicks", 3, 56 0 100 8
  list 4, 55 10 50 100, hsbar vsbar
  Button "Blacklist" 5, 02 106 30 15, flat
  Button "DeBlacklist" 6, 32 106 30 15, flat
  Button "ClearBlist" 7, 62 106 30 15, flat
  Button "Purge" 8, 02 126 30 15, flat
}
on *:dialog:Blacklist.System:init:*:{
  nickzz
  blacklistednicks
  checkversion
} 
on *:dialog:Blacklist.System:*:*:{ 
  if ($devent == sclick) {
    if ($did == 5) {
      if (!$did(4).sel) { noop $input(please select a nick from the nick list to add to the blacklist) } | else {  
        .set %knick $did(4).seltext
        write Blacklist.txt $address($did(4).seltext,%banmask)
        mode $active +b $address($did(4).seltext,%banmask)
        kick $active %knick 07B14lacklisted
        echo -at 07Added14 $address($did(4).seltext,%banmask) 07to blacklist.
        did -r blacklist.system 2
        .timer 1 1 blacklistednicks
      }
    }
    if ($did == 6) {
      if (!$did(2).sel) { noop $input(please select a a blacklisted ip from blacklisted list to remove from blacklist) } | else {  
        write -d Blacklist.txt $did(2).seltext
        echo -at 07Deleted14 $did(2).seltext 07from blacklist.
        did -r blacklist.system 2
        .timer 1 1 blacklistednicks
      }
    }
    if ($did == 7) {
      write -c Blacklist.txt
      echo -at 07Cleared blacklist.
      did -r blacklist.system 2
      .timer 1 1 blacklistednicks
    }
    if ($did == 8) {
      purge
    }
  }
}
alias  nickzz {
  var -s %curr 1, %nick $nick($active,0)
  did -r Blacklist.System 4
  while (%curr <= %nick) { 
    did -az Blacklist.System 4 $nick($active,%curr)
    inc %curr
  }
}
alias blacklistednicks {
  var %a = 1, %b = $lines(Blacklist.txt)
  while (%a <= %b) {
    did -az blacklist.system 2 $read(Blacklist.txt, %a)
    inc %a
  }
}
alias -l purge {
  var %x = 1
  while ($nick($active,%x)) {
    var %z = 1
    while ($read(Blacklist.txt,%z)) {
      if ($address($nick($active,%x),1) == $read(Blacklist.txt,%z)) {
        mode $active +b $address($nick($active,%x),1)
        kick $active $nick($active,%x) 07B14lacklisted
        inc %z
      }
      else {
        inc %z
      }
    }
    inc %x
  }
}

alias  checkversion {
  version
}
Raw 351 :*: { if ($dialog(Blacklist.System)) {
    if (Unreal isin $$1- ) {
      .set %banmask 1
    }
    elseif (ircd isin $$1- ) {
      .set %banmask 2
    }       
    elseif (cs isin $$1- ) {
      .set %banmask 3
    }
  }
}
 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.