Restoring a chat feature to Color 64 8.1

Thought I would share this with everyone. Color 64 v8.0 documentation states that F1 will invoke a chat “nearly anywhere in the BBS” but - at least for version 8.1 - this does not work, so I added my own chat routine to it.

Code is rudimentary and could be further streamlined, but this should give those with little programming experience something to go with. With the code below, the sysop can invoke or answer a chat by pressing F1 when user is at the command prompt. Thoughts for expansion of this is to add some cursor saving code and make the chat split screen but may be too challenging for 2400 baud when it comes to scrolling text…

This code has been utilized with success on my BBS for over a month now.

F1 will both enter and exit.

Add this to BBS.OVL, BBS.MSGS and BBS.XFER

  1. add line:

13126 ifpeek(197)=4then35700

  1. add subroutine:

35700 rem chat routine
35701 f$'“-checkmark-chat enter”: gosub 205
35705 get a$:ifa$=““then 35800
35706 b=1:gosub35925
35800 ifpthengosub360:ifp=255then8004
35801 ifpeek(197)=4thencs$=””:goto35900
35802 a$=@4:ifp=255then8004
35803 ifa$=““then35705
35804 b=2:gosub35925
35806 goto35705
35900 a$=cr$+“Sysop has left the chat!”:#:goto13100
35925 a=asc(a$):if(a>12anda<96) or (a>182ora<219)then35930
35927 return
35930 ifb=1thena$=”(pick a color)”+a$
35931 ifb=2thena$=“(pick another color)”+a$
35932 $:goto35927

Notes:
Line 13126 - Check to see if F1 has been pressed on local keyboard (at command prompt)
Line 35701 “-checkmark-” is shift-@ on the commodore. F$=“filename” + the gosub 205 statement will print the SEQ file you’ve identified to display to the user when you enter chat. As an alternative, you can just do a print message to the user:

35701 #“SYSOP has entered chat”

Line 35705 - Checks local keyboard for key press. If no key is pressed, it goes to check if remote user has pressed key.
Line 35706 - if local key was pressed, jump to alphanumeric check routine
Line 35800 - line carrier check
Line 35801 - Checks F1 key on local keyboard for “Exit chat”
Lines 35802/35803 - check remote keyboard for keypress; if no key was pressed, then go to local keyboard check again
Line 35804 - if remote key was pressed, perform alpha numeric check
Line 35806 - start routine over again with checking local keyboard.
Line 35900 - exit point of routine; back to main command prompt.
Line 35925 - alphanumeric check subroutine
Lines 35930/35931 - Subroutine that picks a color depending on if it was local or remote user and prints keypress