home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Devil's Doorknob BBS Capture (1996-2003)
/
devilsdoorknobbbscapture1996-2003.iso
/
Dloads
/
WWIVMODS
/
PRE412.ZIP
/
ELRIC28.MOD
< prev
next >
Wrap
Text File
|
1990-04-28
|
5KB
|
182 lines
Elric28.mod/elric28.zip
Hello, and welcome to Elric's Mod #28. I have been writing a
bunch of these lately, just a bunch of ideas floating around my head, and now
I have had time to do them...
OK, here it is. The semi-automatic mod extractor. Now, it's really nice of
Moribund/The other Wayne/Mr. Modnet to collect mods for us, and this mod was
written as much for him as for me. What it does is kind of automate
the collection of mods. All you have to do is decide on a dir to store
them in, and keep a little piece of paper somewhere telling you what the
next free number is. For example, say you have mod1.txt-mod27.txt already.
Next mod you extract, tell it 28, it fills in "D:\wwiv\mods\modxxxx.txt
for you, and sticks 28 in for xxxx.
Of course, you should configure this for whatever dir/name you want.
If you prefer to store them as Mxxx.mod, that's fine too....just
customize the sprintf statement. Ok, on with the mod.
/** this step is indeed a form step, much like a form letter **/
1. From DOS, in your dir where you keep your source....
PKZIP SOURCE *.c *.h
If you already have a source zip file, then
PKZIP -f source *.c *.h
This way you have a copy of everything before you screw it up with a bad mod.
If you decide to take the mod out, it's as easy as
PKUNZIP -x source
and hit Y to overwrite any files you changed.
/** we now resume our regularly scheduled mod with step 2.... **/
2. Now load up MSGBASE1.C Look down till you find extract_out. Replace
it with this one.
----------------new extract_out------------------------------
void extract_out(char *b, long len, char mod)
{
char s[81],s1[81],s2[81];
int i;
switch (mod) {
case 1:
do {
prt(2,"Save under what filename? ");
input(s1,12);
if (s1[0]) {
strcpy(s2,syscfg.gfilesdir);
strcat(s2,s1);
if (exist(s2)) {
nl();
pl("Filename already in use.");
nl();
prt(5,"Overwrite? ");
if (!yn())
s1[0]=0;
nl();
}
} else
s2[0]=0;
} while ((!hangup) && (s2[0]!=0) && (s1[0]==0));
break;
case 2:
do {
prt(2,"Next Free mod number?");
input(s1,5);
if (s1[0]) {
/** change next line for you own dir and file name format **/
sprintf(s2,"D:\\wwiv\\mods\\mod%s.txt",s1);
if (exist(s2)) {
nl();
sprintf(s,"File %s already exists",s2);
pl(s);
nl();
prt(5,"Overwrite? ");
if (!yn())
s1[0]=0;
nl();
}
} else
s2[0]=0;
} while ((!hangup) && (s2[0]!=0) && (s1[0]==0));
break;
}
if ((s1[0]) && (!hangup)) {
i=open(s2,O_RDWR | O_BINARY | O_CREAT | O_TRUNC, S_IREAD | S_IWRITE);
write(i,(void *)b,len);
close(i);
print("Message written to: ",s2,".","");
}
farfree(b);
}
3. Now look down in scan. Need to change a few things there....
break;
case 'E':
if (so()) {
if ((msgnum>0) && (msgnum<=nummsgs)) {
b=readfile(&(msgs[msgnum].msg),
(subboards[curlsub].filename),&len);
extract_out(b,len,1); /** the ",1" to the end **/
}
}
break;
/** add these lines. I used F, you can make it whatever you want. As far as
I can tell the free letters available for use are....
F,G,H,I,J,K,L,S,X,Y,Z
If you prefer to use X for eXtract mod, fine with me **/
case 'F':
if (so()) {
if ((msgnum>0) && (msgnum<=nummsgs)) {
b=readfile(&(msgs[msgnum].msg),
(subboards[curlsub].filename),&len);
extract_out(b,len,2);
}
}
break;
/** original code resumes here **/
case 'M':
if ((cs()) && (msgnum>0) && (msgnum<=nummsgs)) {
4. Ok. The only thing left to do is to go down and fix up the only other call
to extract_out. Need to add ",1" to it since we changed it. It's down in
readmail.
ch=onek("QSRIDAF?-+GZVUO");
else
ch=onek("QSRIDAF?+-G");
switch (ch) {
case 'E':
if ((so()) && (okmail)) {
b=readfile(&(m.msg),"EMAIL",&len);
extract_out(b,len,1); /** add the ",1" to me**/
}
i2=0;
break;
case 'Q':
done=1;
5. I would tell you to go update extract_out in FCNS.H, but since it isn't
there in the first place, don't waste your time. So there is no step 5.
6. Compile it.
That's it. Hope it helps you save those mods, and now you have no excuse
for posting things like "Could someone please re-post the xxxxx mod. I didn't
extract it the first time."
/** hey, it's the form info file **/
As usual, I take no responsibility for hard drive crashes, death in the
family, or end of the world as we know it resulting from this mod.
It's your fault if you didn't back up the files before you made the mod.
It's your fault if you don't back up your ENTIRE hard drive AT LEAST once
a month.
It works on my system with Turbo C 2.0, WWIV 4.1, V20/8088, 640K/640EMS.
If you use this, the only payment I ask is that you send me a note through
WWIVLink to 1@18251 saying you are using it...not too much to ask is it?
The Kingdom of Melnibone(LINK/NET)
812-877-3488 24 Hrs a day
3/12/2400/4800/9600/12,000/14,400 baud HST MNP5
Auto-validation of WWIV sysops on first call
Xmodem, Ymodem, DSZ Zmodem with retry, Ymodem-G
WWIV Link 1@18251
WWIV Net 1@8251