MCI Commands and Use

From Color 64 BBS Wiki
Revision as of 05:24, 16 February 2026 by Admin (talk | contribs)

BBS Operation - MCI Commands

Color 64 includes support for MCI commands. MCI stands for Message Command Interpreter, a feature common to many BBS systems. An MCI command is a special character sequence embedded in a message to control formatting or trigger functions. For example, one command can pause output until a key is pressed, while another enables rainbow text effects.

MCI commands are interpreted only when the message is displayed, either in the editor or when read by a user. While typing, you will simply see their character representation. MCI commands may also be used with BASIC output routines (see section 3.11.1). They function anywhere ML-based output occurs, except within BASIC’s PRINT statement, which does not use the ML output handler.

While in the message editor, every MCI command begins with the British Pound symbol (£). The character immediately following determines the command and must be an unshifted letter. Shifted letters will not be recognized. For example, typing £c tells the system to wait for a keypress. In Uppercase/Graphics mode, unshifted characters appear as uppercase, but they are still interpreted correctly.

Some commands require additional characters. Rainbow modes, for example, must be followed by color selections entered using CTRL or C= key combinations, just as when changing cursor colors. Most rainbow modes accept 2 to 8 colors. If fewer than 2 colors are entered, the current mode remains unchanged. If more than 8 are entered, only the first 8 are used. Caps/Punctuation mode is limited to 2 or 3 colors.

The table below lists the standard MCI commands:

Standard MCI Commands
Command Function Description
£r Character Rainbow Changes color with each character
£w Word Rainbow Changes color with each word
£s Sentence Rainbow Changes color at each sentence ending (., ?, !)
£l Line Rainbow Changes color at each carriage return
£g Paragraph Rainbow Changes color at each double carriage return
£p Caps/Punctuation Uses 2 or 3 colors. With 3 colors: separate colors for uppercase, lowercase, and punctuation/graphics. With 2 colors: alphabetic vs punctuation. Produces a visually distinctive effect.
£n Normal Cancels current mode and returns to normal output
£v Character Velocity Follow with digit 0–9. 0 is fastest (no delay), 9 is slowest. Cancel with £v0 or RETURN.
£c Wait Pauses until a key is pressed
£t Tab Follow with position 0–79. If current position is less, spaces are added. If greater, cursor-left characters are printed. Tabs on the same line should move in one direction only.
£i Wait for Line of Input Accepts up to 127 characters. Stored input may be printed with £a0.

Two additional commands may be restricted by security level in SETUP: Message Output MCI and Variable MCI.

The Message Output MCI

£a outputs system or user-specific information. The digit following the command selects the output:

Message MCI Commands
Command Function
£a0 Print text entered from last £i command
£a1 Current caller’s name/alias (NA$)
£a2 Caller’s last calling date (LD$)
£a3 Current time (T$)
£a4 Current date (DA$)
£a5 Last caller’s name (LC$). If last call was network exchange, remote BBS name is shown.
£a6 Membership information field (DD$), SYSOP-defined
£a7 User’s real name (RN$)
£a8 User’s birth date (BD$)
£a9 User’s phone number (PH$)
£aa Email or street address (A1$)
£ab City, state, ZIP (A2$)

Note: Because DD$ may contain sensitive membership information, SETUP allows disabling of £a6 for security.

The Variable MCI Command

£[ allows output of any BASIC variable or expression. An expression may be numeric or string-based, such as:

5*4+3/16 a$+mid$(str$(lv),2)

Type £[ followed by the expression and terminate with a closing bracket ]. The system evaluates the expression and prints the result.

BASIC keywords are stored internally as single-character tokens. Normally this tokenization happens automatically when entering program lines. However, within £[ expressions, you must either manually enter tokens or use the automatic keyword cruncher.

Typing BASIC Tokens

The table below lists common numeric and string tokens and their key combinations:

BASIC Token Reference Chart
Token Hex Key Combination CHR$()
+ AA C= + J CHR$(170)
- AB C= + K CHR$(171)
* AC C= + L CHR$(172)
/ AD C= + Z CHR$(173)
AE C= + X CHR$(174)
AND AF C= + C CHR$(175)
OR B0 C= + V CHR$(176)
> B1 C= + B CHR$(177)
= B2 C= + N CHR$(178)
< B3 C= + M CHR$(179)
SGN B4 C= + H CHR$(180)
INT B5 C= + J CHR$(181)
ABS B6 C= + L CHR$(182)
USR B7 C= + Y CHR$(183)
FRE B8 C= + U CHR$(184)
POS B9 C= + O CHR$(185)
SQR BA SHIFT-@ CHR$(186)
RND BB C= + F CHR$(187)
LOG BC C= + C CHR$(188)
EXP BD C= + X CHR$(189)
COS BE C= + V CHR$(190)
SIN BF C= + B CHR$(191)
TAN C0 SHIFT-* CHR$(192)
ATN C1 SHIFT-A CHR$(193)
PEEK C2 SHIFT-B CHR$(194)
LEN C3 SHIFT-C CHR$(195)

Example: To output INT(RND(0)*16+5), convert keywords and mathematical operators to their token equivalents. The completed command appears visually as shown below:

Close the expression with ] to execute it. Any syntax error within the expression will generate the same error BASIC normally produces. For this reason, access to £[ should be restricted to trusted users.

Automatic Keyword Cruncher

To avoid manually entering tokens, place a greater-than symbol (>) immediately after the opening bracket:

£[>int(rnd(0)*16+5)]

This version is easier to type and read, though slightly slower in execution. Comparison:

Automatic Keyword Cruncher Example "int(rnd(0)*16+5)"
With Automatic Keyword Cruncher Without Automatic Keyword Cruncher

MCI Command Security

Access levels for £a and £[ are configurable in SETUP. If a caller lacks permission, the system prevents entry of the command. The message loader also filters unauthorized usage.

Internally, allowed commands are converted to special characters. For example, the “a” in £a is stored as F2. The “[" in £[ is stored as F4. These function-key characters cannot be entered directly by online callers, preventing unauthorized command injection.

Using MCI Commands in BASIC

When programming in BASIC, you must enter £a and £[ using their internal representations. Instead of typing “£a”, enter “£” followed by F2. For Variable MCI, enter “£” followed by F4. These appear visually as £a and £[, but internally use protected characters.

Next Section: Text Editing Features

BBS Operation