Skip to content

MCI Codes

ENiGMA½ supports a variety of MCI codes. Some predefined codes produce information about the current user, system, or other statistics while others are used to instantiate a View.

MCI codes are composed of two characters and are prefixed with a percent (%) symbol.

Example

Some MCI codes have additional options that may be set directly from the code itself while others — and more advanced options — are controlled via the current theme.

A MCI code that appears in a menu.hjson entry corresponds to that found in it’s associated art file. This same MCI code can be referenced in the theme.hjson in order to apply a theme.

See Menus and Themes for more information.

There are many predefined MCI codes that can be used anywhere on the system (placed in any art file).

CodeDescription
BNBoard Name
VLVersion label, e.g. “ENiGMA½ v0.7.0”
VNVersion number, e.g. “0.7.0”: the release’s major.minor.patch only (no pre-release tag or git commit; --version shows the full version)
VRVersion revision: the git commit this install is at, e.g. “abc1234”, with “-dirty” added when tracked files are modified. Empty when it is not known (not a git checkout, unless the Docker image’s version names a commit). Meant for sysop screens such as the WFC
SNSysOp username
SRSysOp real name
SLSysOp location
SASysOp affiliations
SSSysOp sex
SESysOp email address
UNCurrent user’s username
UICurrent user’s user ID
UGCurrent user’s group membership(s)
URCurrent user’s real name
ASActivityPub subject, ie: “@SomeUser@yourhost.com”, “(disabled)” if AP is not enabled for the user
LOCurrent user’s location
UACurrent user’s age
BDCurrent user’s birthday (using theme date format)
USCurrent user’s sex
UECurrent user’s email address
UWCurrent user’s web address
UFCurrent user’s affiliations
UTCurrent user’s theme name
UDCurrent user’s theme ID (e.g. “luciano_blocktronics”)
UCCurrent user’s login/call count
NDCurrent user’s connected node number
IPCurrent user’s IP address
STCurrent user’s connected server name (e.g. “Telnet” or “SSH”)
FNCurrent user’s active file base filter name
DNCurrent user’s number of downloads
DKCurrent user’s download amount (formatted to appropriate bytes/megs/etc.)
UPCurrent user’s number of uploads
UKCurrent user’s upload amount (formatted to appropriate bytes/megs/etc.)
NRCurrent user’s upload/download ratio
KRCurrent user’s upload/download bytes ratio
MSCurrent user’s account creation date (using theme date format)
PSCurrent user’s post count
PCCurrent user’s post/call ratio
MDCurrent user’s status/viewing menu/activity
MACurrent user’s active message area name
MCCurrent user’s active message conference name
MLCurrent user’s active message area description
CMCurrent user’s active message conference description
SHCurrent user’s term height
SWCurrent user’s term width
ACCurrent user’s total achievements
APCurrent user’s total achievement points
DRCurrent user’s number of door runs
DMCurrent user’s total amount of time spent in doors
TRCurrent user’s time remaining today, in minutes, or users.unlimitedTimeText when no limit applies. See Time Limits
TACurrent user’s time allowed today, in minutes, or users.unlimitedTimeText when no limit applies
TDCurrent user’s time used today, in minutes. Always a real figure: usage is tracked even where nothing is enforced
DTCurrent date (using theme date format)
CTCurrent time (using theme time format)
OSSystem OS (Linux, Windows, etc.)
OASystem architecture (x86, x86_64, arm, etc.)
SCSystem CPU model
NVSystem underlying Node.js version
ANCurrent active node count
TCTotal login/calls to the system ever
TTTotal login/calls to the system today
RRDisplays a random rumor
SDTotal downloads, system wide
SOTotal downloaded amount, system wide (formatted to appropriate bytes/megs/etc.)
SUTotal uploads, system wide
SPTotal uploaded amount, system wide (formatted to appropriate bytes/megs/etc.)
TFTotal number of files on the system
TBTotal file base size (formatted to appropriate bytes/megs/gigs/etc.)
TPTotal messages posted/imported to the system currently
PTTotal messages posted/imported to the system today
FTTotal number of uploads to the system today
FBTotal upload amount today (formatted to appropriate bytes/megs/etc. )
DDTotal number of downloads from the system today
DBTotal download amount today (formatted to appropriate bytes/megs/etc. )
MBSystem memory
MFSystem free memory
LASystem load average (e.g. 0.25)
(May not be available on some platforms)
CLSystem current load percentage
(May not be available on some platforms)
UUSystem uptime in friendly format
LCLast caller to the system (username)
LTTime of last caller
LDDate of last caller
TUTotal number of users on the system
NTTotal new users today
NMCount of new messages address to the current user across all message areas in which they have access
NPCount of new private mail to the current user
NACount of new messages in the current user’s active message area
NCCount of new messages in the current user’s active message conference (areas they can read)
NSCount of new messages across the current user’s new scan areas (all areas they can read if they have not chosen any)
ATTotal messages in the current user’s active message area
IAIndicator as to whether the current user is available or not. See also getStatusAvailIndicators() in Themes
IVIndicator as to whether the current user is visible or not. See also getStatusVisibleIndicators() in Themes
PIIngress bytes for the current process (since ENiGMA started up)
PEEgress bytes for the current process (since ENiGMA started up)

Some additional special case codes also exist:

CodeDescription
CF##Moves the cursor position forward ## characters
CB##Moves the cursor position back ## characters
CU##Moves the cursor position up ## characters
CD##Moves the cursor position down ## characters
XYA special code that may be utilized for placement identification when creating menus or to extend an otherwise empty space in an art file down the screen.

A View is a control placed on a form that can display variable data or collect input. One example of a View is a Vertical Menu (%VM): Old-school BBSers may recognize this as a lightbar menu.

CodeNameDescriptionNotes
TLText LabelDisplays textStatic content. See Text View
ETEdit TextCollect user inputSingle line entry. See Edit Text
MEMasked Edit TextCollect user input using a maskSee Masked Edit and Mask Edits below.
MTMulti Line Text EditMulti line edit controlUsed for FSE, display of FILE_ID.DIZ, etc. See Multiline Text Edit
BTButtonA button…it’s a button. See Button
VMVertical MenuA vertical menuAKA a vertical lightbar; Useful for lists. See Vertical Menu
HMHorizontal MenuA horizontal menuAKA a horizontal lightbar. See Horizontal Menu
FMFull MenuA menu that can go both vertical and horizontal.See Full Menu
SMSpinner MenuA spinner input controlSelect one from multiple options. See Spinner Menu
TMToggle MenuA toggle menuCommonly used for Yes/No style input. See Toggle Menu
KEKey EntryA single key input controlThink hotkeys
TKTickerA continuously scrolling marqueeScrolls text left or right in a fixed-width window. See Ticker View
SBStatus BarAn auto-refreshing text labelRe-renders MCI format codes on a timer. See Status Bar View
TVTable ViewA list in columnsGroup rows, a header and sorting; can stand in for VM. See Table View
AVAnimationFrames played in a box over the artInline frames, a frame sheet or one art file per frame. See Animation View

Mask Edits (%ME) use the special maskPattern property to control a mask. This can be useful for gathering dates, phone numbers, so on.

maskPattern’s can be composed of the following characters:

  • #: Numeric 0-9
  • A: Alpha a-z, A-Z
  • @: Alphanumeric (combination of the previous patterns)
  • &: Any “printable” character

Any other characters are literals.

An example of a mask for a date may look like this: ##/##/####.

Additionally, the following theme stylers can be applied:

  • styleSGR1: Controls literal character colors for non-focused controls
  • styleSGR2: Controls literal character colors for focused controls
  • styleSGR3: Controls fill colors (characters that have not yet received input).

All of the style properties can take pipe codes such as |00|08.

As mentioned above, MCI codes can (and often should) be explicitly tied to a View Identifier. Simply speaking this is a number representing the particular view. These can be useful to reference in code, apply themes, etc.

A view ID is tied to a MCI code by specifying it after the code. For example: %VM1 or %SM10.

Some rules for view IDs:

  • A form holds one view per ID. Two codes with the same ID in one art file (%TL1 and %ET1) clash: the second is skipped and a Duplicate MCI view ID warning is logged.
  • Codes without an ID (%BN) get generated IDs from 100 up.
  • An mci key in menu.hjson or theme.hjson is the code followed by the view ID, and nothing else: ET1, TL20. IDs in keys go up to 99.
  • Views are matched to mci keys by ID. A key whose code is not the code in the art (ET8 for a %ME8) still configures that view, as it always has, but a warning is logged naming the menu, the form and the key. Fix the key to match the art.
  • A key that is not exactly a code and an ID (MET3) is read from the first code and ID found in it (ET3), with a warning.

A view does not need a code in the art. An mci key with a position places a view there, as if the art held the code at that spot. This is useful where a % code would draw over the art itself, such as a ticker over a logo, and it lets a theme add or move views on a stock menu without touching the art.

mci: {
// no %TK50 in the art: the ticker is created at row 23, column 2
TK50: {
position: { row: 23, col: 2 }
width: 76
text: "Welcome to the board!"
}
// %TL2 is in the art: the explicit position wins and moves it
TL2: {
position: { row: 5, col: 40 }
}
}
  • position is { row: <row>, col: <col> }, counted from the art’s top-left corner (row 1, column 1). For full screen art drawn from the top of the screen, that is the screen position. Art drawn lower down (a menu’s prompt below its art, a prompt drawn at a position, art a module places in part of the screen) moves its placed views with it, just as it moves its % codes.
  • Any view code can be placed, input views included. A placed input view takes part in the form like any other: focus order (by ID) and form data.
  • With a code in the art and a position, the position wins.
  • A position off the screen is skipped with a warning. Art taller than the screen that scrolls is not supported for placed views.
  • Use high IDs for placed views (for example 50 to 99), so they do not clash with IDs the art uses now or later. IDs run from 1 to 99. If the art already uses the ID for a different code, the position is ignored with a warning, and the key’s other settings still apply to the art’s view, as any key’s do.
  • A theme can add a placed view to a stock menu: an mci key the menu does not have is added by the theme. See Themes.
  • A menu with no form (an art-only display menu) needs a form for the mci block in menu.hjson: form: { 0: { mci: { ... } } }. Adding a form to such a menu in menu.hjson stops it moving on to its next menu by itself. Putting the mci block in the theme instead keeps that behaviour:
theme.hjson
customization: {
menus: {
fullLoginSequenceUserStats: {
mci: {
TK50: {
position: { row: 24, col: 1 }
width: 79
text: "Thanks for calling!"
}
}
}
}
}

Pressing Enter on a form only submits it from a view with submit: true. If no view in the form’s mci block sets submit, the view with the highest ID among the configured keys gets it (if the art has no view with that ID, no view does). Placed views (a position with no code in the art) are left out of that choice, so a theme adding a placed view with a high ID does not move submit off the form’s real field. To be sure, set submit: true on the view that should submit.

Predefined MCI codes and other Views can have properties set via menu.hjson and further themed via theme.hjson. See Themes for more information on this subject.

PropertyDescription
textStyleSets the standard (non-focus) text style. See Text Styles below
focusTextStyleSets focus text style. See Text Styles below
itemSpacingUsed to separate items in menus such as Vertical Menu and Horizontal Menu Views.
heightSets the height of views such as menus that may be > 1 character in height
widthSets the width of a view
focusIf set to true, establishes initial focus
textSet’s the view’s text if applicable, such as a TextView or EditTextView amongst others. See MCI Formatting below for advanced formatting options using the
submitIf set to true any accept action upon this view will submit the encompassing form. See The Submit View
positionPlaces the view at { row, col } from the art’s top-left corner, with or without a code in the art. See Placing Views from Configuration
itemFormatSets the format for a list entry. See Entry Formatting below
focusItemFormatSets the format for a focused list entry. See Entry Formatting below

These are just a few of the properties set on various views. Use the source Luke, as well as taking a look at the default menu.hjson and theme.hjson files!

Often a module will provide custom properties that receive format objects (See Entry Formatting below). Custom property formatting can be declared in the config block. For example, browseInfoFormat10…N (where N is up to 99) in the file_area_list module received a fairly extensive format object that contains {fileName}, {estReleaseYear}, etc. A module may ship defaults for these; an entry in config always wins, and an empty string hides the view. See Default custom info formats.

Standard style types available for textStyle and focusTextStyle:

StyleDescription
normalLeaves text as-is. This is the default.
upperENIGMA BULLETIN BOARD SOFTWARE
lowerenigma bulletin board software
titleEnigma Bulletin Board Software
first lowereNIGMA bULLETIN bOARD sOFTWARE
small vowelseNiGMa BuLLeTiN BoaRD SoFTWaRe
big vowelsEniGMa bUllEtIn bOArd sOftwArE
small iENiGMA BULLETiN BOARD SOFTWARE
mixedEnIGma BUlLEtIn BoaRd SOfTWarE (randomly assigned)
l33t3n1gm4 bull371n b04rd 50f7w4r3

Various strings can be formatted using a syntax that allows width & precision specifiers, text styling, etc. Depending on the context, various elements can be referenced by {name}. Additional text styles can be supplied as well. The syntax is largely modeled after Python’s string format mini language.

For more advanced layouts, you may want to apply formatting to MCI codes. In this case, an alternative syntax is supported similar to standard Entry Formatting.

MCI codes can be surrounded by { and } in the text field in your theme.hjson for a Text Label (%TL aka Text View). Some examples:

text: "|00|07{BN!stylel33t}" // render board name in "l33t" text
// MCI codes that produce a number can use appropriate stylers as well
text: "|00|07{SD:,}"
// ...or perhaps
text: "|00:07{SD!countWithAbbr}"

Some of the text styles mentioned above are also available in the mini format language:

StyleDescription
normalLeaves text as-is. This is the default.
toUpperCase or styleUpperENIGMA BULLETIN BOARD SOFTWARE
toLowerCase or styleLowerenigma bulletin board software
styleTitleEnigma Bulletin Board Software
styleFirstLowereNIGMA bULLETIN bOARD sOFTWARE
styleSmallVowelseNiGMa BuLLeTiN BoaRD SoFTWaRe
styleBigVowelsEniGMa bUllEtIn bOArd sOftwArE
styleSmallIENiGMA BULLETiN BOARD SOFTWARE
styleMixedEnIGma BUlLEtIn BoaRd SOfTWarE (randomly assigned)
styleL33t3n1gm4 bull371n b04rd 50f7w4r3

Additional text styles are available for numbers:

StyleDescription
sizeWithAbbrFile size (converted from bytes) with abbreviation such as 1 MB, 2.2 GB, 34 KB, etc.
sizeWithoutAbbrJust the file size (converted from bytes) without the abbreviation. For example: 1024 becomes 1.
sizeAbbrJust the abbreviation given a file size (converted from bytes) such as MB or GB.
sizeWholeWithAbbrAs sizeWithAbbr, rounded to a whole number: 137 MB rather than 137.09 MB.
sizeWholeWithoutAbbrAs sizeWithoutAbbr, rounded to a whole number: 137 rather than 137.09.
countWithAbbrCount with abbreviation such as 100 K, 4.3 B, etc.
countWithoutAbbrJust the count
countAbbrJust the abbreviation such as M for millions.
durationHoursConverts the provided hours value to something friendly such as 4 hours, or 4 days.
durationMinutesConverts the provided minutes to something friendly such as 10 minutes or 2 hours
durationSecondsConverts the provided seconds to something friendly such as 23 seconds or 2 minutes

Suppose a format object contains the following elements: userName and affils. We could create a itemFormat entry that builds a item to our specifications: |04{userName!styleFirstLower} |08- |13{affils}. This may produce a string such as this:

Example