1[2DAWG03B.MOD1] 0 Time Compensation For Posting Dawg #1 @13498 Sun Feb 14 00:23:25 1993 ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» º MOD :DAWG03B.MOD - Time Compensation For Posts º º DATE :02/14/93 º º USAGE :WWIV 4.22 º º VERSION :1.20 º º Descrip.:Gives posters their time back for posting. º º Diff. :2 (on a scale of 1-10, 1 being easy) º º Author :6Dawg0 116@134722/116@1134980 º º BBS :6Thunder2world0 º º Thanx to:4Fish7Bone0 of 7Star4Base0 4Fish7Bone0 (3478 net/13454 link) º º for beta testing this mod and for his countless suggestions º º some of which were implemented. º º 1Tolkien0 of the 1Fellowship0 (3456 net) for the basic idea. º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ Okay here is DAWG03B.MOD. It it a time compensation mod for posts. Basically this mod came from Too $hort (no longer in the net), and the basic idea came from Tolkien (1@3456 net). Now that we have that out of the way, on to the mod. Basically Too $hort's mod is a good mod; however, there were a couple of things I didn't like about it. One is that it gave the time back for posts but also email. I have taken care of that, although if you delete two small lines you can put it back in. Also, it only told how many minutes of time it gave back. Basically nothing wrong with that, but it looked weird if a post took less than one minute. The last thing was that while I am not really a 'C' programmer, I do have a decent knowledge of Pascal. Well I decided that the Div command would be much more workable and require less code that Too $hort's method. I then looked through the commands for 'C'. Much to my suprise, the Div command in 'C' is much nicer than the one I used in Pascal. It returns the quotient and remainder. Makes the mod much more simple and takes less code. Please back up your source first. This is a simple mod, but in case something goes wrong you will have a working copy that way. This mod does NOT remove time for posts removed. The reason is that it only gives the amount of time spent on making the post. So they are only getting reimbursed for the whole time spent on making a post. Nothing extra (although it would be simple to do that as well), so if they post just to get bonus time, they aren't doing theyselves any good. ============================================================================ Revision history: rev 1.0 - Original mod, worked pretty well. Released as Dawg03.Mod. rev 1.1 - Rewritten to use less code. More efficient as well. Made sure it's compatible with 4.20e. Released as Dawg03a.Mod. rev 1.2 - Made sure it's compatible with 4.22. Released as Dawg03b.Mod. ============================================================================ The entire mod is in void inmsg which is in MSGBASE.C. You need to add the following to the variable declarations at the top. ------------------------------------------------------------- double start,end,totalt; /* ADD */ div_t tcomp; /* ADD */ ------------------------------------------------------------- Then add this line immediately after all the declarations ------------------------------------------------------------- start=nsl(); /*ADD*/ ------------------------------------------------------------- Now here is the bulk of the code. I would suggest block reading it in. --------------------------------------------------------------- outstr(get_string(91)); /*existing line*/ /***********************************************************************/ /*** Add this entire section of code. ***/ /***********************************************************************/ nl(); end=nsl(); totalt=start-end; tcomp=div(totalt,60); if (strcmp(aux,"EMAIL")!=0) { /* Note 1 */ if (tcomp.quot!=0) { sprintf(s,"1Granted 2%u 1Minute",tcomp.quot); if (tcomp.quot!=1) strcat(s,"1s"); strcat(s,"1 and"); } else strcpy(s,"1Granted"); if (tcomp.rem!=0) { sprintf(s1," 2%u 1Second",tcomp.rem); if (tcomp.rem!=1) strcat(s1,"1s"); } strcat(s1," for that post."); strcat(s,s1); pl(s); thisuser.extratime+=totalt; } /* NOTE 1 */ /*************************************************************************/ /*** Original code starts back up here ***/ /*************************************************************************/ if (fsed) { --------------------------------------------------------------------------- Okay, I did not want to give time compensation for emails. If you wish to do that, just delete the two lines that say /* NOTE 1 */. That will then give compensation for emails and feedbacks. Well a couple of things here: 1) BACK UP YOUR SOURCE! 2) I am NOT RESPONSIBLE if (insert your favorite disaster here)! 3) I will provide any help I can if you need it. Feel free to email me at either of the above addresses. Well that's all for now! 6DAWG