DCC Killer

By Zmodem on May 12, 2011

Screenshots

DCC Killer - v1.0
Author: Zmodem

DCC Killer is a simple, yet effective, snippet that provides users with the ability to block Dcc Sends & Chats from other users. It comes built with an optional friends list and log feature.

Email: z_modem@hotmail.com
Hawkee: http://www.hawkee.com/profile/805/
IRC: (Server: irc.freenode.net) (Channel: #reddit)

alias -l s return $f(settings.ini)
alias -l f return $+(",$scriptdir,$1,")
alias -l getval return $readini($s,$1,$2)
alias -l adcc if (!$dialog(adcc $+ $1)) dialog -m adcc $+ $1 adcc $+ $1
alias -l friend var %n = $1, %s = $s, %i = $ini(%s,Friends,0) | while (%i) { if ($ini(%s,Friends,%i) == %n) return 1 | dec %i }
alias -l fRefresh var %x = $ini($s,Friends,0), %d = $1 | did -r %d 1 | while (%x) { did -a %d 1 $ini($s,Friends,%x) | did -z %d 1 | dec %x }
alias -l do_unload echo -s DCC Killer has successfully been unloaded! If you wish to load again, type /load -rs " $+ $script $+ " $+ . | .unload -rs " $+ $script $+ "
alias -l check.settings.file {
  %p = putval Setup
  if ($getval(Setup,Send) == $null) { %p Send 0 }
  if ($getval(Setup,Chat) == $null) { %p Chat 0 }
  if ($getval(Setup,Log) == $null) { %p Log 0 }
}
alias -l putval {
  var %w = writeini $s
  if ($1 == Friends) {
    if (!$3) { return }
    var %2 = $strip($remove($2,$chr(32)))
    if (%2 != $null) { %w $1 %2 1 }
    return
  }
  writeini $s $1-
}
alias -l adcc.load.logs {
  if (!$dialog(adccl)) {
    .timerDCCKillerLogsRefresher off
    return
  }
  var %d = $1, %s = $2-, %x = $ini(%s,Logs,0)
  did -r %d 2
  while (%x) {
    did -a %d 2 $getval(Logs,$ini(%s,Logs,%x))
    did -z %d 2
    dec %x
  }
}

; Dialogs
dialog -l adcc {
  title "DCC Killer"
  size -1 -1 116 80
  option dbu
  check "Enable", 1, 8 62 40 12, push
  box "Options", 2, 8 4 100 52
  check "Ignore Incoming Dcc Sends", 3, 16 16 76 8
  check "Ignore Incoming Dcc Chats", 4, 16 28 76 8
  check "Keep A Log of All Attempts", 5, 16 40 76 8
  button "Friends List...", 6, 68 62 40 12
}
ON *:DIALOG:adcc:*:*: {
  var %d = $dname, %e = $devent, %i = $did, %c = did -c %d
  if (%e == init) {
    if ($group(#dcckiller).status == on) %c 1
    if ($getval(Setup,Send)) %c 3
    if ($getval(Setup,Chat)) %c 4
    if ($getval(Setup,Log)) %c 5
  }
  if (%e == sclick) {
    if (%i == 1) $iif($did(%i).state,.enable,.disable) #dcckiller
    if (%i == 3) putval Setup Send $did(%i).state
    if (%i == 4) putval Setup Chat $did(%i).state
    if (%i == 5) putval Setup Log $did(%i).state
    if (%i == 6) adcc f
  }
}

dialog -l adccf {
  title "Friends"
  size -1 -1 89 84
  option dbu
  list 1, 4 4 81 60, size hsbar vsbar
  button "Add", 2, 4 68 24 12
  button "Delete", 3, 30 68 24 12
  button "Close", 4, 61 68 24 12, ok
  box "", 5, 57 64 1 16
}
ON *:DIALOG:adccf:*:*: {
  var %d = $dname, %e = $devent, %i = $did
  if (%e == init) fRefresh %d
  if (%e == sclick) {
    if (%i == 2) {
      var %u = $input(Enter a new friend for the list:,qe,New Entry)
      if (%u) {
        if ($Friend(%u)) { return $input(This user is already in your friends list.,io,Existing Entry) }
        putval Friends %u 1
        fRefresh %d
      }
    }
    if ((%i == 3) && ($did(1).sel)) { remini $s Friends $did(1,$did(1).sel) | fRefresh %d }
  }
}

dialog -l adccl {
  title "Log"
  size -1 -1 164 100
  option dbu
  box "DCC Attempt Log", 1, 4 4 156 92
  list 2, 9 14 146 68, size vsbar hsbar
  text "( Click Copies Items - Double-Click Clears The List )", 3, 9 85 146 8, center
}
ON *:DIALOG:adccl:*:*: {
  var %d = $dname, %e = $devent, %i = $did, %s = $s
  if (%e == init) { adcc.load.logs %d %s | .timerDCCKillerLogsRefresher 0 1 adcc.load.logs %d %s }
  if ((%e == sclick) && (%i == 2)) clipboard $did(%i,$did(%i).sel)
  if ((%e == dclick) && (%i == 2)) { did -r %d %i | .remini %s Logs }
}

dialog -l adcca {
  title "About"
  size -1 -1 92 72
  option dbu
  text "DCC Killer", 1, 4 4 84 8, center
  text "v1.00", 2, 4 21 84 8, center
  text "Author:", 3, 4 37 37 8, right
  link "Zmodem", 4, 50 37 38 8
  button "OK", 5, 31 52 28 14, ok
}
ON *:DIALOG:adcca:sclick:4:run mailto:z_modem@hotmail.com?Subject=DCC Killer

; Menus
menu menubar,status {
  DCC Killer
  .Main Dialog:adcc
  .-
  .Edit Friends List:adcc f
  .View Logs:adcc l
  .-
  .Unload:$iif($input(Are you sure that you want to unload the DCC Killer addon?,wy,Verify Unload),do_unload)
  .-
  .About:adcc a
}

; Groups
#dcckiller off
CTCP *:DCC *: {
  var %t = $2, %o = (, %c = )
  if ($getval(Setup,Log)) { putval Logs $ctime %o %t %c %o $asctime($ctime,mm/dd/yy) %c %o $asctime($ctime,h:nn:sstt) %c %o $nick - $wildsite %c }
  if (($getval(Setup,%t)) && (!$friend($nick))) {
    .ignore -du30 $wildsite
    .notice $nick Sorry, $nick $+ , I am not accepting any DCC %t $+ s right now. Please contact me if you wish to use this feature through a /query, /msg or simply find me in a channel and ask me. You have been ignored from any further DCC Chats or Sends for 30 seconds.
    haltdef 
  }
}
#dcckiller end
on *:load:{
  var %c = $+($crlf,$crlf), %s = $s
  if ($isfile(%s)) {
    check.settings.file
    goto finish
  }
  var %p = putval Setup
  %p Send 0
  %p Chat 0
  %p Log 0
  .disable #dcckiller
  :finish
  return $input($+(DCC Killer,%c,v1.0,%c,Author: Zmodem,%c,In) order to begin $+ $chr(44) simply go to the menubar or status bar. Locate the popups called 'DCC Killer' and click 'Main Dialog'.,io,Welcome)
}

Comments

Sign in to comment.
Zmodem   -  May 27, 2011

Hey guys, thanks for the kind words :) I'm working on something new and I hope to be done with it soon. I'm brainstorming some new ideas, so whatever you may want to see done, post to my wall http://www.hawkee.com/profile/805/. Thanks, again!

 Respond  
irchainscriptz   -  May 15, 2011

yeah very nice coding. Dialogs are neat and simple.

 Respond  
jaytea   -  May 14, 2011

nice to see veterans of the trade making a comeback. good work Zmodem ;P

 Respond  
napa182   -  May 12, 2011

um a few of us are still over on ezzychat .
/server -m irc.ezzychat.com

 Respond  
Zmodem   -  May 12, 2011

Hey, napa, thanks a lot :) It's been quite some time, actually. Where are we hanging out, irc-wise, these days?

 Respond  
napa182   -  May 12, 2011

nice work Zmodem. also nice to see you back posting once again.

 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.