home *** CD-ROM | disk | FTP | other *** search
/ The Devil's Doorknob BBS Capture (1996-2003) / devilsdoorknobbbscapture1996-2003.iso / Dloads / WWIVMODS / MODSUNKN.ZIP / BDAY.MOD < prev    next >
Text File  |  1990-10-07  |  5KB  |  110 lines

  1. East Bay Ray #1 @9964
  2. Wed Oct 03 22:31:49 1990
  3.                    HAPPY BIRTHDAY MODIFICATION (BDAY412.MOD)
  4.                          By Walter Liebkemann (@5404)
  5.                Auto-Message Modification By The Captain (@2370)
  6.                     v4.12 Conversion by East Bay Ray 1@9964
  7.  
  8.  
  9. ================================================================================
  10. This modification will say, "Happy Birthday!" to a user on that user's first
  11. call after his/her birthday. It will also present the user with a gift of 50
  12. gold pieces (or however many you want to give, if any), and it will change the
  13. auto-message to let everybody else know whose birthday it is. The latter two
  14. features are optional. If you do not want to give your users any gold, you
  15. don't have to. If you don't want the auto-message to say whose birthday it is,
  16. that is also your choice. All code changes are in BBSUTL.C.
  17.  
  18. ================================================================================
  19.  
  20. Search for void logon() and add the following variable declarations:
  21.  
  22. void logon()                          /* EXISTING LINE */
  23. {                                     /*       "       */
  24.   char s[255],s1[81],s2[81],*ss;      /*       "       */
  25.   int i,i1,f;                         /*       "       */
  26.   long len,pos;                       /*       "       */
  27.   char s3[31], l[4][81];              /*      ADD      */
  28.  
  29. Also in void logon, search for the following lines:
  30.  
  31.   if (thisuser.year) {
  32.     s[0]=years_old(thisuser.month,thisuser.day,thisuser.year);
  33.     if (thisuser.age!=s[0]) {
  34.       thisuser.age=s[0];
  35.  
  36. and add the following block of code. If you do not want to give any gold on the
  37. user's birthday, do not include the lines marked with /**/.
  38.  
  39.       nl(); nl(); nl();
  40.       prt(3," --==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--");
  41.       nl();
  42.       prt(5,"  Happy Birthday to you, Happy Birthday to you, Happy Birthday");
  43.       nl();
  44.       ansic(5);
  45.       print("  dear ",thisuser.name,", Happy Birthday to you!","");
  46.       nl();
  47.       prt(3," --==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--");
  48.       nl(); nl();
  49. /**/  prt(2,"     The SysOp presents you with 50 shiny gold pieces as a");
  50. /**/  nl();
  51. /**/  prt(2,"                 birthday present from the BBS!");
  52. /**/  nl();
  53.       prt(3," --==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--");
  54.       nl();
  55.       pausescr();
  56. ----------------------------------------------------------------------------
  57. Add the following block of code immediately after the above block if you want
  58. the auto-message to be changed to say whose birthday it is.
  59.  
  60.       itoa(thisuser.age,s3,10);
  61.       strcpy(&(l[0][0]),"Happy Birthday wishes are extended to ");
  62.       strcat(&(l[0][0]),thisuser.name);
  63.       strcat(&(l[0][0]),",");
  64.       strcat(&(l[0][0]),"\r\n");
  65.       strcpy(&(l[1][0]),"who is now ");
  66.       strcat(&(l[1][0]),s3);
  67.       strcat(&(l[1][0])," years old!");
  68.       strcat(&(l[1][0]),"\r\n");
  69.       status.amsganon=0;
  70.       status.amsguser=usernum;
  71.       save_status();
  72.       strcpy(s,syscfg.gfilesdir);
  73.       strcat(s,"AUTO.MSG");
  74.       f=open(s,O_RDWR | O_BINARY | O_CREAT | O_TRUNC, S_IREAD | S_IWRITE);
  75.       strcpy(s,"The Management");                /* SEE NOTE BELOW */
  76.       strcat(s,"\r\n");
  77.       write(f,(void *)s,strlen(s));
  78.       for (i=0; i<2; i++)
  79.         write(f,(void *)&(l[i][0]),strlen(&(l[i][0])));
  80.       sysoplog("Happy Birthday Auto-Message");
  81.       for (i=0; i<2; i++) {
  82.         strcpy(s,"   ");
  83.         l[i][strlen(&(l[i][0]))-2]=0;
  84.         strcat(s,&(l[i][0]));
  85.         sysoplog(s);
  86.       }
  87.       close(f);
  88.       thisuser.gold +=50.0;     /* ADD THIS LINE IF YOU WANT TO GIVE GOLD */
  89.     }                                                    /* EXISTING LINE */
  90.   } else {                                               /*       "       */
  91.     nl();                                                /*       "       */
  92.     pl("Please enter the following information:");       /*       "       */
  93.  
  94. -----------------------------------------------------------------------------
  95. Note: The Auto-Message will say it was written by "The Management" without a
  96. user number. You can change this to whatever you want (ie, The Birthday
  97. Committee, The SysOp, President Bush, etc.)
  98.  
  99. That's all there is to it. Now everybody will know whose birthday it is.
  100. Auto-replying to the auto-message will result in a letter addressed to the
  101. birthday boy or girl, so users can use that to add happy birthday wishes if
  102. they choose.
  103. -----------------------------------------------------------------------------
  104.                                   DISCLAIMER
  105.          That's the end of the modification; all's been said and done.
  106.         I doubt there's ever been a time when you've had this much fun.
  107.       So if this mod causes a problem to which there's no easy solution;
  108.             Recall I've not nor will I ever ask for a contribution.
  109.  
  110.              The Captain of The White Star Line (System Long Gone)