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 >
Text File  |  1990-04-28  |  5KB  |  182 lines

  1. Elric28.mod/elric28.zip
  2. Hello, and welcome to Elric's Mod #28. I have been writing a
  3. bunch of these lately, just a bunch of ideas floating around my head, and now
  4. I have had time to do them...
  5.  
  6. OK, here it is. The semi-automatic mod extractor. Now, it's really nice of
  7. Moribund/The other Wayne/Mr. Modnet to collect mods for us, and this mod was
  8. written as much for him as for me. What it does is kind of automate
  9. the collection of mods. All you have to do is decide on a dir to store
  10. them in, and keep a little piece of paper somewhere telling you what the
  11. next free number is. For example, say you have mod1.txt-mod27.txt already.
  12. Next mod you extract, tell it 28, it fills in "D:\wwiv\mods\modxxxx.txt
  13. for you, and sticks 28 in for xxxx.
  14.  
  15. Of course, you should configure this for whatever dir/name you want.
  16. If you prefer to store them as Mxxx.mod, that's fine too....just
  17. customize the sprintf statement. Ok, on with the mod.
  18.  
  19. /** this step is indeed a form step, much like a form letter **/
  20. 1. From DOS, in your dir where you keep your source....
  21.  
  22. PKZIP SOURCE *.c *.h
  23.  
  24. If you already have a source zip file, then
  25.  
  26. PKZIP -f source *.c *.h
  27.  
  28. This way you have a copy of everything before you screw it up with a bad mod.
  29. If you decide to take the mod out, it's as easy as
  30. PKUNZIP -x source
  31.  
  32. and hit Y to overwrite any files you changed.
  33.  
  34. /** we now resume our regularly scheduled mod with step 2.... **/
  35.  
  36.  
  37. 2. Now load up MSGBASE1.C Look down till you find extract_out. Replace
  38. it with this one.
  39.  
  40.  
  41. ----------------new extract_out------------------------------
  42.  
  43. void extract_out(char *b, long len, char mod)
  44. {
  45.   char s[81],s1[81],s2[81];
  46.   int i;
  47.  
  48. switch (mod) {
  49. case 1:
  50.     do {
  51.       prt(2,"Save under what filename? ");
  52.       input(s1,12);
  53.       if (s1[0]) {
  54.     strcpy(s2,syscfg.gfilesdir);
  55.     strcat(s2,s1);
  56.     if (exist(s2)) {
  57.       nl();
  58.       pl("Filename already in use.");
  59.       nl();
  60.       prt(5,"Overwrite? ");
  61.       if (!yn())
  62.         s1[0]=0;
  63.       nl();
  64.     }
  65.       } else
  66.     s2[0]=0;
  67.     } while ((!hangup) && (s2[0]!=0) && (s1[0]==0));
  68.     break;
  69. case 2:
  70.     do {
  71.       prt(2,"Next Free mod number?");
  72.       input(s1,5);
  73.       if (s1[0]) {
  74. /** change next line for you own dir and file name format **/
  75.     sprintf(s2,"D:\\wwiv\\mods\\mod%s.txt",s1);
  76.     if (exist(s2)) {
  77.       nl();
  78.       sprintf(s,"File %s already exists",s2);
  79.       pl(s);
  80.       nl();
  81.       prt(5,"Overwrite? ");
  82.       if (!yn())
  83.         s1[0]=0;
  84.       nl();
  85.     }
  86.       } else
  87.     s2[0]=0;
  88.     } while ((!hangup) && (s2[0]!=0) && (s1[0]==0));
  89.     break;
  90. }
  91.   if ((s1[0]) && (!hangup)) {
  92.     i=open(s2,O_RDWR | O_BINARY | O_CREAT | O_TRUNC, S_IREAD | S_IWRITE);
  93.     write(i,(void *)b,len);
  94.     close(i);
  95.     print("Message written to: ",s2,".","");
  96.   }
  97.   farfree(b);
  98. }
  99.  
  100.  
  101. 3. Now look down in scan. Need to change a few things there....
  102.  
  103.  
  104.         break;
  105.           case 'E':
  106.         if (so()) {
  107.                   if ((msgnum>0) && (msgnum<=nummsgs)) {
  108.             b=readfile(&(msgs[msgnum].msg),
  109.               (subboards[curlsub].filename),&len);
  110.             extract_out(b,len,1);    /** the ",1" to the end **/
  111.                   }
  112.         }
  113.         break;
  114. /** add these lines. I used F, you can make it whatever you want. As far as
  115.     I can tell the free letters available for use are....
  116.     F,G,H,I,J,K,L,S,X,Y,Z
  117.     If you prefer to use X for eXtract mod, fine with me **/
  118.  
  119.           case 'F':
  120.         if (so()) {
  121.                   if ((msgnum>0) && (msgnum<=nummsgs)) {
  122.                     b=readfile(&(msgs[msgnum].msg),
  123.                        (subboards[curlsub].filename),&len);
  124.             extract_out(b,len,2);
  125.                   }
  126.         }
  127.         break;
  128. /** original code resumes here **/
  129.           case 'M':
  130.         if ((cs()) && (msgnum>0) && (msgnum<=nummsgs)) {
  131.  
  132. 4. Ok. The only thing left to do is to go down and fix up the only other call
  133. to extract_out. Need to add  ",1"  to it since we changed it.  It's down in
  134. readmail.
  135.  
  136.  
  137.             ch=onek("QSRIDAF?-+GZVUO");
  138.           else
  139.             ch=onek("QSRIDAF?+-G");
  140.       switch (ch) {
  141.     case 'E':
  142.           if ((so()) && (okmail)) {
  143.             b=readfile(&(m.msg),"EMAIL",&len);
  144.         extract_out(b,len,1);          /** add the ",1" to me**/
  145.           }
  146.           i2=0;
  147.       break;
  148.         case 'Q':
  149.           done=1;
  150.  
  151.  
  152. 5. I would tell you to go update extract_out in FCNS.H, but since it isn't
  153. there in the first place, don't waste your time. So there is no step 5.
  154.  
  155. 6. Compile it.
  156.  
  157. That's it. Hope it helps you save those mods, and now you have no excuse
  158. for posting things like "Could someone please re-post the xxxxx mod. I didn't
  159. extract it the first time."
  160.  
  161.  
  162.  
  163. /** hey, it's the form info file **/
  164. As usual, I take no responsibility for hard drive crashes, death in the
  165. family, or end of the world as we know it resulting from this mod.
  166. It's your fault if you didn't back up the files before you made the mod.
  167. It's your fault if you don't back up your ENTIRE hard drive AT LEAST once
  168. a month.
  169. It works on my system with Turbo C 2.0, WWIV 4.1, V20/8088, 640K/640EMS.
  170.  
  171. If you use this, the only payment I ask is that you send me a note through
  172. WWIVLink to 1@18251 saying you are using it...not too much to ask is it?
  173.  
  174. The Kingdom of Melnibone(LINK/NET)
  175. 812-877-3488  24 Hrs a day
  176. 3/12/2400/4800/9600/12,000/14,400 baud HST MNP5
  177. Auto-validation of WWIV sysops on first call
  178. Xmodem, Ymodem, DSZ Zmodem with retry, Ymodem-G
  179.  
  180. WWIV Link  1@18251
  181. WWIV Net   1@8251
  182.