mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Sep 2003
Posts: 93
T
Talea Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Sep 2003
Posts: 93
This is based on a discusiion in the deveopment forum... What I would like is when I am getting a file I want to know the exact file size (eg: in kb, mb & gb) when I first get the notice that someone is sending me a file.

I already got the coding for whom and what port number (based on above mentioned forum and user ScoT).

This is the code I have so far...
ctcp *:*:*:{ echo -a $timestamp $nick $+ ( $+ $address $+ ) is trying to send you $3 on port $5 $+ . }

What I want is not only the filename (reflected by the $3) but also the specific size I already mentioned.

The coding probably sucks however it works...if the coding needs improving, I don't mind someone helping me on that as well.

Talea

Last edited by Talea; 07/08/04 03:35 AM.
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
Hi,

/help $file

Greets


Gone.
Joined: Sep 2003
Posts: 93
T
Talea Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Sep 2003
Posts: 93
I've read help $file grin

No matter I figure it out in time for myself.

Thanks for the reply.

Talea

Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
$6 will be the file size. You can use $bytes() to convert it into a more logical form of units (ie. KB, MB, GB).


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Joined: Sep 2003
Posts: 93
T
Talea Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Sep 2003
Posts: 93
Thanks for the reply. I found that out mainly by trial and error but got the result $bytes($6,3k).suf which does the trick.

Talea

Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Except $6 won't always be the file size, nor will $5 always be the port number or $4 the IP. Those are only true if filename has no spaces in it.
See the fix in the other thread


Link Copied to Clipboard