I'm currently working on a script that manages downloads from multiple DCC bots on multiple chans on multiple networks etc... my problem is, some bots have the same file under a different name. If i were to dload 100mb of afile.exe off bot1, then resume off bot2 who was calling it a_file.exe, is there a way i could change the name back to afile.exe, so that it resumes, not starts again @ the new file name?
This is a script I wrote to unzip zip files, rename the files, move a file, and delete the file from my download folder.
now this is set for text and zip files. if the script recieves a text. It should be no problem renaming a file if you know what you want to remove out of the file name.
on *:FILERCVD:*: {
if .txt isin $filename {
set %rcvname $replace($nick,|,_) $+ .txt
if ( $exists($+(List\,%rcvname)) == $true ) { .remove $+(",List\,%rcvname,") }
.rename $filename $+(",list\,%rcvname,")
$upcnt
halt
}
if .zip isin $filename {
set %rcvname $nick $+ .txt
set %rcvzip $replace($nopath($filename),.zip,.txt)
if ( $exists($+(List\,%rcvname)) == $true ) { .remove $+(",List\,%rcvname,") }
//echo -s $dll(mUnzip.dll, Unzip, $filename "List\")
.remove $filename
.rename $+(",List\,%rcvzip,") $+(",List\,%rcvname,")
$upcnt
halt
}
}
on *:DCCSERVER:GET:{
.rename " $+ $1- $+ " $replace($1-,_,$chr(32))
}
I believe in the example they used it would be $remove($1-,_)
as the replace proc you used would mean the filename would still be different.
here's an example.
you receive
mirc_FAQ from someone,if you $remove _ it wud be mircFAQ if you replace _ with a space it would be mirc FAQ.
You can also make the files to be saved in directories named after the bots names.
I had a script which does that, and it is working gr8.
But don't they all rename the files after the file has been received? I need to change the save location before it has been downloaded so mirc resumes to the right file, not starts another.
Well you can manually rename the file at the dcc get dialog, but I fail to see how this is scriptable. What you can do however is renaming the partially-downloaded
afile.exe to
a_file.exe as the ctcp event arrives, and that will make mirc to resume the download.
ctcp *:dcc send *:?:{
if $nopath($filename) == a_file.exe && $isfile($getdirafile.exe) {
rename " $+ $getdirafile.exe" " $+ $getdira_file.exe"
}
}