Category : BBS Programs+Doors
Archive   : TONSMOD.ZIP
Filename : JAFO04D.MOD

 
Output of file : JAFO04D.MOD contained in archive : TONSMOD.ZIP
ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
³ Mod Name : JAFO04D.MOD Mod Author: JAFO 1@1 TerraNET ³
³ Difficulty : ÛÛÛÛÛ±±±±± 1@8857 IceNET ³
³ WWIV Version : 4.22 1@8861 WWIVnet ³
³ Mod Date : 02/02/93 1@18868 WWIVLink ³
³ Files Affected: BBS.C, BBSUTL.C, COM.C, SHRINK.C, UTILITY.C, VARS.H ³
³ Description : Enhanced Main Menu & Transfer Prompts ³
ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ

ÍÍ[ Description ]ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ

This mod will change the way your main menu and transfer prompts work.
Normally, if you type '>', a few line spaces occur and the new prompt
appears below. Here is an example:

T - 50:33:21
[1] [SysOp Announcements] :>


T - 50:33:19
[2] [General] :

As you can see, if you wanted to go to sub #30, it could take up 5 screens
to get there! This mod will keep the prompt on the SAME line while you
advance or retreat subs, as well as directories, IF the user has ANSI
enabled. If you have modified your prompts to include random quotes or
something, and have more than 2 lines, I'd suggest not using this mod,
because additional code will be required, and it will be very slow at 2400
baud.

Revision B Note: If you are using the original version of this mod,
JAFO04, then I suggest you completely rip it out of
your source and install this mod. This one is far
easier to install too!

Revision C Note: There was a very minor bug in 2.0. I forgot to add
a single line in BBS.C so that while at WFC everything
acts normally. If you installed V2.0, you probably
noticed everything was kinda screwy at WFC.


Revision D Note: This version of the mod now keeps the prompt on the same
line when you press a valid sub/dir number. This was a
feature of the original mod, but was taken out of
subsequent versions (not by design). It has since been
requested by many people, so it is in now.

ÍÍ[ Legend ]ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ

= Existing line - Do not change
$ Existing line - Line has wrapped from previous line
+ Add this line
- Remove this line
% Change this line

ÍÍ[ Step 1 ]ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ

Please back up your source code. Even the best programmers make mistakes.

ÍÍ[ Step 2 ]ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ

In VARS.H, change the line shown. You are adding the "newline" variable.

= userfile, usernum, useron, use_workspace, using_modem,
% wfc, x_only, newline;
=
= __EXTRN__ unsigned short com_speed, *csn_index, crc, *gat, modem_flag,
= modem_mode, modem_speed, net_sysnum;

ÍÍ[ Step 3 ]ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ

In BBS.C, add the the following line near the top.

= #define _DEFINE_GLOBALS_
= #include "vars.h"
= #include "subxtr.h"
=
=
= #include
+ #include
=
=
= unsigned _stklen=15360;

ÍÍ[ Step 4 ]ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ

Put the following function right before "int checkpw".

void prompt(char *s)
{
if ((okansi()) && (!newline))
outstr("\r\x1b[1A");
else
nl();
tleft(1);
npr("T - %s\r\n",ctim(nsl()));
prt(2,s);
if ((okansi()) && (!newline))
outstr("\x1b[K");
newline=0;
}

ÍÍ[ Step 5 ]ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ

In "void mainmenu", make the changes shown.

= void mainmenu(void)
= {
= char *s, s1[81],s2[81],ch;
% int i,i1;
= long l;
= double d;
=
= tleft(1);
= if ((sysstatus_expert & thisuser.sysstatus)==0)
= printmenu(0);
=
- nl();
- nl();
- tleft(1);
- npr("T - %s\r\n",ctim(nsl()));
= s1[0]=0;
= if (usub[cursub].subnum==-1) {
= cursub=0;
= if (usub[cursub].subnum==-1) {
= strcpy(s1,get_string(16));
= }
= }
= if (s1[0]==0)
= sprintf(s1,"[%s] [%s] :",usub[cursub].keys,
$ subboards[usub[cursub].subnum].name);
+ prompt(s1);
- prt(2,s1);
= helpl=1;
= s=mmkey(0);
= helpl=0;
% if (s[0]) {
+ i1=0;
% for (i=0; (i % if (strcmp(usub[i].keys,s)==0) {
= cursub=i;
+ i1=1;
+ }
+ }
+ if ((!i1) && (okansi()) && (isdigit(s[0])) &&
+ ((sysstatus_expert & thisuser.sysstatus)!=0)) {
+ nl();
+ newline=1;
+ }
+ } else
+ newline=1;
= if (strlen(s)>2) {
= sprintf(s1,"//%s",s);
= sysopchar(s1);

ÍÍ[ Step 6 ]ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ

In "void dlmainmenu", make the changes shown.

= void dlmainmenu(void)
= {
= char *s, s1[81],s2[81],ch;
= int i,i1,i2,abort,next;
= messagerec m;
=
= tleft(1);
= if ((sysstatus_expert & thisuser.sysstatus)==0)
= printmenu(3);
=
- nl();
- nl();
- tleft(1);
- npr("T - %s\r\n",ctim(nsl()));
= s1[0]=0;
= if (udir[curdir].subnum==-1) {
= curdir=0;
= if (udir[curdir].subnum==-1) {
= strcpy(s1,get_string(32));
= curdloads=0;
= return;
= }
= }
= if (s1[0]==0)
= sprintf(s1,"(%s)-(%s) :",udir[curdir].keys,
$ directories[udir[curdir].subnum].name);
+ prompt(s1);
- prt(2,s1);
= helpl=2;
= s=mmkey(1);
= helpl=0;
% if (s[0]) {
+ i1=0;
% for (i=0; i % if (strcmp(udir[i].keys,s)==0) {
= curdir=i;
+ i1=1;
+ }
+ }
+ if ((!i1) && (okansi()) && (isdigit(s[0])) &&
+ ((sysstatus_expert & thisuser.sysstatus)!=0)) {
+ nl();
+ newline=1;
+ }
+ } else
+ newline=1;
= if (strlen(s)>2) {
= sprintf(s1,"//%s",s);
= sysopchar(s1);

ÍÍ[ Step 7 ]ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ

In BBSUTL.C, add the following line near the top.

= #include "vars.h"
+ #include
=
= #pragma hdrstop

ÍÍ[ Step 8 ]ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ

Replace the entire "char *mmkey" function with the one below.

char *mmkey(int dl)
{
static unsigned char cmd1[10],cmd2[81],ch;
int i,i1,i2,p,cp,expert;

if ((sysstatus_expert & thisuser.sysstatus)==0)
expert=0;
else
expert=1;
do {
do {
ch=getkey();
} while ((((ch<' ') && (ch!=13)) || (ch>126)) && (hangup==0));
ch=upcase(ch);
outchr(ch);
if (ch==13)
cmd1[0]=0;
else
cmd1[0]=ch;
cmd1[1]=0;
p=0;
switch(dl) {

case 1:
if (strchr(dtc,ch)!=NULL)
p=2;
else if (strchr(dcd,ch)!=NULL)
p=1;
break;
case 2:
if (strchr(odc,ch)!=NULL)
p=1;
break;
case 0:
if (strchr(tc,ch)!=NULL)
p=2;
else if (strchr(dc,ch)!=NULL)
p=1;
break;
}
if (p) {
cp=1;
do {
do {
ch=getkey();
} while ((((ch<' ') && (ch!=13) && (ch!=8)) || (ch>126))&&(hangup==0));
ch=upcase(ch);
if (ch==13) {
if ((!okansi()) || (!expert))
nl();
if (!expert)
newline=1;
return(cmd1);
} else {
if (ch==8) {
backspace();
cmd1[--cp]=0;
} else {
cmd1[cp++]=ch;
cmd1[cp]=0;
outchr(ch);
if ((ch=='/') && (cmd1[0]=='/')) {
input(cmd2,50);
if (((curdloads!=0) && (curdloads!=1) && (dl!=2)) ||
(!newline)) {
if (isdigit(cmd2[0])) {
if ((curdloads==0) && (dl==0)) {
i1=0;
for (i=0; (i if (strcmp(usub[i].keys,cmd2)==0)
i1=1;
if (i1)
nl();
}
if ((curdloads==1) && (dl==1)) {
i1=0;
for (i=0; i if (strcmp(udir[i].keys,cmd2)==0)
i1=1;
if (i1)
nl();
}
if (dl==2)
nl();
} else
nl();
newline=1;
}
return(cmd2);
} else if (cp==p+1) {
if (((curdloads!=0) && (curdloads!=1) && (dl!=2)) ||
(!newline)) {
if (isdigit(cmd1[0])) {
if ((dl==2) || (!okansi()) || (!expert))
nl();
if (!expert)
newline=1;
} else {
nl();
newline=1;
}
} else {
nl();
newline=1;
}
return(cmd1);
}
}
}
} while (cp);
} else {
if (((curdloads!=0) && (curdloads!=1) && (dl!=2)) ||
(!newline)) {
switch (cmd1[0]) {
case '>':
case '+':
case '<':
case '-':
if ((dl==2) || (!okansi()) || (!expert))
nl();
if (!expert)
newline=1;
break;
default:
if (isdigit(cmd1[0])) {
if ((dl==2) || (!okansi()) || (!expert))
nl();
if (!expert)
newline=1;
} else {
nl();
newline=1;
}
break;
}
} else {
nl();
newline=1;
}
return(cmd1);
}
} while (hangup==0);
cmd1[0]=0;
return(cmd1);
}

ÍÍ[ Step 9 ]ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ

In COM.C, change the following line in "void input1".

= case 13:
= s[curpos] = 0;
= done = echo = 1;
% if ((newline) && (crend))
= nl();
= break;

ÍÍ[ Step 10 ]ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ

In SHRINK.C, add the following line to "int restore_data".

= READ(numbatch);
= READ(numbatchdl);
+ READ(newline);
=
= read(f,batch, numbatch*sizeof(batchrec));

ÍÍ[ Step 11 ]ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ

Add the following line in "void save_state".

= WRITE(numbatch);
= WRITE(numbatchdl);
+ WRITE(newline);
=
= write(f,batch, numbatch*sizeof(batchrec));


ÍÍ[ Step 12 ]ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ

In UTILITY.C, add the following line to "void frequent_init".

= void frequent_init(void)
= /* This should be called after a user is logged off, and will initialize
= * screen-access variables.
= */
= {
= in_fsed=0;
= curlsub=-1;
= ansiptr=0;
+ newline=1;
= curatr=0x07;
= outcom=0;
= incom=0;

ÍÍ[ Step 13 ]ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ

Compile your source. Since we added a variable to VARS.H, a full re-compile
is necessary.

ÍÍ[ Disclaimer ]ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ

Don't complain to me if your board gets fried, your hard disk goes nuts, or
something terrible happens. The code in this mod should be harmless, but I
can't guarantee it will work for you. It works on my board.

JAFO 1@1 TerraNET
1@8857 IceNET
1@8861 WWIVnet
1@18868 WWIVLink



Sub: MODS [for WWIV] ONLY [WWIVnet] 
Message 56 of 200 (?=Help) ? 

57/200: TFC003A - Complete clear screen mod, minor fix
Name: Nightshade #1 @6953
Date: Wed Feb 03 01:06:13 1993
From: WWIVnet - Central City BBS [619-630-9121]
Region: Southern California

TFC003A - Screen Clearing mod

I made a booboo that, obviously, I fixed in my source code, but had

  3 Responses to “Category : BBS Programs+Doors
Archive   : TONSMOD.ZIP
Filename : JAFO04D.MOD

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/