mIRC Home    About    Download    Register    News    Help

Print Thread
DCC event in scripting lang #6368 13/01/03 12:40 PM
Joined: Jan 2003
Posts: 20
X
xemacs Offline OP
Ameglian cow
OP Offline
Ameglian cow
X
Joined: Jan 2003
Posts: 20
a on DCC event wouldnt be bad
on 1:DCC:SEND/GET/CHAT:{
commands
}

for example
please create such an event
PLEEEEASE =)

Re: DCC event in scripting lang #6369 13/01/03 12:48 PM
Joined: Dec 2002
Posts: 395
M
MonoSex Offline
Fjord artisan
Offline
Fjord artisan
M
Joined: Dec 2002
Posts: 395
try:

on CHAT
on SERV
on FILESENT
on FILERCVD
on SENDFAIL
on GETFAIL

wink

Re: DCC event in scripting lang #6370 13/01/03 10:10 PM
Joined: Jan 2003
Posts: 20
X
xemacs Offline OP
Ameglian cow
OP Offline
Ameglian cow
X
Joined: Jan 2003
Posts: 20
yea but there isnt a event for beginning/opening a DCC window wink

Re: DCC event in scripting lang #6371 13/01/03 10:27 PM
Joined: Dec 2002
Posts: 39
L
Larra Offline
Ameglian cow
Offline
Ameglian cow
L
Joined: Dec 2002
Posts: 39
I requested that in the old forum too.
There is not an option to triger when you click resume, ignore, etc...

Re: DCC event in scripting lang #6372 14/01/03 02:13 AM
Joined: Dec 2002
Posts: 1,321
H
Hammer Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
<Sender> /dcc send Receiver filename.ext
-Sender- NOTICE Receiver :[/b]DCC Send filename.ext (IP address)
<Sender> PRIVMSG Receiver :DCC SEND filename.ext <longIP> <port> <filesize>

mIRC checks to see if it should Ask/Ignore/Auto-accept/Cancel. If Send Requests are set for Ask, mIRC pops up the Accept/Ignore/Cancel dialog. If the Accept button is clicked, then it checks to see if the file already exists in the download directory for that file type. If it does, it presents the options to Resume/OverWrite/Rename. Rename takes you back to the Accept/Ignore/Cancel dialog; Overwrite deletes the file and rewrites it; Resume reverses the normal DCC Process (receiver connecting to sender on the specified port) by setting up a port listen on a port and allowing the sender to connect and send the file that way. Resume also removes the last 8K of the file to cut off any garbled bits in the last section of the previous send.

For a Resume request:
<Receiver> PRIVMSG Sender :DCC RESUME file.ext <port> <current filesize - 8192>
<Sender> PRIVMSG Receiver :DCC ACCEPT file.ext <port> <file position>

Having said all that, you CAN, in fact, capture the commands yourself as well. You can capture the events involved.

Code:
ctcp *:DCC SEND*:?:{
  [color:#006600];
  ;    Someone is sending you a file.
  ;[/color]
  var %FileName = $gettok($3-,$+(1-,$calc($numtok($3-,32) - 3)),32)
  var %LongIP = $gettok($3-,-3,32)
  var %Port = $gettok($3-,-2,32)
  var %FileSize = $gettok($3-,-1,32)
  echo $color(ctcp) -sti2 * Incoming DCC Send Request from $nick $+ : $&amp;
    %FileName from IP $longip(%LongIp) on port %Port $&amp;
    with a filesize of $bytes(%FileSize,3bkm).suf
  [color:#006600];
  ;  In reverse order:
  ;    Cancel button: closes the Accept/Ignore/Cancel dialog
  ;    Ignore button: /ignore -du60 $wildsite
  ;    Accept button:
  ;      checks to see if %FileName exists in the Get directory for that file type
  ;      and offers the opportunity to Resume / Overwrite / Rename.
  ;[/color]
  if ($isfile($+($getdir(%FileName),%FileName))) {
    [color:#006600];
    ;  Your code for intercepting the Resume request and perhaps renaming the old file
    ;  would go in here.
    ;[/color]
    echo $color(info) -sti2 * %FileName exists in $getdir(%FileName) - $&amp;
      preparing to popup the Resume/Overwrite/Rename dialog if the Accept button is clicked.
  }
}
ctcp *:DCC RESUME*:?:{
  [color:#006600];
  ;    You are sending a file to someone and they have clicked the RESUME button.
  ;[/color]
  echo $color(ctcp) -sti2 * Receiver has requested a DCC RESUME. $+([,$1-,])
}
ctcp *:DCC ACCEPT*:?:{
  [color:#006600];
  ;    You have clicked the RESUME button and the file transfer is being resumed.
  ;[/color]
  echo $color(ctcp) -sti2 * RESUMING DCC Send request. $+([,$1-,])
}



DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C