mIRC Home    About    Download    Register    News    Help

Print Thread
#89183 04/07/04 03:46 PM
Joined: Jul 2004
Posts: 1
O
oxygen Offline OP
Mostly harmless
OP Offline
Mostly harmless
O
Joined: Jul 2004
Posts: 1
Hi! laugh
How can one calculate the time left for a DCC transfer (send or get) to be completed?

I've tryed these two codes, alternately, for the 1st DCC Get:

$duration($calc(($get(1).size - $get(1).rcvd) / ($get(1).rcvd / $get(1).secs)))

$duration($calc(($get(1).size - $get(1).rcvd) / $get(1).cps))

I've used a timer, with both codes above, however i've noticed they do not display the same duration as presented on mIRC's DCC transfer window. confused

Can someone tell me what's wrong?

Thanks in advance!! smile


O2
#89184 04/07/04 05:31 PM
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
This may mean that mirc does not calculate the time left based on the current speed of the transfer. It may follow a lot of different algorithms. One of them could be based on average speed:

time left = time elapsed * (remaining bytes / received bytes)

in scripting terms this would be
$calc($get(1).secs * ($get(1).size - $get(1).rcvd) / $get(1).rcvd)

which can be simplified to
$calc($get(1).secs * ($get(1).size / $get(1).rcvd - 1))

and, in turn, to this:
$calc($get(1).secs * (100 / $get(1).pc - 1))


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com

Link Copied to Clipboard