Blacklist (With Manager)

By Gummo on Sep 07, 2007

This script is the first time I used dialogs in a script. It checks when users join and when they change nicks, using ONLY the userlevels list, to make it faster.

I initially had just an 'add' dialog for simplicity, but then I decided to expand it into a blacklist manager where you can click on a blacklist in the left panel and edit it instantly in the right panel, with multiple delete functions and the ability to choose whether or not to search all rooms for matches upon closing.

The intention of this script was to create a blacklist script unlike others (I haven't seen them all, so I can't say it has never been done like this before). I was not inclined to post this one, but I decided to put it up for you all anyway. :)

Also, the save button won't appear unless both boxes are filled and the banmask matches !@* but doesn't equal it.

You can use /blist or the right-click menu to open the dialog.

Put this in your remotes (alt+r) in a new file (File->New).

I personally like this blacklist, and hope you do too. :)

--- All credit goes to Gummo ---

UPDATES!
16/10/07: - Added option to auto-unban after 12 hours.

  • Fixed bug where script would accept !@ as a mask, as it matches !@*.
  • Fixed bug which allowed you to make the blacklist reason a bunch of spaces (Needs one non-space character).
  • Fixed bug which prevented deletion of a blacklist entry if the mask had been modified.
    2/11/07: - Changed function keys to just a right-click menu on request.
dialog -l blist {
  title "Blacklist Manager - Made by Gummo"
  size -1 -1 324 144
  option dbu
  check "&Enable Blacklist", 1, 8 8 52 10
  list 2, 8 24 161 109, size extsel
  box "Blacklist Info", 3, 176 8 141 113
  text "Banmask:", 4, 184 20 25 8
  edit "", 5, 184 31 125 10, autohs
  text "Reason for Blacklist:", 6, 184 48 50 8
  edit "", 7, 184 60 125 10, autohs
  text "Date Added/Modified:", 8, 184 76 55 8
  edit "", 9, 184 88 125 10, read
  button "&New", 10, 184 104 37 12
  button "&Save", 11, 228 104 37 12
  button "&Delete", 12, 272 104 37 12
  check "Chec&k on Close", 13, 188 128 50 10
  button "&Close", 14, 244 128 37 12, ok
  check "Auto-Unban After 12 Hours", 15, 92 8 75 10
}

on *:dialog:blist:init:0: {
  if ($group(#blist) == on) {
    did -c blist 1
    did -e blist 15
  }
  if ($group(#blist) != on) {
    did -u blist 1
    did -b blist 15
  }
  did -u blist 13
  did -r blist 2,5,7,9
  did -b blist 5,7,9,11,12
  if ($group(#blist.unban) == on) did -c blist 15
  if ($group(#blist.unban) != on) did -u blist 15
  var %c 1
  while (%c <= $ulist(*,blist,0)) {
    did -a blist 2 $ulist(*,blist,%c)
    inc %c
  }
  did -f blist 2
}

on *:dialog:blist:sclick:1: {
  if ($did(blist,1).state != 1) did -b blist 15
  if ($did(blist,1).state == 1) did -e blist 15
}

on *:dialog:blist:sclick:2: {
  did -e blist 10,12
  if ($did(blist,2,0).sel == 1) {
    did -e blist 5,7,9
    did -b blist 11
    set %blist.num $did(blist,2,1).sel
    did -ra blist 5 $ulist(*,blist,%blist.num)
    did -ra blist 7 $gettok($ulist(*,blist,%blist.num).info,6-,32)
    did -ra blist 9 $gettok($ulist(*,blist,%blist.num).info,1-5,32)
  }
  if ($did(blist,2,0).sel > 1) {
    unset %blist.num
    did -rb blist 5,7,9
  }
}

on *:dialog:blist:edit:5,7: {
  did -ra blist 9 $asctime
  if (!$regex($did(blist,5).text,/^\S+!\S+@\S+/Si)) || (!$regex($did(blist,7).text,/^.*\S.*$/Si)) || (*!*@* == $did(blist,5).text) did -b blist 11
  if ($regex($did(blist,5).text,/^\S+!\S+@\S+/Si)) && ($regex($did(blist,7).text,/^.*\S.*$/Si)) && (*!*@* != $did(blist,5).text) did -e blist 11
}

on *:dialog:blist:sclick:10: {
  unset %blist.num
  did -re blist 5,7,9
  did -b blist 11,12
  did -f blist 5
}

on *:dialog:blist:sclick:11: {
  if (%blist.num) .ruser blist $ulist(*,blist,%blist.num)
  .auser -a blist $gettok($did(blist,5).text,1,32) $asctime $did(blist,7).text
  did -r blist 2,5,7,9
  did -b blist 5,7,9,11,12
  did -c blist 13
  var %c 1
  while (%c <= $ulist(*,blist,0)) {
    did -a blist 2 $ulist(*,blist,%c)
    inc %c
  }
  did -f blist 14
}

on *:dialog:blist:sclick:12: {
  if ($did(blist,2,0).sel == 1) {
    .ruser blist $ulist(*,blist,%blist.num)
    did -f blist 2
  }
  if ($did(blist,2,0).sel > 1) {
    var %b 1
    while ($did(blist,2,%b).sel) {
      .ruser blist $did(blist,2,$did(blist,2,%b).sel).text
      inc %b
    }
  }
  did -r blist 2,5,7,9
  did -b blist 5,7,9,11,12
  var %c 1
  while ($ulist(*,blist,%c)) {
    did -a blist 2 $ulist(*,blist,%c)
    inc %c
  }
}

on *:dialog:blist:close:0: {
  unset %blist.num
  .timerblistsmiley off
  if ($did(blist,1).state != 1) .disable #blist
  if ($did(blist,1).state == 1) .enable #blist
  if ($did(blist,15).state != 1) .disable #blist.unban
  if ($did(blist,15).state == 1) .enable #blist.unban
  if ($did(blist,13).state == 1) && ($group(#blist) == on) blkick
}

menu * {
-
Modify Blacklist:blist
-
}

alias -l blist {
  unset %blist.num
  dialog -amo blist blist
}

alias -l blist.unban {
  if ($group(#blist.unban) == on) return -u43200
}

#blist.unban on
; Do not remove this group. It serves as a permanent variable.
#blist.unban end

#blist on
alias blkick {
  var %a 1
  while ($chan(%a)) {
    var %c 1
    while ($ulist(*,blist,%c)) {
      var %b 1
      while ($ialchan($ulist(*,blist,%c),$chan(%a),%b).nick) {
        if ($ialchan($ulist(*,blist,%c),$chan(%a),%b).nick != $me) {
          ban $blist.unban $chan(%a) $ulist(*,blist,%c)
          kick $chan(%a) $ialchan($ulist(*,blist,%c),$chan(%a),%b).nick Blacklisted - $gettok($ulist(*,blist,%c).info,6-,32)
        }
        inc %b
      }
      inc %c
    }
    inc %a
  }
}

on blist:join:#: {
  if ($ulist($fulladdress,blist)) {
    ban $blist.unban $chan $ulist($fulladdress,blist,1)
    kick $chan $nick Blacklisted - $gettok($ulist($fulladdress,blist,1).info,6-,32)
  }
}

on *:nick: {
  if ($newnick != $me) && ($ulist($ial($newnick,1),blist)) {
    var %a 1
    while ($comchan($newnick,%a)) {
      ban $blist.unban $comchan($newnick,%a) $ulist($ial($newnick,1),blist,1)
      kick $comchan($newnick,%a) $newnick Blacklisted - $gettok($ulist($ial($newnick,1),blist,1).info,6-,32)
      inc %a
    }
  }
}
#blist end

Comments

Sign in to comment.
JoKabua   -  Feb 22, 2012

I like this script but is anyway u can edit certain channels on it? Example I want to add this script on my channel and 3 more channels. I want this script work on the channel i add on this..

 Respond  
Abtehi   -  Jan 20, 2009

Can you make this to work on single channel other than globally?

 Respond  
Smoke*bud   -  Oct 28, 2008

would you be able to add /blacklist command to the script so you dont have to open the dialog everytime :P, and maybe add a part, so you can pick if you want it to take effect on all channels or just one or two.

 Respond  
xFireWallx   -  May 10, 2008

ohhh .. mistake ... I use Gummo`s ShitList ;)

 Respond  
xFireWallx   -  May 10, 2008

Well done Gummo, I use your ShitList ;)

 Respond  
Gummo   -  Mar 18, 2008

I didn\'t believe it was such a crucial factor.. Why are you blacklisting so often that it annoys you that you must use a /whois, anyway?

 Respond  
Eugenio   -  Mar 03, 2008

and actually i cant even get the banmask from /whois ! this is making me angry now. 2/10

 Respond  
Eugenio   -  Mar 03, 2008

isnt there a way to just ban the nick ?!? i cant stand having to look at /whois to find the banmask ?!? and also why cant i click on a user in the nick list and add them to the list that way ?!? 4/10

 Respond  
Gummo   -  Feb 27, 2008

Are you sure? It must match !@* and have a reason to save.

 Respond  
Manit   -  Feb 26, 2008

Some thing wrong with this blacklist code i cant save the host in it

 Respond  
Gummo   -  Dec 23, 2007

..What?

 Respond  
Flexi   -  Dec 11, 2007

IF check enabled when closed there would be spam.

 Respond  
Joshuaxiong1   -  Nov 25, 2007

Did you update it?

 Respond  
Gummo   -  Oct 18, 2007

Alright, when I update this I\'ll include a menu. I found it easier to use f7 as I decide what buttons are for what, but I\'ll change that so you can choose whether or not to enable them. Also, there already is a checkbox in the dialog for turning it on/off.

On a side note, this site doesn\'t seem to appreciate the backslashes used in my regex.. It only works with them some of the time.

 Respond  
Scakk   -  Oct 18, 2007

Perhaps have it have a Menu option to open it as oppossed to the f7 key. Also have a button or somthing in th dialog itself to turn it on and off instead of using cf7. I have to disable what I have there now in order to use this.

Just an option I thought about at 4 am ^_^

 Respond  
Gummo   -  Oct 18, 2007

While hiding the list would temporarily make the dialog more aesthetically pleasing, it would make it less practical, as you\'d have to enable the list to see the entries.

 Respond  
Scakk   -  Oct 18, 2007

The only asthetic thing I cna thin of is it is a little wide. Perhaps have buttons that make it change shape when you choose to view the black list. Ex: Click button \" View List \" and the dialog changes shape to show the list. Then click a button \" Close List \" and the dialog goes back to the original shape.

 Respond  
Akishoot   -  Oct 18, 2007

Sounds good. :) I don\'t have any other suggestions quite yet, seeing as it\'s about 3:00 a.m. and I\'m falling asleep on my keyboard... I\'ll try again tomorrow. =)

-Akishoot

 Respond  
Gummo   -  Oct 18, 2007

There is one other option I could think of, if you people whink it\'s a good idea to be able to use wildcard searches in each editbox to filter blacklists so that you can modify them more easily..

 Respond  
Akishoot   -  Oct 17, 2007

As I suggested in the PM, the customizable auto-unban times would be neat. I\'m just posting this on here because I have nothing else to do. =)

-Akishoot

 Respond  
Gummo   -  Oct 17, 2007

Ok. I\'ll wait for input on the other ideas first, then I\'ll have to redo the whole script. :P

 Respond  
Scakk   -  Oct 17, 2007

Very true. I will await the ban per channel version :)

 Respond  
Gummo   -  Oct 17, 2007

While that\'s true, the owner of the room may actually want that person to stay, removing your access because the blacklist kicks them and then replacing theirs.

That would be where the exlusion of rooms would be handy for individual bans. ;)

Also, if they\'re being a pain your could remove their access manually. Many servers don\'t have chanserv.

 Respond  
Scakk   -  Oct 17, 2007

I suggested that because a person who has Ops in the channel can decide to be a real pain and will not listen to others when asked and or told to stop. If he has access to the channel then the kick/ban is worthless as he could just come back in.

 Respond  
Gummo   -  Oct 17, 2007

I\'m not sure people would appreciate that.. Your access would probably be removed and theirs replaced.

 Respond  
Scakk   -  Oct 17, 2007

Perhaps have it where if the person is on the access list it will remove them when it kick/bans them.

 Respond  
Gummo   -  Oct 17, 2007

I would really like to know what would make this better.. Customisable auto-unban times? Include/exclude channels for all blacklists? Include/exclude channels for individual blacklists instead? Wildcards protected from the blacklist?

 Respond  
Anti   -  Oct 16, 2007

haha sweet never used dialogs in a long time great job!~

 Respond  
Joshuaxiong1   -  Oct 08, 2007

This is the best blacklist I have found. Great!

 Respond  
ZiX   -  Sep 17, 2007

Nice :D
it works great ..

 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.