mIRC Homepage
Posted By: LO_KEY dcc send connecting - 15/02/05 05:00 AM
How can i tell when a dcc send connects?
Posted By: k1tkra04 Re: dcc send connecting - 15/02/05 05:34 AM
it was say connection established
Posted By: LO_KEY Re: dcc send connecting - 15/02/05 05:37 AM
lol, i mean remotely via a script, to have it do sumthin like send a msg to a channel or sumthin...
Posted By: DaveC Re: dcc send connecting - 15/02/05 05:53 AM
/help ctcp events

CTCP *:DCC SEND *:{
; $1- = Dcc Send Filename LongIP Port Filesize
; $nick = sender nick
; $filename = path & filename
;
; * below is a correction to the $1- to deal with spaces in the filename, if you want to use $4 $5 $6 (not many do)
tokenize 62 $1 $+ > $+ $2 $+ > $+ $nopath($filename) $+ > $+ $gettok($1-,-3,32) $+ > $+ $gettok($1-,-2,32) $+ > $+ $gettok($1-,-1,32)
}

no $chan as dcc sends are not channel specific


This actually triggers when the dcc send is sent to you not when the file starts downloading, so if you didnt reply to it or the sender couldnt be reached, then this well still display.
But you can setup a timer to check on a the $get() list to see if the file has started downloading.
Posted By: ricky_knuckles Re: dcc send connecting - 15/02/05 07:48 AM
if u have it doing something via script and you want to see if it is working add echos

if (%blah = blah) {
echo 5 -a blah does equal blah
commands
}
Posted By: LO_KEY Re: dcc send connecting - 15/02/05 07:35 PM
i shoulda been more specific, i need it for when i am sending, i seen the dcc send remote...

sorry for the misunderstanding.
Posted By: FiberOPtics Re: dcc send connecting - 15/02/05 08:20 PM
No kidding.
Posted By: DaveC Re: dcc send connecting - 15/02/05 08:27 PM
Quote:
if u have it doing something via script and you want to see if it is working add echos

if (%blah = blah) {
echo 5 -a blah does equal blah
commands
}


I have no idea what this was in refrence too, I wasnt even asking a question, I was demonstrating an event he can use to trap what i thought he was after getting too.


PS: I use /Debugger [h|p|-] <relevent info to the debugging point here>

With this I can debug leave debugging lines in anywhere and not need to remove them later.

Code:
;alias -l Debugger { }
alias -l Debugger {
  echo -st Debug Point &lt;scriptname&gt; : $1-
  if ($1 == H) &amp;&amp; ($?!="Halt") { halt }
  if ($1 == P) { echo -st Paused here $?="Paused Here Comments?" }
}

* thats a cut down version but you see the methodology
Posted By: DaveC Re: dcc send connecting - 15/02/05 10:05 PM
I dont know of any event triggered when your send starts sending so, i wrote something on a timer....

ANYONE KNOW OF AN EVENT TO HOOK IN ON?

The 61 and 60 in the below alias is for a 60 second monitoring, if you want to increase it then increment that number up as needed.

Code:
;
;usage $start.watch.for.dcc.send(nick,filename,channel,message)
;usage !.echo -q $start.watch.for.dcc.send(nick,filename,channel,message)
;usage /start.watch.for.dcc.send nick filename channel message [ this option limited to filename having no spaces ]
; 
alias start.watch.for.dcc.send {
  var %timername = $+(WFDS.,$ticks,.,$rand(100001,199999))
  set -u61 % $+ [ %timername ] $+ .nick $1
  set -u61 % $+ [ %timername ] $+ .file $2
  set -u61 % $+ [ %timername ] $+ .chan $3
  set -u61 % $+ [ %timername ] $+ .mess $4-
  .timer $+ %timername 60 1 watch.for.dcc.send %timername
}
;
alias -l watch.for.dcc.send {
  var %nick = [ % $+ [ $1 $+ .nick ] ]
  var %file = [ % $+ [ $1 $+ .file ] ]
  var %i = $send(%nick,0)
  while (%i) {
    if (($send(%nick,%i).file == %file) &amp;&amp; ($send(%nick,%i).status == active)) {
      var %chan = [ % $+ [ $1 $+ .chan ] ]
      var %mess = [ % $+ [ $1 $+ .mess ] ]
      msg %chan %mess
      .timer $+ $1 off
      unset % $+ $1 $+ .*
      halt
    }
    dec %i
  }
}


That above is designed to be a routine u call when your doing a dcc send, it doesnt run on its own.

Directly precedding the dcc send (or directly following it) you need to do
$start.watch.for.dcc.send(nick,filename,channel,message)
* nick is the nick your sending the file to
* filename is the filename
* channel is the channel gfor your message (you can use a nick if u want)
* message is the message

so assuming your doing

/dcc send %nick %filename

then add to it to make....

/dcc send %nick %filename
$start.watch.for.dcc.send(%nick,%filename,#wombatworld,Master Wombat $me has started to send %filename to %nick so says the scrolls of wombatness)

above is a channel message or below is a private message

/dcc send %nick %filename
$start.watch.for.dcc.send(%nick,%filename,%nick,In case your completely blind in which case you wont see this anyway I am sedning you the file %filename now!)



*** limitations you cant have a comma in the message, u need to make it $chr(44) becuase the comma well seperate the parameters
*** The reason I dont call the alias using /start.watch.for.dcc.send nick filename channel message is becuase the filename MAY have spaces in it, if it doesnt then you can use /start.watch.for.dcc.send
© mIRC Discussion Forums