Mcicommands: Difference between revisions
m Protected "Mcicommands" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)) |
No edit summary |
||
| (4 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
{{DISPLAYTITLE:MCI Commands and Use}} | |||
[[bbs operation|BBS Operation]] - <strong>MCI Commands</strong> | |||
== MCI Command Overview == | |||
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. | |||
The | 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. | ||
{| class="wikitable | 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. | ||
=== Standard MCI Commands === | |||
The table below lists the standard MCI commands: | |||
{| class="wikitable" | |||
|- | |- | ||
|+Standard MCI Commands | |+ Standard MCI Commands | ||
! Command | ! Command | ||
! Function | ! Function | ||
! Description | ! Description | ||
|- | |- | ||
| £r | | £r | ||
|Character Rainbow | | Character Rainbow | ||
| | | Changes color with each character | ||
|- | |- | ||
| £w | | £w | ||
| Word Rainbow | | Word Rainbow | ||
| | | Changes color with each word | ||
|- | |- | ||
| £s | | £s | ||
| Sentence Rainbow | | Sentence Rainbow | ||
| | | Changes color at each sentence ending (., ?, !) | ||
|- | |- | ||
| £l | | £l | ||
| Line Rainbow | | Line Rainbow | ||
| | | Changes color at each carriage return | ||
|- | |- | ||
| £g | | £g | ||
| Paragraph Rainbow | | Paragraph Rainbow | ||
| | | Changes color at each double carriage return | ||
|- | |- | ||
| £p | | £p | ||
| Caps/Punctuation | | 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 | | £n | ||
| Normal | | Normal | ||
| | | Cancels current mode and returns to normal output | ||
|- | |- | ||
| £v | | £v | ||
| Character Velocity | | Character Velocity | ||
| | | Follow with digit 0–9. 0 is fastest (no delay), 9 is slowest. Cancel with £v0 or RETURN. | ||
|- | |- | ||
| £c | | £c | ||
| Wait | | Wait | ||
| | | Pauses until a key is pressed | ||
|- | |- | ||
| £t | | £t | ||
| Tab | | 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 | | £i | ||
| Wait for Line of Input | | 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 === | |||
<strong>£a</strong> | <strong>£a</strong> outputs system or user-specific information. The digit following the command selects the output: | ||
{| class="wikitable | {| class="wikitable" | ||
|- | |- | ||
|+Message MCI Commands | |+ Message MCI Commands | ||
! Command | ! Command | ||
! Function | ! Function | ||
|- | |- | ||
| £a0 | | £a0 | ||
| Print | | Print text entered from last £i command | ||
|- | |- | ||
| £a1 | | £a1 | ||
| | | Current caller’s name/alias (NA$) | ||
|- | |- | ||
|£a2 | | £a2 | ||
| | | Caller’s last calling date (LD$) | ||
|- | |- | ||
| £a3 | | £a3 | ||
| Current time (T$) | | Current time (T$) | ||
|- | |- | ||
| £a4 | | £a4 | ||
| Current date (DA$) | | Current date (DA$) | ||
|- | |- | ||
| £a5 | | £a5 | ||
| | | Last caller’s name (LC$). If last call was network exchange, remote BBS name is shown. | ||
|- | |- | ||
| £a6 | | £a6 | ||
| | | Membership information field (DD$), SYSOP-defined | ||
|- | |- | ||
| £a7 | | £a7 | ||
| | | User’s real name (RN$) | ||
|- | |- | ||
| £a8 | | £a8 | ||
| User’s birth date (BD$) | | User’s birth date (BD$) | ||
|- | |- | ||
| £a9 | | £a9 | ||
| User’s phone number (PH$) | | User’s phone number (PH$) | ||
|- | |- | ||
| £aa | | £aa | ||
| | | Email or street address (A1$) | ||
|- | |- | ||
| £ab | | £ab | ||
| | | City, state, ZIP (A2$) | ||
|} | |} | ||
Note: Because DD$ may contain sensitive membership information, SETUP allows disabling of £a6 for security. | |||
=== The Variable MCI Command === | |||
<strong>£[</strong> | <strong>£[</strong> allows output of any BASIC variable or expression. An expression may be numeric or string-based, such as: | ||
<strong>5*4+3/16</strong> | |||
<strong>a$+mid$(str$(lv),2)</strong> | |||
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 ==== | |||
: {| class="wikitable | The table below lists common numeric and string tokens and their key combinations: | ||
{| class="wikitable" | |||
|- | |- | ||
|+BASIC Token Reference Chart | |+ BASIC Token Reference Chart | ||
! Token | ! Token | ||
! Hex | ! Hex | ||
| Line 135: | Line 140: | ||
! CHR$() | ! CHR$() | ||
|- | |- | ||
| + | | + | ||
| AA | | AA | ||
| C= + J | | C= + J | ||
| CHR$(170) | | CHR$(170) | ||
|- | |- | ||
| - | | - | ||
| AB | | AB | ||
| C= + K | | C= + K | ||
| CHR$(171) | | CHR$(171) | ||
|- | |- | ||
| * | | * | ||
| AC | | AC | ||
| C= + L | | C= + L | ||
| CHR$(172) | | CHR$(172) | ||
|- | |- | ||
| / | | / | ||
| AD | | AD | ||
| C= + Z | | C= + Z | ||
| CHR$(173) | | CHR$(173) | ||
|- | |- | ||
| ↑ | | ↑ | ||
| AE | | AE | ||
| C= + X | | C= + X | ||
| CHR$(174) | | CHR$(174) | ||
|- | |- | ||
| AND | | AND | ||
| AF | | AF | ||
| C= + C | | C= + C | ||
| CHR$(175) | | CHR$(175) | ||
|- | |- | ||
| OR | | OR | ||
| B0 | | B0 | ||
| C= + V | | C= + V | ||
| CHR$(176) | | CHR$(176) | ||
|- | |- | ||
| > | | > | ||
| B1 | | B1 | ||
| C= + B | | C= + B | ||
| CHR$(177) | | CHR$(177) | ||
|- | |- | ||
| = | | = | ||
| B2 | | B2 | ||
| C= + N | | C= + N | ||
| CHR$(178) | | CHR$(178) | ||
|- | |- | ||
| < | | < | ||
| B3 | | B3 | ||
| C= + M | | C= + M | ||
| CHR$(179) | | CHR$(179) | ||
|- | |- | ||
| SGN | | SGN | ||
| B4 | | B4 | ||
| C= + H | | C= + H | ||
| CHR$(180) | | CHR$(180) | ||
|- | |- | ||
| INT | | INT | ||
| B5 | | B5 | ||
| C= + J | | C= + J | ||
| CHR$(181) | | CHR$(181) | ||
|- | |- | ||
| ABS | | ABS | ||
| B6 | | B6 | ||
| C= + L | | C= + L | ||
| CHR$(182) | | CHR$(182) | ||
|- | |- | ||
| USR | | USR | ||
| B7 | | B7 | ||
| C= + Y | | C= + Y | ||
| CHR$(183) | | CHR$(183) | ||
|- | |- | ||
| FRE | | FRE | ||
| B8 | | B8 | ||
| C= + U | | C= + U | ||
| CHR$(184) | | CHR$(184) | ||
|- | |- | ||
| POS | | POS | ||
| B9 | | B9 | ||
| C= + O | | C= + O | ||
| CHR$(185) | | CHR$(185) | ||
|- | |- | ||
| SQR | | SQR | ||
| BA | | BA | ||
| SHIFT-@ | | SHIFT-@ | ||
| CHR$(186) | | CHR$(186) | ||
|- | |- | ||
| RND | | RND | ||
| BB | | BB | ||
| C= + F | | C= + F | ||
| CHR$(187) | | CHR$(187) | ||
|- | |- | ||
| LOG | | LOG | ||
| BC | | BC | ||
| C= + C | | C= + C | ||
| CHR$(188) | | CHR$(188) | ||
|- | |- | ||
| EXP | | EXP | ||
| BD | | BD | ||
| C= + X | | C= + X | ||
| CHR$(189) | | CHR$(189) | ||
|- | |- | ||
| COS | | COS | ||
| BE | | BE | ||
| C= + V | | C= + V | ||
| CHR$(190) | | CHR$(190) | ||
|- | |- | ||
| SIN | | SIN | ||
| BF | | BF | ||
| C= + B | | C= + B | ||
| CHR$(191) | | CHR$(191) | ||
|- | |- | ||
| TAN | | TAN | ||
| C0 | | C0 | ||
| SHIFT-* | | SHIFT-* | ||
| CHR$(192) | | CHR$(192) | ||
|- | |- | ||
| ATN | | ATN | ||
| C1 | | C1 | ||
| SHIFT-A | | SHIFT-A | ||
| CHR$(193) | | CHR$(193) | ||
|- | |- | ||
| PEEK | | PEEK | ||
| C2 | | C2 | ||
| SHIFT-B | | SHIFT-B | ||
| CHR$(194) | | CHR$(194) | ||
|- | |- | ||
| LEN | | LEN | ||
| C3 | | C3 | ||
| SHIFT-C | | SHIFT-C | ||
| CHR$(195) | | 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: | |||
[[File:variablemci1.jpeg|center|200px]] | |||
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: | |||
{| class="wikitable" | |||
|- | |- | ||
|+Automatic Keyword Cruncher Example | |+ Automatic Keyword Cruncher Example | ||
|+"int(rnd(0)*16+5)" | |+"int(rnd(0)*16+5)" | ||
! With Automatic Keyword Cruncher | ! With Automatic Keyword Cruncher | ||
! Without Automatic Keyword Cruncher | ! Without Automatic Keyword Cruncher | ||
|- | |- | ||
| [[File:variablemci2.jpeg|center|200px]] | | [[File:variablemci2.jpeg|center|200px]] | ||
| Line 291: | Line 296: | ||
|} | |} | ||
=== 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: [[textediting|Text Editing Features]] | |||
[[bbs operation|BBS Operation]] | |||
Latest revision as of 18:19, 23 February 2026
BBS Operation - MCI Commands
MCI Command Overview
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.
Standard MCI Commands
The table below lists the 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:
| 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:
| 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:
| 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

