Another Blacklist

By Akishoot on May 03, 2008

How to use: Right-click a user on the nicklist or add a user manually via the dialog.
[size=10](To open the dialog, right-click on any channel or select it on your menubar.)[/size]

Updates

  • Versions 2.20b-2.22b:
  • Multiple small bugs have been resolved.
  • The previous kick message will now be displayed when going to edit a blacklist reason.
  • When an entry in the log-viewer is double-clicked, it will be copied to your clipboard.
  • Versions 2.23b-2.25b:
  • Added a Windows Version button to the 'Logs' tab.
  • When an entry is clicked on in the list, it will only display the first 5 words of the reason followed by '...'.
  • If you are not an operator and a user you have blacklisted joins, it will be logged.
  • Versions 2.26b-2.29b:
  • Edited the button configuration a bit.
  • Condensed the blacklist dialog a little bit.
  • Added a Delete button to the 'Logs' tab.
  • Added a Load Logs On Open check on the 'Logs' tab.
  • Version 2.30b & 2.31:
  • Fixed a few problems regarding the buttons on the 'Logs' tab.
  • Added a Kick From All Common Channels check to the 'Entries' tab.
    Preview:
    Image
    Image

First Submitted Version: 2.19b
Current Version: 2.31b

Last Updated: 9/13/08

Comments are welcome!

;##### MENUS
menu menubar,channel { 
  Blacklist v2.31b
  .Open:{ 
    if ($dialog(black) == $null) { 
      .dialog -mod black black black
    }
  }
  .Logs
  ..View(Windowed):{ .openblacklistlog }
  ..Clear:{ .remove -b Blacklist.log }
}
menu nicklist {
  $iif($me !isop $chan,$style(2) Blacklist User,Blacklist User):{
    if ($$1 != $null) {
      .set -u5 %r $$?="Reason:"
      .write Blacklist.blklist %r $+ $chr(35) $+ $address($$1,2) $+ $chr(35) $+ $asctime(h:nn:ss TT) $+ $chr(35) $+ $asctime(dddd $+ $chr(44) mmmm d $+ $chr(44) yyyy) $+ $chr(35)
      if ($group(#KickAllCommon) == on) { .kickallcommon $$1 }
      elseif ($group(#KickAllCommon) == off) { .mode $chan +bb $$1 $address($$1,2) | .kick $chan $$1 %r • Blacklisted }
      .write Blacklist.log $asctime(dddd $+ $chr(44) mmmm d $+ $chr(44) yyyy) $chr(124) $asctime(h:nn:ss TT) $chr(124) $$1 ( $+ $address($$1,2) $+ ) was blacklisted in $chan $+ . 
    }
  }
}
;##### EXTRAS
#LoadBlacklistLog on
#LoadBlacklistLog End
#KickAllCommon on
#KickAllCommon End
;##### ALIASES
alias kickallcommon {
  .var %x = 1
  while (%x <= $comchan($1,0)) {
    if ($me isop $comchan($1,%x)) { 
      .mode $comchan($1,%x) +bb $1 $address($1,2) 
      .kick $comchan($1,%x) $1 %r • Blacklisted
      .write Blacklist.log $asctime(dddd $+ $chr(44) mmmm d $+ $chr(44) yyyy) $chr(124) $asctime(h:nn:ss TT) $chr(124) $$1 ( $+ $address($1,2) $+ ) was blacklisted in $comchan($1,%x) $+ .  
    }   
    .inc %x
  }
}
alias refreshlogs {
  .did -r black 22
  if ($exists(Blacklist.log) == $true) {
    .var %x = 1
    while (%x <= $lines(Blacklist.log)) {
      .did -a black 22 $read(Blacklist.log,%x)
      .inc %x
    }
  }
  if ($did(black,22).lines > 0) { .did -e black 23 }
}
alias openblacklistlog {
  .window -mkz @Blacklist
  if ($exists(Blacklist.log) == $true) {
    .var %x = 1
    .echo @Blacklist -
    while (%x <= $lines(Blacklist.log)) {
      .echo @Blacklist $read(Blacklist.log,%x)
      .inc %x
    }
  }
}    
;##### MAIN DIALOG
dialog black {
  title "Blacklist v2.31b"
  size -1 -1 582 199
  option pixels
  tab "Entries", 20, -3 1 589 206
  tab "Logs", 21
  list 1, 12 51 285 119, tab 20 size
  box "Blacklist Entry Information:", 2, 306 33 269 80, tab 20
  text "Date Added:", 3, 317 53 63 17, tab 20
  text "Time Added:", 4, 317 69 63 17, tab 20
  text "Reason:", 5, 317 85 44 17, tab 20
  text "N/A", 6, 361 85 202 17, tab 20
  text "N/A", 7, 380 69 183 17, tab 20
  text "N/A", 8, 380 53 183 17, tab 20
  box "Blacklisted Addresses:", 9, 7 34 295 158, tab 20
  button "Add New", 10, 317 136 60 19, tab 20
  button "Delete", 11, 317 161 60 20, tab 20 disable
  button "Edit", 12, 395 136 59 19, tab 20 disable
  button "Clear", 13, 395 161 59 20, tab 20 disable
  box "Commands:", 14, 307 115 158 77, tab 20
  radio "On", 16, 481 134 39 17, tab 20
  radio "Off", 17, 523 134 40 17, tab 20
  box "Status:", 18, 473 116 97 43, tab 20
  button "Exit", 19, 476 165 95 24, tab 20 ok
  list 22, 6 32 570 135, tab 21 size
  button "Clear", 23, 159 171 65 22, tab 21 disable
  button "Close", 24, 509 172 65 21, tab 21 cancel
  button "Refresh", 25, 17 171 65 22, tab 21
  button "Window Version", 27, 229 171 90 22, tab 21
  button "Delete", 28, 88 171 65 22, tab 21 disable
  check "Load When Opened", 29, 329 173 119 17, tab 21
  text "Blacklist v2.31b", 15, 496 4 78 15, tab 21 disable
  text "Blacklist v2.31b", 26, 496 4 78 15, tab 20 disable
  check "Kick From All Common Channels", 30, 15 171 177 17, tab 20
}
on *:dialog:black:sclick:30:{
  if ($group(#KickAllCommon) == on) { .disable #KickAllCommon }
  elseif ($group(#KickAllCommon) == off) { .enable #KickAllCommon }
}
on *:dialog:black:init:0:{
  if ($group(#Blklist) == on) { .did -c black 16 }
  if ($group(#Blklist) == off) { .did -c black 17 }
  if ($group(#KickAllCommon) == on) { .did -c black 30 }
  if ($read(Blacklist.blklist,1) != $null) { .did -e black 13 }
  if ($exists(Blacklist.blklist) == $true) {
    if ($read(Blacklist.blklist,1) != $null) {
      var %x = 1
      while (%x <= $lines(Blacklist.blklist)) {
        .did -a black 1 $gettok($read(Blacklist.blklist,%x),2,35)
        .inc %x
      }
    }
  }
  if ($group(#LoadBlacklistLog) == on) {
    .did -c black 29
    if ($exists(Blacklist.log) == $true) {
      .var %x = 1
      while (%x <= $lines(Blacklist.log)) {
        .did -a black 22 $read(Blacklist.log,%x)
        .inc %x
      }
    }
  }
  if ($did(black,22).lines > 0) { .did -e black 23 }
}
on *:dialog:black:sclick:1:{
  if ($did(black,1).seltext != $null) {
    .did -e black 11
    .did -e black 12
    .did -ar black 7 $gettok($read(Blacklist.blklist,$did(black,1).sel),3,35)
    .did -ar black 8 $gettok($read(Blacklist.blklist,$did(black,1).sel),4,35)
    if ($numtok($gettok($read(Blacklist.blklist,$did(black,1).sel),1,35),32) > 5) { .did -ar black 6 $gettok($gettok($read(Blacklist.blklist,$did(black,1).sel),1,35),1-5,32) $+ ... }
    elseif ($numtok($gettok($read(Blacklist.blklist,$did(black,1).sel),1,35),32) <= 5) { .did -ar black 6 $gettok($read(Blacklist.blklist,$did(black,1).sel),1,35) } 
  }
}
on *:dialog:black:sclick:10:{
  .dialog -mod addnew addnew 
}
on *:dialog:black:sclick:11:{
  if ($did(black,1).sel != $null) { 
    .write -dl $+ $did(black,1).sel Blacklist.blklist
    .did -ar black 6-8 N/A
    .did -d black 1 $did(black,1).sel
    .did -b black 11,12
  }
}
on *:dialog:black:sclick:12:{
  .dialog -mod editblk editblk
}
on *:dialog:black:sclick:13:{
  if ($exists(Blacklist.blklist) == $true) { .remove -b Blacklist.blklist | .did -r black 1 | .did -b black 11-13 | .did -ar black 6-8 N/A | .write Blacklist.log $asctime(dddd $+ $chr(44) mmmm d $+ $chr(44) yyyy) $chr(124) $asctime(h:nn:ss TT) $chr(124) Blacklist cleared. }
  else { .halt }
}
on *:dialog:black:sclick:16:{
  if ($group(#Blklist) == off) { .enable #Blklist | .write Blacklist.log $asctime(dddd $+ $chr(44) mmmm d $+ $chr(44) yyyy) $chr(124) $asctime(h:nn:ss TT) $chr(124) Blacklist was enabled. }
  elseif ($group(#Blklist) == on) { .halt }
}
on *:dialog:black:sclick:17:{
  if ($group(#Blklist) == on) { .disable #Blklist | .write Blacklist.log $asctime(dddd $+ $chr(44) mmmm d $+ $chr(44) yyyy) $chr(124) $asctime(h:nn:ss TT) $chr(124) Blacklist was disabled. }
  elseif ($group(#Blklist) == off) { .halt }
}
on *:dialog:black:sclick:22:{
  if ($did(black,28).enabled == $false) {
    if ($did(black,22).seltext != $null) {
      .did -e black 28
    }
  }
}
on *:dialog:black:dclick:22:{ .clipboard $did(black,22).seltext }
on *:dialog:black:sclick:23:{ .did -r black 22 | .remove -b Blacklist.log | .did -b black 23 }
on *:dialog:black:sclick:25:{ .refreshlogs }
on *:dialog:black:sclick:27:{ .openblacklistlog }
on *:dialog:black:sclick:28:{
  if ($did(black,22).sel != $null) {
    .write -dl $+ $did(black,22).sel Blacklist.log
    .did -d black 22 $did(black,22).sel
    .did -b black 28
    if ($did(black,22).lines == 0) { .did -b black 23 }
  }
}
on *:dialog:black:sclick:29:{
  if ($group(#LoadBlacklistLog) == off) { .enable #LoadBlacklistLog }
  elseif ($group(#LoadBlacklistLog) == on) { .disable #LoadBlacklistLog }
}
;##### ADD DIALOG
dialog addnew {
  title "Blacklist v2.31b | Add New Entry"
  size -1 -1 356 105
  option pixels
  text "Username/Address:", 1, 15 18 100 16
  text "Reason:", 2, 15 42 45 16
  edit "Undefined", 3, 62 40 277 20
  edit "*!*", 4, 115 16 224 20
  box "", 5, 8 2 338 65
  button "Add", 6, 110 74 56 23, disable ok
  button "Cancel", 7, 182 74 56 23, cancel
}
on *:dialog:addnew:edit:3:{
  if ($did(addnew,4).edited == $true) { .did -e addnew 6 }
  if ($did(addnew,3).text == $null) { .did -b addnew 6 }
}
on *:dialog:addnew:edit:4:{
  if ($did(addnew,3).edited == $true) { .did -e addnew 6 }
  if ($did(addnew,4).text == $null) { .did -b addnew 6 }
}
on *:dialog:addnew:sclick:6:{
  if ($did(addnew,3).text != $null) {
    if ($did(addnew,3).edited == $true) && ($did(addnew,4).edited == $true) {
      .write Blacklist.blklist $did(addnew,3).text $+ $chr(35) $+ $did(addnew,4).text $+ $chr(35) $+ $asctime(h:nn:ss TT) $+ $chr(35) $+ $asctime(dddd $+ $chr(44) mmmm d $+ $chr(44) yyyy) $+ $chr(35)
      .did -a black 1 $gettok($read(Blacklist.blklist,$lines(Blacklist.blklist)),2,35)
      if ($did(black,13).enabled == $false) { .did -e black 13 }
    }
  }
}
;##### EDIT DIALOG
dialog editblk {
  title "Blacklist v2.31b | Edit Entry"
  size -1 -1 327 115
  option pixels
  text "Reason:", 1, 16 47 42 17
  edit "", 2, 58 45 247 20, autohs
  button "Save", 3, 94 82 55 23, ok
  button "Cancel", 4, 167 82 55 23, cancel
  box "", 5, 5 5 314 67
  text "Address:", 6, 13 22 44 17
  edit "", 7, 59 20 247 20, autohs
}
on *:dialog:editblk:init:0:{
  .did -a editblk 2 $gettok($read(Blacklist.blklist,$did(black,1).sel),1,35)
  .did -a editblk 7 $gettok($read(Blacklist.blklist,$did(black,1).sel),2,35)
}
on *:dialog:editblk:sclick:3:{
  if ($did(editblk,2).edited == $true) {
    .write -l $+ $did(black,1).sel Blacklist.blklist $replace($gettok($read(Blacklist.blklist,$did(black,1).sel),1-,35),$gettok($read(Blacklist.blklist,$did(black,1).sel),1,35),$did(editblk,2).text)
    if ($numtok($gettok($read(Blacklist.blklist,$did(black,1).sel),1,35),32) > 5) { .did -ra black 6 $gettok($gettok($read(Blacklist.blklist,$did(black,1).sel),1,35),1-5,32) $+ ... }
    elseif ($numtok($gettok($read(Blacklist.blklist,$did(black,1).sel),1,35),32) <= 5) { .did -ra black 6 $gettok($read(Blacklist.blklist,$did(black,1).sel),1,35) }   
  }
}
;##### BLACKLIST CODE
#Blklist on
on *:JOIN:#:{
  if ($exists(Blacklist.blklist) == $true) {
    var %x = 1
    while (%x <= $lines(Blacklist.blklist)) {
      if ($gettok($read(Blacklist.blklist,%x),2,35) == $address($nick,2)) { 
        if ($me isop $chan) {
          .write Blacklist.log $asctime(dddd $+ $chr(44) mmmm d $+ $chr(44) yyyy) $chr(124) $asctime(h:nn:ss TT) $chr(124) $nick ( $+ $address($nick,2) $+ ) was blacklisted in $chan $+ .              
          if ($group(#KickAllCommon) == on) { .set -u3 %r $gettok($read(Blacklist.blklist,%x),1,35) | .kickallcommon $$1 }
          elseif ($group(#KickAllCommon) == off) { .mode $chan +bb $nick $address($nick,2) | .kick $chan $nick $gettok($read(Blacklist.blklist,%x),1,35) • Blacklisted }
          .halt
        }
        elseif ($me !isop $chan) { /write Blacklist.log $asctime(dddd $+ $chr(44) mmmm d $+ $chr(44) yyyy) $chr(124) $asctime(h:nn:ss TT) $chr(124) $nick ( $+ $address($nick,2) $+ ) joined $chan but could not be kicked. | .halt }
      }
      .inc %x
    }
  }
}
#Blklist end
;##### END BLACKLIST SCRIPT

Comments

Sign in to comment.
Alco`   -  Feb 10, 2010

This script just kickbans ... and if someone unbans the person and he comes back it doesnt even kickban him/her again -.-

 Respond  
pUtRaDeWa   -  Oct 26, 2009

how about on op ?? if i use this script and a blacklisted user in chanel its will kick it too when i join chanel and got op ??

 Respond  
Ghost-writer   -  Jul 29, 2009

i dont like it o.o

 Respond  
Krejt   -  Dec 08, 2008

good snippet outstanding job:) i liked it good interface, alot of options. and useful.

 Respond  
Juicy   -  Nov 11, 2008

It seems to not function @ Quakenet?
I've tried to add fishbot to it and than exit, it wouldn't cycle through at first instance if it should, and it won't kick it if i'd make him rejoin my chan

Nice script though even if its not working here, could be something i've missed, let me know

 Respond  
Escape-From-Hell   -  Nov 02, 2008

Hey. i tried to add someone to the black list which has 48 characters in it, after 38 characters, it cuts the rest out. Any help would be much appreciated, thanks.

I've never worked with dialogues so i dont know how to edit the sizes.

 Respond  
a careful warchild   -  Oct 30, 2008

@ a careful warchild: Unfortunately it's not my responsibility to make up scripts to fit in with other scripts. I can make it to use to my own advantage, which in fact, is /black for me.

i know, thats why i said > we would have to change that alias anyway.

:) ty anyway chris.

 Respond  
Akishoot   -  Oct 28, 2008

@ a careful warchild: Unfortunately it's not my responsibility to make up scripts to fit in with other scripts. I can make it to use to my own advantage, which in fact, is /black for me.

@ Bullet_Dodger: With the coding available above, any user with the general knowledge of mIRC scripting should be able to piece together an alias for it; good luck.

@ Stapler: I'm not quite sure what the problem is there for you. I've tested it thoroughly and have not had any problems. I believe some of the other users have not had m/any problems with it. Be sure you pasted it in an empty mIRC file. If the problem persists, oh well, I guess you're out of luck.

I will not be updating this script any further. Any updates made will be mandatory updates that I find actually improve the usage of the script, and is not just another feature to get in the way.

I'm sorry if I seem a little blunt with my answers, but I've pretty much stopped mIRC scripting. I will make for-fun scripts every once-in-awhile or other "useful" scripts if I find something that I haven't already coded. I've covered just about all there is to make that can still be considered "useful."

Anyways, good luck with your personal updates to the code, and have fun!

  • Akishoot
 Respond  
a careful warchild   -  Oct 22, 2008

NNS already has a /black alias, so if he did add it, we would have to change that alias anyway.

 Respond  
Bullet_Dodger   -  Oct 20, 2008

Akishoot i just realised that you havnt got a alias
like


/black add Nick

you should add one

x)

 Respond  
Stapler   -  Oct 19, 2008

It won't do anything for me. :(

 Respond  
Bullet_Dodger   -  Oct 18, 2008

Best script on hawkee <_<

 Respond  
Akishoot   -  Oct 14, 2008

You must be an operator for it to kick. I didn't include half-ops in the coding. Feel free to add it yourself, however, it will not be added into the official code.

 Respond  
Bullet_Dodger   -  Oct 01, 2008

Yea me to

 Respond  
a careful warchild   -  Oct 01, 2008

i also got the problem that when i add someone when im half opped it won't kick or ban them...

 Respond  
Akishoot   -  Sep 26, 2008

I've noticed a few problems upon using a few of the new features. I'm in class right now trying to fix it, and I'll work on it when I get home, so I should have an updated, better working version later this evening.

Here's a couple of problems I found:
Double logging of kicks when having "Kick From All Common Channels" enabled
No logs recorded when adding a blacklist entry via the dialog

 Respond  
Bullet_Dodger   -  Sep 26, 2008

Great Blacklist

 Respond  
a careful warchild   -  Sep 14, 2008

how about on the logs bit if you highlight a log you can right click it and have the option to post them to your active channel ;)

 Respond  
Akishoot   -  Sep 13, 2008

Okay. I've figured out the problem I was having before. It's updated now. Read the introduction for details.

(P.S. Thanks again for showing that site to me Imrac; it helped quite a bit while making the introduction. ;)

 Respond  
Nymphomaniiac   -  Sep 06, 2008

yeah, this blacklist is like soo great. I love it. <3

 Respond  
EL   -  Sep 05, 2008

Looks good gotta test a lil more tho.`-.-´

 Respond  
Akishoot   -  Sep 05, 2008

Hehe, any feedback would be appreciated. Always looking to improve things. ;)

 Respond  
EL   -  Sep 05, 2008

o0o gotta test;p.`-.-´

 Respond  
Akishoot   -  Sep 05, 2008

A few features have been added, including Escape-From-Hell's suggestion. Check the Introduction for details.

Thanks for the comments!

 Respond  
irchainscriptz   -  Sep 03, 2008

Nice thats some fine coding there Akishoot, I'll try it later on in the room :P But nice work!!

 Respond  
Akishoot   -  Sep 03, 2008

Thanks for the suggestion Escape-From-Hell! I will be adding that along with a few other small things in the next update. I'm at my school right now so I don't have the coding/program in front of me to do anything.

 Respond  
Escape-From-Hell   -  Aug 25, 2008

Suggestion: If a user joins a chan, and you are not op, you could make it echo into a window or into the log that a blacklisted user has joined but you are unable to kick/ban them.

Other that that, its an awesome blacklist, Good job.

 Respond  
Akishoot   -  Aug 19, 2008

Thanks for the comments guys. Still updating it periodically.

 Respond  
Spanky   -  Aug 18, 2008

wd best blacklist on here.

 Respond  
damdempsel   -  Aug 18, 2008

Awesome job.

 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.