mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: May 2003
Posts: 4
A
AFX Offline OP
Self-satisified door
OP Offline
Self-satisified door
A
Joined: May 2003
Posts: 4
Yeah, as far as I and a lot of other people, there is no events for when you close a DCC send/get window. This should be implemented in my opinion.

Joined: Dec 2002
Posts: 1,237
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 1,237
In mIRC, use the command /help and look up the following:

On Filercvd, On Filesent, On Sendfail, On Getfail

Example:

Code:
[color:green]; Triggers when file successfully received for the filetype of your choice[/color] 
On *:Filercvd:*[color:red].fileextensionhere[/color]: {
  [color:green]; close -s tells mIRC to close the dcc send window[/color] 
  close [color:red]-s[/color] $nick 
}


I'm assuming this is something along the lines of what you want...if not, my bad.

Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
He wants to detect when a dcc window is closed, like if you click the x button on a dcc window.


New username: hixxy
Joined: Dec 2002
Posts: 1,237
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 1,237
...my bad smile

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
The following code gives you the event traps on dcc send and get windows closing, due to there not always being a event that occurs when one of these window closes (one that i could find at least), its possable the signal events 9see bottom) might go off up to 1 second late, and that the data it replies with is upto 1 second old also. Things such as Nick and filename of course well be correct etc etc.
The data passed to the signal is essentially what you would recieve from doing a $send(x) $send(x).ip $send(x).status etc etc, it says what it is at the bottom.
Do NOT forget the /TOKENIZE 62 $1- in the signal events its needed to get the $1- values lined up.



Code:
;Event Trapping DCC GET/SEND windows closing, See SIGNALS at bottom for code to cut and paste into your code.
;
;
;*** MISC *** (not used)
;
alias rd.ms { record.dcc.get.send | check.and.reset }
;
;
;*** EVENTS ***
;
on *:LOAD:       { record.dcc.get.send | check.and.reset }
on *:START:      { record.dcc.get.send | check.and.reset }
on *:FILERCVD:*: { check.and.reset }
on *:FILESENT:*: { check.and.reset }
on *:SENDFAIL:*: { check.and.reset }
on *:GETFAIL:*:  { check.and.reset }
on *:ACTIVE:*:   { if (!$lactive) { check.and.reset } }
on *:UNLOAD:     { .timer.check.dcc.get.send off | hfree -w record.dcc.get | hfree -w record.dcc.send }
;
;
;*** ROUTINES ***
;
alias -l check.and.reset { check.dcc.get.send | .timer.check.dcc.get.send -o 0 1 check.dcc.get.send }
;
alias -l record.dcc.get.send {
  hadd -m record.dcc.get * | hdel -w record.dcc.get *
  var %i = $get(0)
  hadd record.dcc.get 0 %i
  while (%i) {
    hadd record.dcc.get %i             $get(%i)
    hadd record.dcc.get $+(%i,.ip)     $get(%i).ip
    hadd record.dcc.get $+(%i,.status) $get(%i).status
    hadd record.dcc.get $+(%i,.file)   $get(%i).file
    hadd record.dcc.get $+(%i,.path)   $get(%i).path
    hadd record.dcc.get $+(%i,.size)   $get(%i).size
    hadd record.dcc.get $+(%i,.rcvd)   $get(%i).rcvd
    hadd record.dcc.get $+(%i,.cps)    $get(%i).cps
    hadd record.dcc.get $+(%i,.pc)     $get(%i).pc
    hadd record.dcc.get $+(%i,.secs)   $get(%i).secs
    hadd record.dcc.get $+(%i,.done)   $get(%i).done
    hadd record.dcc.get $+(%i,.resume) $get(%i).resume
    hadd record.dcc.get $+(%i,.wid)    $get(%i).wid
    hadd record.dcc.get $+(%i,.cid)    $get(%i).cid
    hadd record.dcc.get $+(%i,.hwnd)   $get(%i).hwnd
    dec %i
  }
  ;
  hadd -m record.dcc.send * | hdel -w record.dcc.send *
  var %i = $send(0)
  hadd record.dcc.send 0 %i
  while (%i) {
    hadd record.dcc.send %i             $send(%i)
    hadd record.dcc.send $+(%i,.ip)     $send(%i).ip
    hadd record.dcc.send $+(%i,.status) $send(%i).status
    hadd record.dcc.send $+(%i,.file)   $send(%i).file
    hadd record.dcc.send $+(%i,.path)   $send(%i).path
    hadd record.dcc.send $+(%i,.size)   $send(%i).size
    hadd record.dcc.send $+(%i,.sent)   $send(%i).sent
    hadd record.dcc.send $+(%i,.lra)    $send(%i).lra
    hadd record.dcc.send $+(%i,.cps)    $send(%i).cps
    hadd record.dcc.send $+(%i,.pc)     $send(%i).pc
    hadd record.dcc.send $+(%i,.secs)   $send(%i).secs
    hadd record.dcc.send $+(%i,.done)   $send(%i).done
    hadd record.dcc.send $+(%i,.resume) $send(%i).resume
    hadd record.dcc.send $+(%i,.wid)    $send(%i).wid
    hadd record.dcc.send $+(%i,.cid)    $send(%i).cid
    hadd record.dcc.send $+(%i,.hwnd)   $send(%i).hwnd
    dec %i
  }
}
;
alias -l check.dcc.get.send {
  hadd -m record.dcc.get *.present | hdel -w record.dcc.get *.present
  var %i = $get(0)
  while (%i) {
    var %hwnd = $get(%i).hwnd
    var %c = $hfind(record.dcc.get,%hwnd,0).data
    while (%c) {
      if (*.hwnd iswm $hfind(record.dcc.get,%hwnd,%c).data) {
        hadd record.dcc.get $+($gettok($v2,1,46),.present) $true
      }
      dec %c
    }
    dec %i
  }
  var %i = $rd.get(0)
  while (%i) {
    if (!$rd.get(%i).present) { .signal dcc.get.closed $+($rd.get(%i),>,$rd.get(%i).ip,>,$rd.get(%i).status,>,$rd.get(%i).file,>,$rd.get(%i).path,>,$rd.get(%i).size,>,$rd.get(%i).rcvd,>,$rd.get(%i).cps,>,$rd.get(%i).pc,>,$rd.get(%i).secs,>,$rd.get(%i).done,>,$rd.get(%i).resume,>,$rd.get(%i).wid,>,$rd.get(%i).cid,>,$rd.get(%i).hwnd) }
    dec %i
  }
  ;
  hadd -m record.dcc.send *.present | hdel -w record.dcc.send *.present
  var %i = $send(0)
  while (%i) {
    var %hwnd = $send(%i).hwnd
    var %c = $hfind(record.dcc.send,%hwnd,0).data
    while (%c) {
      if (*.hwnd iswm $hfind(record.dcc.send,%hwnd,%c).data) {
        hadd record.dcc.send $+($gettok($v2,1,46),.present) $true
      }
      dec %c
    }
    dec %i
  }
  var %i = $rd.send(0)
  while (%i) {
    if (!$rd.send(%i).present) { .signal dcc.send.closed $+($rd.send(%i),>,$rd.send(%i).ip,>,$rd.send(%i).status,>,$rd.send(%i).file,>,$rd.send(%i).path,>,$rd.send(%i).size,>,$rd.send(%i).sent,>,$rd.send(%i).lra,>,$rd.send(%i).cps,>,$rd.send(%i).pc,>,$rd.send(%i).secs,>,$rd.send(%i).done,>,$rd.send(%i).resume,>,$rd.send(%i).wid,>,$rd.send(%i).cid,>,$rd.send(%i).hwnd) }
    dec %i
  }
  ;
  record.dcc.get.send 
}
;
;
;*** CUSTOM $IDENTIFIERS ***
;
alias -l rd.get  { return $hget(record.dcc.get ,$iif($len($prop),$+($1,.,$prop),$1)) }
alias -l rd.send { return $hget(record.dcc.send,$iif($len($prop),$+($1,.,$prop),$1)) }
;
;
;------------------------------[Copy code below here and use within your scripts]------------------------------
;
;*** SIGNALS ***
;
;In dcc.get.closed $1 to $15 = nick ip status file path size rcvd cps pc secs done resume wid cid hwnd
;& dcc.send.closed $1 to $16 = nick ip status file path size sent lra cps pc secs done resume wid cid hwnd
;
;NB:file & path may contain spaces these values are still held in $4 & $5 respectively
;
on *:SIGNAL:dcc.get.closed: { tokenize 62 $1- | echo -st EVENT SIGNAL:dcc.get.closed: $1- }
on *:SIGNAL:dcc.send.closed:{ tokenize 62 $1- | echo -st EVENT SIGNAL:dcc.send.closed: $1- }


Link Copied to Clipboard