mIRC Home    About    Download    Register    News    Help

Print Thread
dcc send connecting #111369 15/02/05 05:00 AM
Joined: Feb 2003
Posts: 83
L
LO_KEY Offline OP
Babel fish
OP Offline
Babel fish
L
Joined: Feb 2003
Posts: 83
How can i tell when a dcc send connects?

Re: dcc send connecting #111370 15/02/05 05:34 AM
Joined: Feb 2005
Posts: 34
K
k1tkra04 Offline
Ameglian cow
Offline
Ameglian cow
K
Joined: Feb 2005
Posts: 34
it was say connection established

Re: dcc send connecting #111371 15/02/05 05:37 AM
Joined: Feb 2003
Posts: 83
L
LO_KEY Offline OP
Babel fish
OP Offline
Babel fish
L
Joined: Feb 2003
Posts: 83
lol, i mean remotely via a script, to have it do sumthin like send a msg to a channel or sumthin...

Re: dcc send connecting #111372 15/02/05 05:53 AM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
/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.

Re: dcc send connecting #111373 15/02/05 07:48 AM
Joined: Nov 2004
Posts: 332
R
ricky_knuckles Offline
Fjord artisan
Offline
Fjord artisan
R
Joined: Nov 2004
Posts: 332
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
}


The Kodokan will move you, one way or another.
Re: dcc send connecting #111374 15/02/05 07:35 PM
Joined: Feb 2003
Posts: 83
L
LO_KEY Offline OP
Babel fish
OP Offline
Babel fish
L
Joined: Feb 2003
Posts: 83
i shoulda been more specific, i need it for when i am sending, i seen the dcc send remote...

sorry for the misunderstanding.

Re: dcc send connecting #111375 15/02/05 08:20 PM
Joined: Feb 2004
Posts: 2,019
FiberOPtics Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
No kidding.


Gone.
Re: dcc send connecting #111376 15/02/05 08:27 PM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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

Re: dcc send connecting #111377 15/02/05 10:05 PM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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