home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Devil's Doorknob BBS Capture (1996-2003)
/
devilsdoorknobbbscapture1996-2003.iso
/
Dloads
/
WWIVMODS
/
PRE412.ZIP
/
ELRIC15.MOD
< prev
next >
Wrap
Text File
|
1990-04-28
|
9KB
|
321 lines
The Menu Hotkey Mod
Elric 15
Hello fellow sysops, and welcome to Elric15.mod. Yep, 15. I skipped this one
a while back, on purpose. You see, I wrote this one, but before I wrote it up,
someone else put one out similar to this one. So, I kind of let it slide...
BUT, I have had several people request it from my BBS, so here it is...
What this mod does is allow you to print a description of the command
after the user presses a key. So if he hits A, he might see "A: AutoMessage".
Or "Automessage", where you just print "utomessage" for him. It works in both
the main menu and the transfer menu, but you could put it anywhere that
uses mmkey to get a command. Just be sure if it is in an external file to
include the line "extern int NL;" in the var decs....
/** this step is indeed a form step, much like a form letter **/
1. From DOS, in your dir where you keep your source....
PKZIP SOURCE *.c *.h
If you already have a source zip file, then
PKZIP -f source *.c *.h
This way you have a copy of everything before you screw it up with a bad mod.
If you decide to take the mod out, it's as easy as
PKUNZIP -x source
and hit Y to overwrite any files you changed.
/** we now resume our regularly scheduled mod with step 2.... **/
1. Load up BBSUTL.C add int NL to the var decs...and it IS important that
you use capitol letters for the NL.
extern char xdate[9];
extern int questused[20];
extern unsigned int modem_speed,com_speed;
extern char ctypes[NUM_CTYPES][18];
int NL; /** add me **/
void far *malloca(unsigned long nbytes)
{
2. Look down for char *mmkey. Make these changes to it...
char *mmkey(int dl)
{
static unsigned char cmd1[10],cmd2[81],ch;
int p;
do {
do {
ch=getkey();
} while ((((ch<' ') && (ch!=13)) || (ch>126)) && (hangup==0));
-------------------
a bunch of stuff...
-------------------
} else
nl();
return(cmd1);
}
} else {
if (!NL) /** add me **/
nl();
return(cmd1);
}
} while (hangup==0);
cmd1[0]=0;
return(cmd1);
}
3. Now Load up BBS.C
Add NL to the var decs, like this...
#include <dos.h>
#include <alloc.h>
#include <time.h>
extern int NL; /** add me **/
#define modem_time 3.5
void function_remotely() {}
void end_bbs(int lev)
{
4. Now go down to mainmenu. Add these lines...
prt(2,s1);
helpl=1; /** original code **/
NL=1; /** add me **/
s=mmkey1(0);
NL=0; /** add me **/
helpl=0;
if (s[0])
for (i=0; i<64; i++)
if (strcmp(usub[i].keys,s)==0){ /** change **/
nl(); /** add **/
cursub=i; /** original code **/
} /** add **/
if (!(s[1]==0)) /** add **/
nl(); /** add **/
sysopchar(s); /** original code resumes */
/**************************************************/
if ((strcmp(s,"BOARDEDIT")==0) && (so())) {
sysoplog("@ Ran Boardedit");
5. A little further down, you need to fix up the commands. What we are
doing is adding the text that will be printed after the command. You have
several options here. You could just spell out the word for them.
You could do what I did, which is put a colon, then 2 spaces, then print a
description of the command. You could do a combination. Or, you could
just list the translation of the command in Swahili, to really confuse
the users. It's really up to you....Also note that I did not list
all the changes, just some of them to give you the idea. As I did this,
you have to change all commands from A to Z, plus the *. You can add extra
commands by adding extra letters in the strcspn line and then putting the
appropriate pl where it is needed.
nl();
}
if ((s[1]==0) && (s[0]!=0)) {
if (strcspn("ABCDEFGHIJKLMNOPQRSTUVWXYZ*",s)=0) /** add **/
nl(); /** add **/
switch(s[0]) {
/** only here if you added my sysop mode mod **/
case '%': if (checkpw())
in_sysop=!in_sysop;
else
sysoplog("tried to enter sysop mode");
break;
/** see above comment **/
case '>':
case '+':
if (usub[cursub+1].subnum>=0)
++cursub;
else
cursub=0;
/** some more stuff skipped in here...**/
case 'A':
helpl=19;
pl(": Automessage"); /** add this line **/
write_automessage();
break;
case 'B':
pl(": Bbslist"); /** add this line **/
helpl=25;
bbslist();
break;
case 'C':
pl(": Request Chat"); /** add this line **/
helpl=3;
reqchat();
break;
/*** I skipped a bunch in here, but you need to continue adding a
pl("command description") for each one ***/
case '*':
pl(": Message Base List"); /** add this line **/
sublist();
break;
}
}
helpl=0;
}
6. Now look down in dlmainmenu. This works a lot like mainmenu....
if (s1[0]==0)
sprintf(s1,"(%s)-(%s) :",udir[curdir].keys,directories[udir[curdir].subnum].name);
prt(2,s1);
helpl=2;
NL=1; /** add me **/
s=mmkey(1);
NL=0; /** add me **/
helpl=0;
if (s[0])
for (i=0; i<64; i++)
if (strcmp(udir[i].keys,s)==0){ /** add the { **/
nl(); /** add me **/
curdir=i;
} /** add me **/
sysopchar(s);
if (!(s[1]==0)) nl(); /** add me **/
7. Now down to fix up the commands....
else
sortdir(udir[curdir].subnum,i1);
}
if ((s[1]==0) && (s[0]!=0)) {
if (strcspn("ABCDEFGHIJKLMNOPQRSTUVWXYZ*",s)=0) /** add **/
nl(); /** add **/
switch(s[0]) {
case '>':
case '+':
/******skip down a few lines here... ***/
case '*':
pl(": List all directories"); /** add **/
dirlist();
break;
case 'Q':
pl(": Quit to main menu"); /** add **/
curdloads=0;
break;
case '?':
if ((sysstatus_expert & thisuser.sysstatus))
printmenu(3);
break;
case 'A':
pl(": List an archived file"); /** add **/
helpl=23;
arc_l();
break;
case 'B':
pl(": Batch commands");
helpl=22;
batchdl();
/** keep adding those lines.... **/
/** bonus mod: replace case X and it's now an expert mode toggle...B
was already there for batch commands, and it makes more sense...**/
case 'X':
pl(": Expert Mode toggle (Batch commands are B)");
thisuser.sysstatus ^= sysstatus_expert;
break;
/** end of bonus mod **/
case 'Y':
pl(": Your transfer Info"); /** add **/
yourinfodl();
break;
case 'Z':
pl(": Upload private file to sysop"); /** add **/
nl();
nl();
pl("Sending file to sysop :-");
nl();
helpl=17;
upload(0);
break;
}
}
helpl=0;
}
8. Almost there....just one more thing to add..
Now as you can see, we only turn NL on in 2 places, and we turn it right
back off. But just in case, let's make sure it is turned off when the
BBS fires up.. Look down in main, and let's do that...
strcpy(s,getenv("BBS"));
if (strncmp(s,"WWIV",4)==0) {
printf("You are already in the BBS, type 'EXIT' instead.\n\n");
abort();
}
NL=0; /** add **/
already_on=0;
endday=0;
oklevel=0;
noklevel=0;
ooneuser=0;
no_hangup=0;
9. It's done....just compile it and try it out. You may want
to experiment with the commands for a while. One other warning. Since you
are adding mostly strings, this will bring you one step closer to the
famous evil DGROUP Error. So you may want to consider that when you start...
/** hey, it's the form info file **/
As usual, I take no responsibility for hard drive crashes, death in the
family, or end of the world as we know it resulting from this mod.
It's your fault if you didn't back up the files before you made the mod.
It's your fault if you don't back up your ENTIRE hard drive AT LEAST once
a month.
It works on my system with Turbo C 2.0, WWIV 4.1, V20/8088, 640K/640EMS.
If you use this, the only payment I ask is that you send me a note through
WWIVLink to 1@18251 saying you are using it...not too much to ask is it?
The Kingdom of Melnibone(LINK/NET)
812-877-3488 24 Hrs a day
3/12/2400/4800/9600/12,000/14,400 baud HST MNP5
Auto-validation of WWIV sysops on first call
Xmodem, Ymodem, DSZ Zmodem with retry, Ymodem-G
WWIV Link 1@18251
WWIV Net 1@8251