home *** CD-ROM | disk | FTP | other *** search
/ The Devil's Doorknob BBS Capture (1996-2003) / devilsdoorknobbbscapture1996-2003.iso / Dloads / WWIVMODS / MODS420.ZIP / PHANTOM3.MOD < prev    next >
Text File  |  1992-01-21  |  5KB  |  184 lines

  1. ┌─────────────────────────────────────────────────────────────────────────┐
  2. │ Phantom3.Mod ── 12-07-91 ─── By Phantom Lord ─── WWIV v4.11 v4.12 v4.20 │
  3. │ Description: Working Enhanced AutoMsg │ Experience: Simple Block Read!  │
  4. │ Files Affected: MISCCMD.C             │ Steps: 3                        │
  5. │ ───    GoldSystem Delayed. Still Typing Out. Keep Your Eyes Open    ─── │
  6. └─────────────────────────────────────────────────────────────────────────┘
  7.  Step 1:
  8.  ──────
  9.  Backup Your Source!!!
  10.  ------------------------------------------------------------------------
  11.  Step 2:
  12.  ──────
  13.  Load MISCCMD.C and delete void read_automessage(),
  14.  void write_automessage1() and void write_automessage().
  15.  ------------------------------------------------------------------------
  16.  Step 3:
  17.  ──────
  18.  Block read the following 3 voids where read_automessage(),
  19.  write_automessage1(), and write_automessage were.
  20.  
  21. void read_automessage()
  22. {
  23.   int i,i1,i2,i3,f,len,ptrbeg[10],ptrend[10];
  24.   char s[81],l[10][81],anon,buf[512];
  25.   slrec ss;
  26.  
  27.   sprintf(s,"%sAUTO.MSG",syscfg.gfilesdir);
  28.   f=open(s,O_RDWR | O_BINARY);
  29.   nl();
  30.   anon=status.amsganon;
  31.   if (f<1) {
  32.     pl("No Auto-Post! Write One!");
  33.   } else {
  34.     len=read(f,(void *)buf,512);
  35.     close(f);
  36.     for (i=0; i<10; i++) {
  37.       ptrbeg[i]=0;
  38.       ptrend[i]=0;
  39.     }
  40.     i=0;
  41.     i1=0;
  42.     i2=0;
  43.     for(i=0; i<len; i++) {
  44.       if (i1) {
  45.         if (buf[i]==10) {
  46.           ptrbeg[i2]=i+1;
  47.           i1=0;
  48.         }
  49.       } else {
  50.         if (buf[i]==13) {
  51.           ptrend[i2]=i-1;
  52.           if (i2<9) {
  53.             for (i3=ptrbeg[i2]; i3<=ptrend[i2]; i3++)
  54.               l[i2][i3-ptrbeg[i2]]=buf[i3];
  55.               l[i2][ptrend[i2]-ptrbeg[i2]+1]=0;
  56.           }
  57.           ++i2;
  58.           i1=1;
  59.         }
  60.       }
  61.     }
  62.     ss=syscfg.sl[actsl];
  63.     if (anon)
  64.       if (ss.ability & ability_read_post_anony) {
  65.         sprintf(s,"%s",&(l[0][0]));
  66.       } else
  67.         strcpy(s,"NoBoDy #xxx");
  68.     else
  69.       strcpy(s,&(l[0][0]));
  70.     nl();
  71.     npr("[══── Auto Post Entered By: %s ──══]\r\n",s);
  72.     nl();
  73.     i=1;
  74.     while ((ptrend[i]) && (i<9)) {
  75.       pl(&(l[i][0]));
  76.       ++i;
  77.     }
  78.   }
  79.   nl();
  80. }
  81.  
  82. void write_automessage1()
  83. {
  84.   int i,i1,f;
  85.   char s[81],l[10][81];
  86.   slrec ss;
  87.  
  88.   nl();
  89.   pl("Write Auto-Post! 9 Lines: Ctrl-P Colors Work Here!");
  90.   s[0]=0;
  91.   nl();
  92.   for (i=0; i<9; i++) {
  93.     outchr(i+'1');
  94.     outchr('>');
  95.     inli(&(l[i][0]),s,77,1);
  96.     strcat(&(l[i][0]),"\r\n");
  97.   }
  98.   nl();
  99.   ss=syscfg.sl[actsl];
  100.   if (ss.ability & ability_post_anony) {
  101.     prt(5,"Anonymous!? [Y/N]: ");
  102.     if (yn())
  103.       i1=anony_sender;
  104.     else
  105.       i1=0;
  106.   } else
  107.     i1=0;
  108.   prt(5,"Is This Ok? [Y/N]: ");
  109.   if (yn()) {
  110.     status.amsganon=i1;
  111.     status.amsguser=usernum;
  112.     save_status();
  113.     sprintf(s,"%sAUTO.MSG",syscfg.gfilesdir);
  114.     f=open(s,O_RDWR | O_BINARY | O_CREAT | O_TRUNC, S_IREAD | S_IWRITE);
  115.     strcpy(s,nam(&thisuser,usernum));
  116.     strcat(s,"\r\n");
  117.     write(f,(void *)s,strlen(s));
  118.     for (i=0; i<9; i++)
  119.       write(f,(void *)&(l[i][0]),strlen(&(l[i][0])));
  120.     sysoplog("-+*+- Changed Auto-Post!");
  121.     for (i=0; i<9; i++) {
  122.       strcpy(s,"   ");
  123.       l[i][strlen(&(l[i][0]))-2]=0;
  124.       strcat(s,&(l[i][0]));
  125.       sysoplog(s);
  126.     }
  127.     nl();
  128.     pl("Auto-Post Saved!");
  129.     nl();
  130.     close(f);
  131.   }
  132.  
  133. }
  134.  
  135. void write_automessage()
  136. {
  137.   char ch;
  138.   int done,okwrite;
  139.   slrec ss;
  140.  
  141.   ss=syscfg.sl[actsl];
  142.   if (ss.posts)
  143.     okwrite=1;
  144.   else
  145.     okwrite=0;
  146.   if (thisuser.restrict & restrict_automessage)
  147.     okwrite=0;
  148.   done=0;
  149.   do {
  150.     nl();
  151.     if (okwrite) {
  152.       prt(2,"Auto-Post! [Read/Write/Email/Quit]: ");
  153.       ch=onek("QRWE");
  154.     } else {
  155.       prt(2,"Auto-Post! [Read/Email/Quit]: ");
  156.       ch=onek("QRE");
  157.     }
  158.     switch(ch) {
  159.       case 'Q':
  160.         done=1;
  161.         break;
  162.       case 'R':
  163.         read_automessage();
  164.         break;
  165.       case 'W':
  166.         write_automessage1();
  167.         break;
  168.       case 'E':
  169.         if (status.amsguser)
  170.           email(status.amsguser,0,0,status.amsganon);
  171.         break;
  172.     }
  173.   } while ((!done) && (!hangup));
  174.  
  175. }
  176.  
  177.  ------------------------------------------------------------------------
  178.  What'd I Tell Ya... Easy As Hell Aint It? Sorry The GoldSystem Is So
  179.  Late, I'm Still Writing Out The 4 Files For It... I'm Trying To Keep
  180.  These In Chronological Order So That's Why This Is PHANTOM3 Instead
  181.  Of PHANTOM2... If You Need Any Help With This Or Any Other Of My Mods,
  182.  Let Me Know, Net-Mail Me.
  183.                                                   -Phantom Lord
  184.  ------------------------------------------------------------------------