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

 
Output of file : GATECLR.MOD contained in archive : TONSMOD.ZIP
Name: Gate Keeper
Date: 9-20-92
Mod Name: GATECLR.MOD
Dificulty: Mostly Block Reading...
Why?: Because of TONS Of email requesting it (Grin)

Mod: Add 32 Or So Extended colors to your BBS Using Keys 8,9 and A-Z
This was originally not my mod. I just upgraded it and made it work
with WWIV v4.2+. This will work with that version unlike the old one.
Anyway..On with the Mod:


As usual, == Original Code, leave as is.
-- Delete Code
++ Add Code
=+ Modify Code

In BBSUTL.C, at VOID INLI(..., do the following:

case 14: /* Ctrl-N */
if ((wherex()) && (cp outchr(8);
s[cp++]=8;
}
break;
/*==*/ case 16: /* Ctrl-P */
/*==*/ if (cp ch=getkey();
/*=+*/ if (((ch>='0') && (ch<='9')) || ((ch>='A') &&
/*=+*/ (ch<='Z')) || ((ch>='a') && (ch<='z'))) {
s[cp++]=3;
s[cp++]=ch;
/*++*/ if((ch>='0') && (ch<='9'))
ansic(ch-'0');
/*++*/ else if ((ch>='A') && (ch<='Z'))
/*++*/ ansic(ch-'A'+10);
/*++*/ else ansic(ch-'a'+10);
}
}
break;
case 9: /* Tab */
i=5-(cp % 5);
if (((cp+i) i=5-((wherex()+1) % 5);
for (i1=0; i1

Then, in COM.C, at VOID OUTCHR(..., replace the whole function with the
following:

void outchr(char c)
/* This function outputs one character to the screen, and if output to the
* com port is enabled, the character is output there too. ANSI graphics
* are also trapped here, and the ansi function is called to execute the
* ANSI codes
*/
{
int i, i1;

if (change_color) {
change_color = 0;
if ((c >= '0') && (c <= '9'))
ansic(c - '0');
else if ((c >='A') && (c <='Z'))
ansic(c-'A'+10);
else if ((c >='a') && (c <='z'))
ansic(c-'a'+10);
return;
}
if (c == 3) {
change_color = 1;
return;
}
if ((c == 10) && endofline[0]) {
if (!in_extern)
outstr(endofline);
endofline[0] = 0;
}

if (global_handle) {
if (echo)
global_char(c);
}

if (chatcall && !x_only && !(syscfg.sysconfig & sysconfig_no_beep))
setbeep(1);

if (outcom && !x_only && (c != 9))
outcomch(echo ? c : 'X');
if (ansiptr) {
ansistr[ansiptr++] = c;
ansistr[ansiptr] = 0;
if ((((c < '0') || (c > '9')) && (c!='[') && (c!=';')) ||
(ansistr[1] != '[') || (ansiptr>75))
execute_ansi();
} else if (c == 27) {
ansistr[0] = 27;
ansiptr = 1;
ansistr[ansiptr]=0;
} else {
if (c == 9) {
i1 = wherex();
for (i = i1; i< (((i1 / 8) + 1) * 8); i++)
outchr(32);
} else if (echo || lecho) {
out1ch(c);
if (c == 10) {
++lines_listed;
if ((sysstatus_pause_on_page & thisuser.sysstatus) &&
(lines_listed >= screenlinest - 1)) {
pausescr();
lines_listed = 0;
}
}
} else
out1ch('X');
}
if (chatcall)
setbeep(0);
}



Then, at VOID ANSIC(..., replace with the following code:

void ansic(int n)
{
char s[81], c;

if ((n>=0) && (n<=7))
c = ((thisuser.sysstatus & sysstatus_color) ? thisuser.colors[n] :
thisuser.bwcolors[n]);
if ((n>=8) && (n<=36))
c = ((thisuser.sysstatus & sysstatus_color) ? status.resx[n-8] :
thisuser.bwcolors[n-8]);
if (c == curatr)
return;
setc(c);
makeansi((thisuser.sysstatus & sysstatus_color) ? thisuser.colors[0] :
thisuser.bwcolors[0],endofline, 0);
}


Then, in CONIO.C, at VOID TWO_WAY_CHAT(..., replace the CTRL-P switch with
the following:

case 16: /* Ctrl-P */
if (side==0)
{
if (cp0 {
ch=getkey();
if ((ch>='0') && (ch<='9'))
{
side0[wherey()][cp0++]=3;
side0[wherey()][cp0++]=ch;
ansic(ch-'0');
}
else if ((ch>='A') && (ch<='Z'))
{
side0[wherey()][cp0++]=3;
side0[wherey()][cp0++]=ch;
ansic(ch-'A'+10);
}
else if ((ch>='a') && (ch<='z'))
{
side0[wherey()][cp0++]=3;
side0[wherey()][cp0++]=ch;
ansic(ch-'a'+10);
}
}
}
else
{
if (cp1 {
ch=getkey();
if ((ch>='0') && (ch<='9'))
{
side1[wherey()-13][cp1++]=3;
side1[wherey()-13][cp1++]=ch;
ansic(ch-'0');
}
else if ((ch>='A') && (ch<='Z'))
{
side1[wherey()-13][cp1++]=3;
side1[wherey()-13][cp1++]=ch;
ansic(ch-'A'+10);
}
else if ((ch>='a') && (ch<='z'))
{
side1[wherey()-13][cp1++]=3;
side1[wherey()-13][cp1++]=ch;
ansic(ch-'a'+10);
}
}
}
break;


Now in the file XINIT.C, at the very bottom of the file
before the end brace, add the following code:

/* Already there */ }
/* Add all this below */
status.resx[0]=1; /* The color of ctrl-p 8 */
status.resx[1]=3; /* Ctrl-p 9 */
status.resx[2]=15; /* Ctrl-p A */
status.resx[3]=6; /* Ctrl-p B */
status.resx[4]=8; /* Ctrl-p C */
status.resx[5]=13; /* Etc... */
status.resx[6]=10;
status.resx[7]=12;
status.resx[8]=133;
status.resx[9]=4;
status.resx[10]=137;
status.resx[11]=138;
status.resx[12]=139;
status.resx[13]=134;
status.resx[14]=141;
status.resx[15]=142;
status.resx[16]=143;
status.resx[17]=30;
status.resx[18]=95;
status.resx[19]=79;
status.resx[20]=89;
status.resx[21]=46;
status.resx[22]=56;
status.resx[23]=47;
status.resx[24]=251;
status.resx[25]=352;
status.resx[26]=453;
status.resx[27]=554; /* To Ctrl-P Z */

} /* -<<< Already there...its the last } in the file */

The status.resx[whatever]=number, you change the number for other colors. The
above was just my selection of extended colors which you may wish to keep.

Here's how to select the colors. This key was by The druid.:

Colors are as followed:

0 Black 9 Lightblue
1 Blue 10 Lightgreen
2 Green 11 Lightcyan
3 Cyan 12 Lightred
4 Red 13 Lightmagenta
5 Magenta 14 Yellow
6 Brown 15 White
7 Lightgray
8 Darkgray


For the background colors you can have colors 0-7 from above. All you do is
multiply the color numbre you want by 16.

For a blinkng foreground color, you add 128 to the number.


So, for a BLINKING WHITE on BLUE BACKGROUND would be:
128 + 15 + (1 * 16) = 159

A LIGHTGREEN on a RED BACKGROUND would be:
10 + ( 4 * 16) = 74

/** Still more.. **/

This is optional. But if you want your users to have a color list I suggest
doing this:

/** Clrlst.msg **/

WWIV Color Key: Colors are established by hitting the Ctrl-P combination on
keyboard, letting go of the keys then selecting a number or a letter:

Color Listing:

Ctrl-P 1: ^P1This Color ^P0Ctrl-P 2: ^P2This Color ^P0Ctrl-P 3:
^P3This Color
Ctrl-P 4: ^P4This Color ^P0Ctrl-P 5: ^P5This Color ^P0Ctrl-P 6:
^P6This Color
Ctrl-P 7: ^P7This Color ^P0Ctrl-P 8: ^P8This Color ^P0Ctrl-P 9:
^P9This Color
Ctrl-P A: ^PaThis Color ^P0Ctrl-P B: ^PbThis Color ^P0Ctrl-P C:
^PcThis Color
Ctrl-P D: ^PdThis Color ^P0Ctrl-P E: ^PeThis Color ^P0Ctrl-P F:
^PeThis Color
Ctrl-P G: ^PgThis Color ^P0Ctrl-P H: ^PhThis Color ^P0Ctrl-P I:
^PiThis Color
Ctrl-P J: ^PjThis Color ^P0Ctrl-P K: ^PkThis Color ^P0Ctrl-P L:
^PlThis Color
Ctrl-P M: ^PmThis Color ^P0Ctrl-P N: ^PnThis Color ^P0Ctrl-P O:
^PoThis Color
Ctrl-P P: ^PpThis Color ^P0Ctrl-P Q: ^PqThis Color ^P0Ctrl-P R:
^PrThis Color
Ctrl-P S: ^PsThis Color ^P0Ctrl-P T: ^PtThis Color ^P0Ctrl-P U:
^PuThis Color
Ctrl-P V: ^PvThis Color ^P0Ctrl-P W: ^PwThis Color ^P0Ctrl-P X:
^PxThis Color
Ctrl-P Y: ^PyThis Color ^P0Ctrl-P Z: ^PzThis Color

Information About Extended Colors:
Using these colors will just change your text in your message. This
can be good for signatures (Macros) or to show expression in your message.

/** End of Clrlst.msg */

You need to change the ^P to a heart (CTRl-P C in most editors): This will
word wrap in a message so you will have to connect lines back together.
Put this file in your GFILES Directory. Or when you change the ^P to a heart
that should also fix. Now, For the last step load up msgbase.c and in void
inmsg(blah blah) do this:


/* =+ */ pl("Enter '/HELP' for help. '/CL' For Color Listing.");
/* == */
strcpy(s,"[---=----=----=----=----=----=----=----]----=----=----=----=----=----=----=----]");
/* == */ s[thisuser.screenchars]=0;
/* == */ pl(s);

/* == */ while (!done && !hangup) {
/* == */ helpl=27;
/* == */ inli(s,ro,160,1);
/* == */ if (hangup)
/* == */ done=1;
/* == */ savel=1;
/* == */ if (s[0]=='/') {
/* == */ if (stricmp(s,"/HELP")==0) {
/* == */ savel=0;
/* == */ printmenu(2);
/* == */ }
/* ++ */ if (stricmp(s,"/CL")==0) {
/* ++ */ savel=0;
/* ++ */ outstr("\x0c"); /* Clears screen..optional */
/* ++ */ printfile("Clrlst.msg");
/* ++ */ }
/* == */ if (stricmp(s,"/LI")==0) {
/* == */ savel=0;
/* == */ prt(5,"With line numbers? ");

Thats the end of the mod. It should work *Perfectly* If not Email
Me at 1@8143 and tell me what your problems were. Or if you enjoy the mod
or at least use it(GRIN) please tell me so. Good luck and enjoy your new
colorful bbs!

Gate Keeper






129/131: 32 Extened Colors FIX...
Name: Gate Keeper #1 @8143
Date: Sun Sep 20 21:33:53 1992
From: WWIV - California Beach House [801-771-9422]

[ Keeper Of Da' Place ]
Man, Well after I messed with my new gateclr.mod I noticed a problem., Since
I used to many colors and the reserved bytes for it weren't high enough there
for making you could get a different set of colors each time you load your
bbs. So, Here's the fix. You don't have to do much. This might screw up your
little recordings like Msgs posted today and such but its just untill
everything "Cycles" through and then it will fix itself auto-matically.
Anyway, Sorry about the probs..here's what you need to do:

Load up Vardec.H

search fo
log2[whatever]
gfiledate[whatever];
resx[9]; /* Reserved for nothing */
a whole bunch of stuff
} statusrex;

change the

resx[9]; /* Reserved for nothing */
to
resx[50]; /* Reserved For Color keys */

All it does is make more memory for the colors. That should work. If you have
probs lemme know. I hope you don't have any problems. I just found this out a
second ago and haven't fully tested it. But I see no reason why you would have
problems...sorry about the trouble

-->===\/===<--
Gate Keeper
-->===\/===<--





  3 Responses to “Category : BBS Programs+Doors
Archive   : TONSMOD.ZIP
Filename : GATECLR.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/