mIRC Home    About    Download    Register    News    Help

Print Thread
#11527 16/02/03 04:27 PM
Joined: Feb 2003
Posts: 282
S
Fjord artisan
OP Offline
Fjord artisan
S
Joined: Feb 2003
Posts: 282
I know how to send and receive files with mIRC.
When I receive a file, a box is being opened, and I have the ability to cancel the transfer.
I know that mIRC has "on getfail" that can be used in scripts. The only problem is that it doesn't distinguish between a problem with the transfer, because of connection problem, and between transfer cancel.

I want that if the transfer fails it will write: "ERROR Getting file!!!!", and when I cancel the transfer it will write: "You have canceled the transfer"

How can it be done??

Thanks.

#11528 16/02/03 04:44 PM
Joined: Feb 2003
Posts: 76
G
Babel fish
Offline
Babel fish
G
Joined: Feb 2003
Posts: 76
Hm... i don't think you can do that, and i strongly do so! But think about these 2 and tell me:
1)If you cancel a DCC get, won't you know about it?!
2)Why not only echo "DCC get $filename from $nick failed!"

Hope i've been of some use! smile

#11529 16/02/03 05:01 PM
Joined: Feb 2003
Posts: 282
S
Fjord artisan
OP Offline
Fjord artisan
S
Joined: Feb 2003
Posts: 282
It was just an example.
I don't realy want to tell myself "I just canceled the download". What I'm trying to do is based on this idea.

If I download something, and after 2 minutes there is a transfer problem, (and I'm not near the computer), I can build a script that will auto request the file. The problem is that if I do the cancel, it will also try to resume.

This is what I'm trying to achive.

Anyone knows how can it be done?

#11530 16/02/03 06:23 PM
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
One way around:
Code:

on *:getfail:*:{
  if !$appactive || $active != Get $nick $nopath($filename) {
    echo -s Requesting resume...
  }
}

This one will always react, unless mIRC is the active application, and its active window is the DCC get one (which has to be active when you click the 'Cancel' button...).

#11531 16/02/03 07:01 PM
Joined: Feb 2003
Posts: 76
G
Babel fish
Offline
Babel fish
G
Joined: Feb 2003
Posts: 76
But what if he also wants to take a look at how much of the file has been downloaded? Your idea is brilliant (no joke), but listen to mine too:
Make an alias to toggle auto-request upon failure on/off:
Code:
 aruf { 
  if ($1 == on) { 
    set %aruf on
    echo -a Auto-request upon failure enabled!
  } 
  elseif ($1 == off) { 
    set %aruf off
    echo -a Auto-request upon failure disabled!
  } 
  else { 
    echo -a Auto-request upon failure is %aruf
  } 
} 

...and then remotes:
Code:
 on *:GETFAIL:*: { 
if (%aruf == on) { 
(resume it here, bored to write the code:P)
 } } 
 

Choose saragani wink

#11532 16/02/03 07:48 PM
Joined: Feb 2003
Posts: 282
S
Fjord artisan
OP Offline
Fjord artisan
S
Joined: Feb 2003
Posts: 282
gerdigos, your idea is nice. Actualy I created a script which is very similar to this one. When there is a "transfer failed" error, it sets up a timer for the resuming, and also a dialog is being opened, which asks if to cancel the resuming. After 15 seconds, the dialog is being auto-closed, and the download will be resumed.
If I cancel the download, and I want to cance; the resuming, I need to click on "Yes" in the dialog.

What I wanted to do is that it will not have to ask me about it.


Online. I see that you are a very smat guy smile. I might try your idea, but the only problem I fear from is that I might leave the get windows active, and then the resume will not work when a real failur happens.

#11533 16/02/03 07:56 PM
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
Yea, that's a disadvantage... a scripted dialog is the best way to know whether you cancelled it yourself, or was it an error.

#11534 16/02/03 08:01 PM
Joined: Feb 2003
Posts: 282
S
Fjord artisan
OP Offline
Fjord artisan
S
Joined: Feb 2003
Posts: 282
Ok.

Thank you for your response.

#11535 17/02/03 01:55 PM
Joined: Feb 2003
Posts: 76
G
Babel fish
Offline
Babel fish
G
Joined: Feb 2003
Posts: 76
saragani you're a wise guy too, you know! I never thought it could be done that way! This shows that you have to THINK to solve your problem. That's what programming is all about wink


Link Copied to Clipboard