home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Devil's Doorknob BBS Capture (1996-2003)
/
devilsdoorknobbbscapture1996-2003.iso
/
Dloads
/
SYSOP
/
MODS1.ZIP
/
SPV-017H.MOD
< prev
next >
Wrap
Text File
|
1995-06-04
|
18KB
|
464 lines
Papa Bear #1 @11579
7Thursday1, 7June 11, 71995 2 86:217 am
0R 34 06/04 18:34 WWIVnet ->8339
0R 34 06/04 16:40 WWIVnet 8314->8304
0R 34 06/04 08:31 WWIVNET 4001->8314
0R 34 06/04 11:42 WWIVnet 4000->4001
0R 34 06/03 07:50 WWIVnet ->4000
0R 34 06/01 10:03 WWIVnet 4001->4000
0R 34 06/01 17:26 WWIVnet 11579->4001
0R 34 06/01 08:17 WWIVnet ->11579
4Msg. Status:9▄ 5Please reply!
9 ▀▀▀▀▀▀▀▀▀▀▀▀
┌────────────────────────────A CEREBRUM RELEASE!─────────────────────────────┐
│ Mod Name: SPV-017H.MOD Mod Authors: Pâpâ ßêâr (1@11579.wwivnet) │
│ Difficulty: ▓▓░░░░░░░░ First: [08/07/93] │
│ WWIV Version: 4.24 Last: [06/01/95] │
│ Files Affected: LILO.C MMENU.C SYSOPF.C STRINGS.C{?} FCNS.H VARDEC.H │
│ Description: Puts random words of wisdom at logon, or above prompts or │
│wherever you want to use them. The mod will not display ANY entered strings│
│until you, the sysop, approve them. │
╞═────────────────────────────────────═╤═───────────────────────────────────═╡
│ StarPort Valhalla [ ] - ASV 28.8kbps Home of the SPV mod series! │
└─────────────────────────────────────═╧═────────────────────────────────────┘
>>> OFFICIAL WWIV SUPPORT SITE! <<<
Word of Warning: You installed it, you're responsible! Make back-ups BEFORE
attempting to install this modification! Read all text before beginning.
─────────────────────────────────────────────────────────────────────────────
LEGEND:
== Original Code [use this to search on]
++ Add this Line [mods ALWAYS add stuff, don't they?]
... Skipping down some code in the same function.
─────────────────────────────────────────────────────────────────────────────
LONG DESCRIPTION: What this does is place a random saying above the main
prompt, or where ever you want it to. Kinda like SPV-004C.MOD (That one does
not allow for user input. I use both, now, one at all my prompts, and the
other at logon.)
Why this is different is this allows for letting your USER'S input into the
file. Kinda like what a VBBS I call allows you to do.
FEATURES:
o Fully random.
o Allows user to enter lines into your .STR database.
o Allows for color inputs.
o Auto-detects if defined .STR file exists. If it doesn't, it automatically
prompts you to enter the first string, at which point it creates the file
for you. No need for an external string manager.
o Set up to only a MINIMUM SL to use.
o Doesn't bug you, as a SysOp, with the strings. (Unless you want it to.)
o Puts user's name in the string, so you all know who entered it.
o Variable length input fields. Determined by user's handle length.
o Full SysOp Log and SSM support.
o Fills in NULL [empty] strings. Now you can delete old strings, and the mod
will automatically fill in the dead spots.
[12/31/93 *MINOR* MODIFICATIONS]
o Now prints the "I'm looking for a place to put it" message only if the
string file grows larger than 200 strings.
o Removed altogether the restrictions that prevented the SysOp viewing the
random strings.
[06/05/94] Little, more, uh, common sense.
o Changed the "...looking for a place to put it". It appears in the right
place, and erases itself when an empty space *is* found.
o Shortened up the code somewhat.
o Added code that allows you to validate each string. If you say that a
string is NOT okay, then it is automatically removed from the STR file.
[11/18/94]
o Made it so that the ^ command will allow listing all valid strings.
[11/22/94]
o It will now not display ANY strings until you approve of them.
o Added (V)alidate command as subcommand to ^ from main prompt.
o Beginday coding so that if 017H.$$$ gets inadvertantly deleted, the
beginday check will go through and re-examine the string file for any
unvalidated strings and recreate 017H.$$$ is any are found.
[06/01/95]
o 4.24 compatible coding.
o Added another mode of operation -- perfect for above prompt use.
THANKS:
Money-Mac (1@5084 WWIVnet) for the idea to let users input their own strings.
Captain EJ (1@5057 WWIVnet) for the idea to make it fill in NULL strings.
Lestat The Immortal (1@3325 WWIVnet) for pointing out that I had left a very
important step out. And for E-Mailing me AGAIN with his information!
Natas (1@2761.wwivnet) for suggesting the "read all strings" change *AND*
for the save (and not display) until approved idea!
All the users of StarPort Valhalla who use and like this mod!
─────────────────────────────────────────────────────────────────────────────
STEP 1: ADD the following line to BBSUTL.C
== set_strings_fn(2, languagedir, "YES.STR", 0);
== set_strings_fn(3, languagedir, "NO.STR", 0);
++ set_strings_fn(RAN_FILENUMB, languagedir, RAN_FILENAME, 0); // SPV-017H
==
== strncpy(str_yes,get_string(1), sizeof(str_yes)-1);
─────────────────────────────────────────────────────────────────────────────
STEP 2: ADD these functions to the end of BBSUTL.C:
// START BLOCK COPY SPV-017H
void ran_strings (int mode)
{
char s[81],s1[81],s2[81];
int ls,i,Done;
ls=(79-(strlen(thisuser.name)+4));
sprintf(s,"%s%s",syscfg.gfilesdir,RAN_FILENAME);
if (!exist(s)) {
if (thisuser.sl!=255) {
pl("6Random sayings file doesn't exist. Notifying sysop.0");
sprintf(s1,"%s does not exist -- need to create it!",RAN_FILENAME);
ssm(1,0,s1);
sysoplog(s1);
} else {
nl();
npr("2Please enter a saying to start your %s file.0",RAN_FILENAME);
nl();
add_ran_strings(ls);
}
} else {
switch (mode) {
case 0:
nl();
strcpy(s1,thisuser.name);
properize(s1);
npr("5A saying for 1%s 5from 1%s5:0",s1,syscfg.systemname);
nl();
do {
strcpy(s2,(getrandomstring(RAN_FILENUMB)));
} while ((s2[0]==NULL) || (s2[0]=='»'));
npr("9\"1%s9\"0\r\n",s2);
break;
case 1:
nl();
pl("3Do you want to enter your own saying?0");
npr("5[to be displayed, at random, with others] 0");
if (yn()) {
nln(2);
npr(
"9Please enter your saying [1%u9 characters]. 2ENTER 9aborts0",ls);
nl();
add_ran_strings(ls);
} else {
nln(2);
pl("6Aborted0");
}
nl();
break;
case 2:
nl();
Done=0;
for (i=0;(i<num_strings(RAN_FILENUMB)) && (!Done);i++) {
strcpy(s,get_stringx(RAN_FILENUMB,i));
if ((s[0]) && (s[0]!='»'))
pl(s);
Done=inkey();
}
break;
case 3:
do {
strcpy(s2,(getrandomstring(RAN_FILENUMB)));
} while ((s2[0]==NULL) || (s2[0]=='»'));
pl(s2);
break;
}
}
close_strfiles();
}
void add_ran_strings (int lenstr)
{
char s[255],s1[255],s2[161],s3[81];
int entrynum;
FILE *note;
if (num_strings(RAN_FILENUMB)>70)
npr("6>2Please be patient, I'm looking for a place for it!6<0");
entrynum=empty_slot();
if (num_strings(RAN_FILENUMB)>70) {
while (WhereX())
backspace();
}
set_strings_fn(RAN_FILENUMB,syscfg.gfilesdir,RAN_FILENAME,1);
mpl(lenstr);
inli(s,"",lenstr,1);
nl();
if (s[0]==0) {
pl("Aborted!");
if ((entrynum==1) && (num_strings(RAN_FILENUMB)<2)) {
sprintf(s3,"%s%s",syscfg.gfilesdir,RAN_FILENAME);
unlink(s3);
}
return;
} else {
npr("2Use this string?0 ");
if (ny()) {
nl();
strcpy(s2,thisuser.name);
sprintf(s1,"»%s - %s",s,s2);
put_string(RAN_FILENUMB,entrynum,s1);
if ((note=fsh_open("017H.$$$","wt"))!=NULL) {
fprintf(note,"There are unvalidated strings in %s...",
RAN_FILENAME);
fputs("\n\n",note);
fprintf(note,"Do not delete this file!");
fsh_close(note);
} else {
sprintf(s,
"6%%% 2Unable to create 017H.$$$ in your main BBS directory!0");
ssm(1,0,s);
sysoplog(s);
}
} else {
nl();
pl("6Aborted!0");
}
nl();
}
}
int empty_slot(void)
{
int i;
for (i=1;num_strings(RAN_FILENUMB);i++) {
if (strlen(get_stringx(RAN_FILENUMB,i))==NULL)
return(i);
}
return(num_strings(RAN_FILENUMB)+1);
}
void ValidateStrings(void)
{
int i=-1,i1=1;
char ch,s[81];
nl();
npr("5Validate random saying strings in 1%s 5now?0 ",RAN_FILENAME);
if (yn()) {
nl();
pl("4Looking for unvalidated strings!0");
nl();
set_strings_fn(RAN_FILENUMB,syscfg.gfilesdir,RAN_FILENAME,1);
while ((!hangup) && (++i<=num_strings(RAN_FILENUMB))) {
strcpy(s,get_stringx(RAN_FILENUMB,i));
if (s[0]=='»') {
nl();
npr("9Entry number 1%d2:0",i);
nl();
pl(s);
npr("5Is this okay? 3(2Y1es3/1no3/1quit3)0 ");
ch=onek("\rYNQ");
switch (ch) {
case '\r':
case 'Y':
pl("5Saving this entry! 3(9Stripping 1»3)0");
put_string(RAN_FILENUMB,i,&s[1]);
break;
case 'N':
pl(
"6Deleting this entry! 3(2Position available for reuse.3)0");
put_string(RAN_FILENUMB,i,"");
break;
case 'Q':
pl("6Aborting before all entries have been validated!0");
i1=0;
break;
}
}
}
close_strfiles();
}
if (i1)
unlink("017H.$$$");
}
// END BLOCK COPY -- SPV-017H
NOTE: You'll notice at times that there is a file in your main BBS directory
called 017H.$$$. DO NOT DELETE THIS FILE. It is how the modification
know there are unvalidated strings. It will be deleted just as soon
as you validate (or delete) ALL unvalidated strings.
NOTE: If viewing strings with an string manager program such as ESE or ESM,
you may notice that some begin with ». This » is the marker that
indicates an unvalidated string. Once validated the » is removed. You
*CAN* do this with your string manager if you want, but it is not
required -- this mod will take of those.
─────────────────────────────────────────────────────────────────────────────
STEP 3: ADD these three lines to FCNS.H
== int set_language(int n);
== void cd_to(char *s);
== void get_dir(char *s, int be);
++ void ran_strings (int mode); // SPV-017H
++ void add_ran_strings (int lenstr); // SPV-017H
++ int empty_slot(void); // SPV-017H
++ void ValidateStrings(void); // SPV-017H
==
== /* File: bbsutl1.c */
─────────────────────────────────────────────────────────────────────────────
STEP 4: Add the following lines to VARDEC.H
== #ifndef _VARDEC_H_
== #define _VARDEC_H_
==
++ #define RAN_FILENAME "RANSTR.STR" // SPV-017H
++ #define RAN_FILENUMB 5 // SPV-017H NOTE!!!
==
== #ifndef __OS2__
== #define RIPDRIVE
NOTE!!!: You can change this value to anything from 4 to 7 without having to
modify anything other file. If you change it to anything GREATER THAN 6,
then you need to change this line in STRINGS.C to the number you have here,
plus 1: (So if you entered 8 for this step, you'd enter 9 here.)
#define MAX_STRFILES 8
─────────────────────────────────────────────────────────────────────────────
STEP 5: Add the ^ command to MMENU.C
== } else
== pl(get_string(8));
== break;
// START SPV-017H
case '^':
nln(2);
npr("5Do you want to 1R2)5ead0");
if ((exist("017H.$$$")) && (so())) {
npr("5, 1W2)5rite, 1V2)5alidate, or 6Q2)5uit? 0");
ch=onek("QRVW");
} else {
npr("5 a saying, 1W2)5rite a saying, or 6Q2)5uit? 0");
ch=onek("QRW/r");
}
nl();
switch(ch) {
case 'V':
ValidateStrings();
break;
case 'R':
npr("5View all the entries? 0");
if (yn())
ran_strings(2);
else
ran_strings(0);
break;
case 'W':
if (thisuser.sl>29) // NOTE 1
ran_strings(1);
else
pl("6Your security access is too low for this command.0");
break;
case '/r':
case 'Q':
pl("6Aborted0");
break;
}
nl();
break;
// END SPV-017H
== case '.':
== helpl=26;
== write_inst(INST_LOC_CHAINS,0,INST_FLAGS_ONLINE);
NOTE 1: If you want SL 20 to access this, then change the 29 to 19. (This is
set up for SL 30 or greater to run.)
─────────────────────────────────────────────────────────────────────────────
STEP 6: Place the following line wherever you want a random string to pop up:
ran_strings(0);
You can place this above your prompts, in LILO right before the user
stat screen, wherever...
─────────────────────────────────────────────────────────────────────────────
STEP 7: Add this code into LILO.C, at the very end of the function:
void logon(void)
== rip_cls();
== autox = -1;
++ if ((exist("017H.$$$")) && (so())) // SPV-017H
++ ValidateStrings(); // SPV-017H
++ }
==
== void logoff(void)
─────────────────────────────────────────────────────────────────────────────
STEP 8: Add this variable declaration to SYSOPF.C, void beginday(void)
== zlogrec z,z1;
== int f,i;
++ FILE *note; // SPV-017H
== double fk;
== int nus;
. . .SKIPPING DOWN TO THE END OF THE FUNCTION . . .
== if (syscfg.beginday_c[0]) {
== stuff_in(s,syscfg.beginday_c,create_chain_file(),"","","","");
== extern_prog(s, sysinfo.spawn_opts[2]);
== }
// SPV-017H START
if (!exist("017H.$$$")) {
outchr(12);
npr("5Searching for any unvalidated strings in 1%s5.0",
RAN_FILENAME);
nl();
for (i=0;i<=num_strings(RAN_FILENUMB);i++) {
npr("9%3d\b\b\b0",i);
sprintf(s,get_stringx(RAN_FILENUMB,i));
if (s[0]=='»') {
if ((note=fsh_open("017H.$$$","wt"))!=NULL) {
fprintf(note,"There are unvalidated strings in %s...",
RAN_FILENAME);
fputs("\n\n",note);
fprintf(note,"Do not delete this file!");
fsh_close(note);
} else {
sprintf(s,
"6%%% 2Unable to create 017H.$$$ in your main BBS directory!0");
ssm(1,0,s);
sysoplog(s);
}
break;
}
}
}
// SPV-017H END
== }
─────────────────────────────────────────────────────────────────────────────
STEP 9: Recompile the whole source.
─────────────────────────────────────────────────────────────────────────────
There are 4 different calls to this modification. They are as follows:
ran_strings(0); -- This will print a saying like:
A saying for Papa Bear from StarPort Valhalla:
"No wanna work, wanna bang on keyboard!"
ran_strings(1); -- This will allow the user to enter their own saying.
ran_strings(2); -- This prints ALL the sayings in the STR file.
ran_strings(3); -- This prints ONE saying, perfect for above prompt use.
─────────────────────────────────────────────────────────────────────────────
If you use this, do me a favor and tell me (its a GREAT ego inflator!).
If you install this, and it doesn't work, E-Mail me and I'll try to help
you figure out WHY it doesn't work.
If it prints strings out that apprear in OTHER .STR files besides the one
you intended, MAKE SURE YOU HAVE THE #define RAN_FILENUMB SET CORRECTLY. You
can set it to 5 just to be safe.
This mod is copyright 1993-1995 by Tracy Baker, aka Papa Bear, and is
distributed as freeware. Permission is granted to distribute and post this
mod on BBS systems and online services, provided no alterations are made
(removal of message headers/taglines allowed). This mod may contain some
parts of WWIV source code, which is copyright 1988-1994 by Wayne Bell and
licensed only to registered users of WWIV. Use of WWIV source without
registration constitutes a license violation and could lead to legal
prosecution and certain doom.
Shareware distributors and CD-ROM publishers may not distribute this mod
without express written permission of the Author or WWIV Software Services.
7-9=1*6>2Pâpâ ßêâr6<1*9=7-0
8311579.wwivnet1· 2 ╪╫9≡8║7⌐¬4¥5╓╥╖1· · 2▒1 · 2▒ 3(510)522-35831 ·
732.sexnet 1∙ 6 ·0░░▒▒▓▓6∞0▓▒░6·2 StarPort ▒ ▒ 2 ▒1 ·2▒ ▒ ▒1 ·2 ▒ ▒1 ·2▒ ▒ 1·
6315061.wwivlink 0 ████1 · . 2 ▒ ▒ ▒ ▒ ▒1 · 2▒▒▒ ▒ ▒ ▒ ▒ ▒ ▒
535079.icenet 1. . 0 │└6·0└6· 1 ∙ 2 ▒ ▒ ▒ ▒▒▒ ▒ ▒ ▒1 ·2 ▒ ▒▒▒ ▒▒▒ ▒1 ∙ 2▒
---
1If at first you don't succeed, skydiving is not for you.