|
Joined: Oct 2003
Posts: 37
Ameglian cow
|
OP
Ameglian cow
Joined: Oct 2003
Posts: 37 |
why my on open didnt work for dcc? i use on *:open:*:{ echo -a $target } and nothing happend when someone dcc me.. sorry for my english.. hihi tq for helping..
|
|
|
|
Joined: Sep 2003
Posts: 4,230
Hoopy frood
|
Hoopy frood
Joined: Sep 2003
Posts: 4,230 |
|
|
|
|
Joined: Oct 2003
Posts: 37
Ameglian cow
|
OP
Ameglian cow
Joined: Oct 2003
Posts: 37 |
when someone send file to me..
|
|
|
|
Joined: Sep 2003
Posts: 4,230
Hoopy frood
|
Hoopy frood
Joined: Sep 2003
Posts: 4,230 |
CTCP *:DCC SEND *:?:{ echo -st $!filename $filename $!nick $nick $!target $target ; var %windowname = Send $target $nopath($filename) ;^ $target well be the same as $me, but $target is the more correct identifier to use. ; echo -st %windowname }
|
|
|
|
Joined: Oct 2003
Posts: 37
Ameglian cow
|
OP
Ameglian cow
Joined: Oct 2003
Posts: 37 |
tq but thats not what i meant.. i want to know what event trigger the dcc window after i click accept.. i use on open but nothing happend.. on *:open:*:{ echo -a blablabla }
|
|
|
|
Joined: Sep 2003
Posts: 4,230
Hoopy frood
|
Hoopy frood
Joined: Sep 2003
Posts: 4,230 |
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
Rumie, you're missing a part of the on open code.
You used:
on *:open:*: { }
It should be:
on *:open:*:*: { }
First * is level, second is name of the window, third is type of window.
Or, in the case of only wanting it for DCC, you can use:
on *:open:*:=: { }
As far as what even triggered the DCC window, I'm not sure I understand what you're meaning. Do you have an example?
Invision Support #Invision on irc.irchighway.net
|
|
|
|
Joined: Sep 2003
Posts: 4,230
Hoopy frood
|
Hoopy frood
Joined: Sep 2003
Posts: 4,230 |
I had written this for something else (closing of dcc sends and gets), but altered it for detecting opening of dcc sends and gets as well. Now heres the problem, MIRC recons the DCC GET (file sent to you) is open as soon as the dialog is up for if u want to accept it, so this triggers as soon as that window appears, which i guess isnt much different from a CTCP *:DCC SEND *:, however you could then set up a timer to see if the status of the $GET changes, and/or kill the timer if the window is closed. heres the code, it traps DCC GET/SEND windows OPENING & CLOSING
;Event Trapping DCC GET/SEND windows opening & 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
var %found = $false
while (%c) {
if (*.hwnd iswm $hfind(record.dcc.get,%hwnd,%c).data) {
hadd record.dcc.get $+($gettok($v2,1,46),.present) $true
var %found = $true
}
dec %c
}
if (!%found) { .signal dcc.get.opened $+($get(%i),>,$get(%i).ip,>,$get(%i).status,>,$get(%i).file,>,$get(%i).path,>,$get(%i).size,>,$get(%i).rcvd,>,$get(%i).cps,>,$get(%i).pc,>,$get(%i).secs,>,$get(%i).done,>,$get(%i).resume,>,$get(%i).wid,>,$get(%i).cid,>,$get(%i).hwnd) }
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
var %found = $false
while (%c) {
if (*.hwnd iswm $hfind(record.dcc.send,%hwnd,%c).data) {
hadd record.dcc.send $+($gettok($v2,1,46),.present) $true
var %found = $true
}
dec %c
}
if (!%found) { .signal dcc.send.opened $+($send(%i),>,$send(%i).ip,>,$send(%i).status,>,$send(%i).file,>,$send(%i).path,>,$send(%i).size,>,$send(%i).sent,>,$send(%i).lra,>,$send(%i).cps,>,$send(%i).pc,>,$send(%i).secs,>,$send(%i).done,>,$send(%i).resume,>,$send(%i).wid,>,$send(%i).cid,>,$send(%i).hwnd) }
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.opened $1 to $15 = nick ip status file path size rcvd cps pc secs done resume wid cid hwnd
;& dcc.get.closed $1 to $15 = nick ip status file path size rcvd cps pc secs done resume wid cid hwnd
;& dcc.send.opened $1 to $16 = nick ip status file path size sent lra 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
;^ the above assumes you have used TOKENIZE 62 $1- as each value is seperated by a > $chr(62)
;
;NB:file & path may contain spaces these values are still held in $4 & $5 respectively
;
on *:SIGNAL:dcc.get.opened: { tokenize 62 $1- | echo -st EVENT SIGNAL:dcc.get.opened: $1- }
on *:SIGNAL:dcc.get.closed: { tokenize 62 $1- | echo -st EVENT SIGNAL:dcc.get.closed: $1- }
on *:SIGNAL:dcc.send.opened:{ tokenize 62 $1- | echo -st EVENT SIGNAL:dcc.send.opened: $1- }
on *:SIGNAL:dcc.send.closed:{ tokenize 62 $1- | echo -st EVENT SIGNAL:dcc.send.closed: $1- }
|
|
|
|
Joined: Oct 2003
Posts: 37
Ameglian cow
|
OP
Ameglian cow
Joined: Oct 2003
Posts: 37 |
wooo.. hehehe look confusing.. i think i'll use timer.. tq
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
Lol. I'm glad I just have auto-accept so I don't have to worry about such things.  Since I have a log of anything received, I can easily tell if someone sends something that I don't want.
Invision Support #Invision on irc.irchighway.net
|
|
|
|
Joined: Nov 2003
Posts: 2,327
Hoopy frood
|
Hoopy frood
Joined: Nov 2003
Posts: 2,327 |
On open doesn't need the matchtext parameter. If you omit it then it's the same as if you had supplied * as a matchtext.
New username: hixxy
|
|
|
|
Joined: Apr 2004
Posts: 870
Hoopy frood
|
Hoopy frood
Joined: Apr 2004
Posts: 870 |
Not exactly, and it's therefore good practice to add the matchtext field when possible. Compare these two: on ^*:open:?:*:{ echo -s got message from $nick $+ : $1- | halt }
vs
on ^*:open:?:{ echo -s got message from $nick $+ : $1- | halt } The first one will work, the second one won't (because of the : in the echo command).
Saturn, QuakeNet staff
|
|
|
|
Joined: Sep 2003
Posts: 4,230
Hoopy frood
|
Hoopy frood
Joined: Sep 2003
Posts: 4,230 |
I cant even think of what he wants to do on an ON OPEN DCC SEND WINDOW event, but it was as easy as 4 extra lines to add it, so there it was. As for what i get sent i might nto want, yeah i do the same keeping a log, but then again, i only ever download edu materials (honest!)
|
|
|
|
|