mIRC Home    About    Download    Register    News    Help

Print Thread
#112990 28/02/05 05:29 AM
Joined: Jul 2004
Posts: 14
B
Pikka bird
OP Offline
Pikka bird
B
Joined: Jul 2004
Posts: 14
Code:
ctcp *:*:*: { if ($1 = dcc) { my command } }

The above code will detect incoming send, how do i detect outgoing send (upload) so i can add some command ?

Thanks in advance smile

#112991 28/02/05 05:31 AM
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
I don't use dcc a lot so there's probably a better way, but you could alias the dcc command:

Code:
alias dcc {
  do stuff
  !dcc $1-
}


New username: hixxy
#112992 28/02/05 05:54 AM
Joined: Jul 2004
Posts: 14
B
Pikka bird
OP Offline
Pikka bird
B
Joined: Jul 2004
Posts: 14
Code:
ctcp *:*:*: { if ($2 = send) { do stuff } } credits to uriel on #helpdesk (dalnet)

Thanks alot for the rapid reply but i had already found a better way to detect outgoing send smile

#112993 01/03/05 12:07 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
well that certianly isnt it

Thats detects the SEND word of the the DCC SEND of the ctcp of incoming files.

There is no CTCP event tripped when you do a dcc send, as Tidy_Trax said, hook up a

ALIAS DCC {
if $1 = send { ... do stuff ... }
dcc $1-
}

That well work fine in most cases of a scripted send as all the parts need to be on the /dcc command line, I have got a script that traps all of them, but it normally needs incorperating into existent scripts (well does for me)

Code:
alias -l catch.dcc.send {
  if ($(-> & PRIVMSG & :DCC SEND *) iswm $1-) {
    tokenize 32 $remove($1-,)
    tokenize 32 DCC SEND $4 $7-
    if ("* iswm $4-) { tokenize 62 $1 $+ > $+ $2 $+ > $+ $3 $+ > $+ " $+ $gettok($4-,1,34) $+ " $+ > $+ $replace($gettok($4-,2-,34),$chr(32),$chr(62)) }
    ;
    ; Your code here $1- = DCC SEND NICK FILENAME LONGIP PORT FILESIZE (unless it was bad dcc send data)
    ; * FILENAME well be one word (with no "") or "multiple words" (with "")
    ;
  }
}
;
;* below is an example of how to add the dcc send catcher into a /debug -i alias
alias debug.i.alias {
  catch.dcc.send $1-
  return $1-
}
;
;* below is an example of how to activate a /debug -i debugger window and alias
alias start.it.up { window -c @debug.window | window -h @debug.window | debug -i @debug.window debug.i.alias }


Since this method uses /DEBUG there might already be a debug system running so the alias catch.dcc.send is designed to be called from a -i debug alias, the bottom two aliases are just examples of how to insert it and how to start a debugger up if u dont have one. *** you need a debugger for EACH server your on ***

#112994 01/03/05 01:41 AM
Joined: Jul 2004
Posts: 14
B
Pikka bird
OP Offline
Pikka bird
B
Joined: Jul 2004
Posts: 14
I didnt know that code by uriel wasnt that good

Thanks alot for ur code as it seem more detailed in order to catch dcc send event laugh


Link Copied to Clipboard