home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Devil's Doorknob BBS Capture (1996-2003)
/
devilsdoorknobbbscapture1996-2003.iso
/
Dloads
/
SYSOP
/
MODS1.ZIP
/
SPV-017D.MOD
< prev
next >
Wrap
Text File
|
1993-12-10
|
11KB
|
272 lines
SPV-017D.MOD [*THE* random saying mod. Like VBBS.]
Papa Bear #1 @5079
7Tuesday1, 7December 71, 71993 2 96:201 am
0R: net33: @4056 (via @4061) [08:41 12/10/93]
0R: net33: @4050 (via @4064) [05:33 12/10/93]
0R: net33: @4064 (via @1040) [05:10 12/10/93]
0R: net33: @1040 (via @2050) [13:37 12/09/93]
0R: net34: @2050 [11:35 12/09/93]
0R: net34: @2050 (via @1040) [05:54 12/09/93]
0R: net33: @1040 (via @1114) [04:39 12/09/93]
0R: net33: @5079 [09:05 12/07/93]
4Msg. Status:3▄ 15Please reply!
3 ▀▀▀▀▀▀▀▀▀▀▀▀
┌────────────────────────────────────────────────────────────────────────────┐
│ Mod Name: SPV-017D.MOD Mod Authors: Pâpâ ßêâr (1@5079 WWIV/IceNET) │
│ Difficulty: ▓░░░░░░░░░ [08/07/93] [08/09/93] (1@5050 SEX/JAMDnet) │
│ WWIV Version: 4.23 [08/14/93] [09/08/93] (1@15061 WWIVlink) │
│ Files Affected: BBSUTL.C BBS.C [12/06/93] (1@18 CARDNet) │
│ FCNS.H VARDEC.H STRINGS.C (1@18 CARDNet) │
│ Description: Puts random words of wisdom at logon, or above prompts or │
│wherever you want to use them. │
╞═────────────────────────────────────═╤═───────────────────────────────────═╡
│ StarPort Valhalla [510]522-3583 ASV 14.4kbps Home of the SPV mod series! │
╘═────────────────────────────────────═╧═───────────────────────────────────═╛
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?]
-----------------------------------------------------------------------------
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.
This "D" version is another upgrade. It is *NOT* a bug fix. This file
includes all of the fixes and upgrades from 017A, FIX "B", and the 017C
upgrade.
I did not include all the comments from previous versions. Nor did I
comment the new changes. This was getting kinda long, and with the upgrade to
4.23, I hopefully made it a "drop in" for the source ;)
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.
o Now updated to work with 4.23.
o Got rid of the MODSTR.H file [got smart and did it another way].
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!
All the users of StarPort Valhalla who use and like this mod!
-----------------------------------------------------------------------------
STEP 1: ADD these functions to the end of BBSUTL.C:
void ran_strings (int mode)
{
char s[81],s1[81],s2[81];
int ls;
ls=(79-(strlen(thisuser.name)+3));
sprintf(s,"%s%s",syscfg.gfilesdir,RAN_FILENAME);
if (!(access(s,0)==0)) { // NOTE 1
if (thisuser.sl!=255)
pl("Random string file does not exist, please notify SysOp!");
else {
nl();
npr("Please enter a string to start your %s file.\r\n",RAN_FILENAME);
add_ran_strings(ls);
}
} else {
if (mode) {
nl();
pl("Do you want to add a line to be displayed at the prompts?");
npr("It will be displayed, at random, with others): ";
if (ny()) {
nl();
pl("Please be patient... I'm looking for a place to put it.");
nl();
pl("Please enter your line of wisdom.");
npr("[%u characters] - Enter aborts.\r\n",ls);
add_ran_strings(ls);
} else {
nl();
pl("Aborted!");
nl();
}
} else if (thisuser.sl!=255) { // NOTE 2
pl("%s's random saying from %s.",thisuser.name,syscfg.systemname);
do {
strcpy(s1,(getrandomstring(RAN_FILENUMB)));
} while (s1[0]==NULL);
pl(s1);
}
}
close_strfiles();
}
void add_ran_strings (int lenstr)
{
char s[255],s1[255],s2[81],s3[81];
int entrynum;
entrynum=empty_slot();
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("Use the above string? [ENTER = yes] ");
if (ny()) {
nl();
sprintf(s1,"%s - %s",s,thisuser.name);
put_string(RAN_FILENUMB,entrynum,s1);
sysoplog(s1); // NOTE 3
ssm(1,0,s1);
sprintf(s1,"!!! String #%u entered into %s.",entrynum,RAN_FILENAME);
sysoplog(s1);
ssm(1,0,s1); // NOTE 3
} else {
nl();
pl("Aborted!");
}
nl();
}
}
NOTE 1: The access(...) function is a Borland's Turbo C++ 3.0 command. It
*MAY* be available to most other compilers. (Most especially Borland's
products.) All this does is check for the presense of a defined filename
in the defined directory. Hence the line:
sprintf(s,"%s%s",syscfg.gfilesdir,RAN_FILENAME);
that preceeds my call to the access(...); function.
NOTE 2: If you, as a SysOp (SL 255), WANT to see the strings, just like a
normal user, then change:
} else if (thisuser.sl!=255) {
to look like:
} else {
NOTE 3: Between these two NOTE 3's are where you are notified of any
additions. You're told when you log on, and in the SysOp's Log, what a user
inputted, and where it went (by line number and STR filename).
-----------------------------------------------------------------------------
STEP 2: Add this function to the end of BBSUTL.C
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);
}
-----------------------------------------------------------------------------
STEP 3: ADD these three lines to FCNS.H
== int set_language_1(int n);
== int set_language(int n);
++ void ran_strings (int mode);
++ void add_ran_strings (int lenstr);
++ int empty_slot(void);
-----------------------------------------------------------------------------
STEP 4: Add the following lines to VARDEC.H
== #ifndef _VARDEC_H_
== #define _VARDEC_H_
==
++ #define RAN_FILENAME "RANSTR.STR" // SPV-017C
++ #define RAN_FILENUMB 5 // SPV-017C
==
== #define OK_LEVEL 0
== #define NOK_LEVEL 1
-----------------------------------------------------------------------------
STEP 5: 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);
==
== strncpy(str_yes,get_string(1), sizeof(str_yes)-1);
-----------------------------------------------------------------------------
STEP 6: Add the ^ command to BBS.C
== } else
== pl(get_string(8));
== break;
// START SPV-017C
++ case '^':
++ nln(2);
++ npr("Do you want to R)ead a saying, W)rite a saying, or Quit? ");
++ ch=onek("QRW");
++ switch(ch) {
++ case 'R':
++ nl();
++ ran_strings(0);
++ break;
++ case 'W':
++ if (thisuser.sl>29) // NOTE 1
++ ran_strings(1);
++ else {
++ nl();
++ pl("Your security access is too low for this command.");
++ nl();
++ }
++ break;
++ case 'Q':
++ nl();
++ pl("Aborted");
++ break;
++ }
++ break;
// END SPV-017C
== 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 7: 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 8: Recompile the whole source.
-----------------------------------------------------------------------------
Random strings... All you need to do to ADD a string to the STR file is call:
ran_strings(1);
You can easily do this right after the user reads their mail (like VBBS), or
as a command, or both (like I NOW have at SPV). To display a saying use:
ran_strings(0);
-----------------------------------------------------------------------------
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.
1-7=3*6>2Pâpâ ßêâr6<3*7=1-0
85StarPort Valhalla ASV 510-522-3583════════════════────────────────────────────
---
1Th-th-th-that's all folks!