home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Devil's Doorknob BBS Capture (1996-2003)
/
devilsdoorknobbbscapture1996-2003.iso
/
Dloads
/
WWIVMODS
/
MODSUNKN.ZIP
/
BATCHDL2.MOD
< prev
next >
Wrap
Text File
|
1992-12-01
|
6KB
|
199 lines
Parker Prospect #1 @9964
Sat Mar 24 09:19:51 1990
+---------------------------------------------------------+
+ A Simple Yet Powerful Batch Download Mod +
+---------------------------------------------------------+
This mod was created because of the flurry of ultra-complicated
batch download mods that have recently been released, and all of them
are either too buggy (VARBATCH) or very complicated (Bilbo's). This
mod is not a "flame" to them, but I was simply dissatisfied with
what they could have done more easily and effectively.
Now, what I did for this mod was simply take the three most popular
batch protocols (DSZ's Ymodem, Zmodem, and Matt T.'s PUMA) and
use them in the most easily adaptable way.
NOTE TO HIGH SPEED SYSOPS: Due to the way WWIV arranges its modem
speeds, and the unique configurations of high speed modems,
slight modification may be required to the command lines. You can
call my BBS (described at the end of this mod) for help, if need
be.
************************************
************** Legend **************
************************************
* %% Delete Line *
* -- Search for Line, DON'T CHANGE *
* ++ Add Line *
* -+ Modify Line *
************************************
------------------------------------------------------------------------
Step #1 <XFER.C>: THE ONLY STEP!!!!!!!!!!!!!
Delete the ENTIRE "void batchdl" from XFER.C and
replace it with the one listed below.
void batchdl()
{
FILE *f;
int i,abort,done,i1,i2,had,rr;
char s[81],s1[81],xxx[81],ch,ch2,numb;
double percent;
uploadsrec u;
done=0;
if (numbatch==0) {
nl();
pl("No files in queue.");
nl();
return;
}
do {
nl();
prt(2,"Batch: L,D,R,Q,C,? : ");
ch=onek("Q?CLRD");
switch(ch) {
case '?':
printmenu(9);
break;
case 'Q':
done=1;
break;
case 'L':
listbatch();
break;
case 'R':
nl();
prt(2,"Remove which? ");
input(s,2);
i=atoi(s);
if ((i>0) && (i<=numbatch)) {
delbatch(i-1);
}
if (numbatch==0) {
nl();
pl("Batch queue empty.");
nl();
done=1;
}
break;
case 'C':
prt(5,"Clear queue? ");
if (yn()) {
numbatch=0;
batchtime=0.0;
done=1;
pl("Queue cleared.");
}
break;
case 'D':
if (!incom)
break;
nl();
prt(2, "[Y]modem, [Z]modem, [P]uma, or [Q]uit? ");
ch2 = onek("QPYZ");
if (ch2 == 'Q')
break;
prt(5,"Hang up after transfer? ");
had=yn();
nl();
sprintf(s,"Transmitting: Files - %d Time - %s",numbatch,ctim(batchtime));
pl(s);
nl();
rr=0;
if ((syscfg.req_ratio>0.0001) && (ratio()<syscfg.req_ratio))
rr=1;
if (thisuser.exempt & exempt_ratio)
rr=0;
if (rr) {
nl();
pl("Sorry, your ratio is too low.");
nl();
break;
}
strcpy(s,"BATCHDWN.LST");
f = fopen("BATCHDWN.LST","w");
for (i=0; (i<numbatch); i++ ) {
strcpy(xxx,directories[batchdir[i]].path);
strcat(xxx,stripfn(batchfn[i]));
fprintf(f,"%s\n",xxx);
}
fclose(f);
switch(ch2) {
case 'Y':
sprintf(s1,"DSZ port %c speed %s pB4096 sb -k @%c:BATCHDWN.LST",
syscfg.primaryport+'0',curspeed,getdisk()+'A');
break;
case 'Z':
sprintf(s1,"DSZ port %c speed %s pB4096 sz @%c:BATCHDWN.LST",
syscfg.primaryport+'0',curspeed,getdisk()+'A');
break;
case 'P':
sprintf(s1,"PUMA p%c E%s B+ HF N+ X+ S @%c:BATCHDWN.LST",
syscfg.primaryport+'0',curspeed,getdisk()+'A');
break;
default:
break;
}
set_protect(0);
run_external(s1);
topscreen();
numb = numbatch;
for (i2 = 0 ; i2<numb ; i2++ ) {
dliscan1(batchdir[0]);
i=recno((batchfn[0]));
if (i<=0) {
delbatch(0);
} else {
lseek(dlf,(long) (i * sizeof(uploadsrec)),SEEK_SET);
read(dlf,(void *)&u,sizeof(uploadsrec));
strcpy(s,directories[batchdir[0]].path);
strcat(s,u.filename);
++thisuser.downloaded;
thisuser.dk += (int) ((u.numbytes+1023)/1024);
++u.numdloads;
lseek(dlf,(long) (i*sizeof(uploadsrec)),SEEK_SET);
write(dlf,(void *)&u,sizeof(uploadsrec));
switch (ch2) {
case 'Z':
strcpy(s, "Zmodem Batch Download: ");
break;
case 'Y':
strcpy(s, "Ymodem Batch Download: ");
break;
case 'P':
strcpy(s, "Puma Batch Download: ");
break;
}
strcat(s,u.filename);
sysoplog(s);
closedl();
delbatch(0);
}
}
strcpy(s,"BATCHDWN.LST");
unlink(s);
if (had)
hangup=1;
done=1;
break;
}
} while ((!done) && (!hangup));
}
------------------------------------------------------------------------
Final Step
Compile the BBS... and look for more mods by Parker Prospect!
------------------------------------------------------------------------
Disclaimer
I, Jeff Garzik, claim no liability for this mod, or for any damage that
may have resulted from the use of this mod. I also attach no
warranty, expressed OR implied, to this product.