MongoosePeople. Places. Questionable inventions.

All help topics · Link to this topic

Showing help on 'ansi-programming'

There are a few verbs and properties that programmers might need to know about when programming things that interface with the ANSI system. Some of the more useful ones include:

$ansi_pc:ansi_option (STR option) - returns player's setting for <option>
$ansi_pc:set_ansi_option (LIST - sets player's options
options)
$ansi_utils:add_noansi () - any text sent from the current task
will not be translated by the ANSI PC.
$ansi_utils:remove_noansi () - undoes a call to :add_noansi, this
is not usually necessary because it
gets removed from the queue when the
task ends anyway.
$ansi_utils.noansi_queue - list of tasks that are currently
being ignored.
$ansi_utils:contains_codes (STR text) returns true if <text> contains
any ANSI codes.
$ansi_utils:delete (STR text) - returns <text> with all the ANSI
codes stripped.
$ansi_utils:length (STR text) - returns the length of <text> not
including the ANSI codes.
$ansi_utils:index/rindex (STR - same as the builtins index() and
text, STR text2[, NUM case] rindex() but ignore ANSI codes.
$ansi_utils:cutoff (STR text, NUM - same as text[start..end] for strings
start, NUM end) but ignores ANSI codes.
$ansi_utils:cutoff_assign (STR - same as text[start..end] = replacement
text, NUM start, NUM end, STR
replacement)
$ansi_utils:notify (OBJ plr, STR - Same as raw notify() but replaces
line) ANSI.
$ansi_utils:self_diagnostic () - Runs a diagnostic on the ANSI stuff.
$ansi_utils:trusts (OBJ player) - Is <player> trusted by the ANSI stuff?
$ansi_utils:cutoff_locs (STR text - Returns a list of the real starting and
NUM start, NUM end) and ending locations.
$ansi_utils:setadd (LIST l, ANY - Same as setadd() but doesn't add it if
element) element is already in the list (ignoring
ANSI codes)
$ansi_utils:setremove (LIST l, - Same as setremove() but doesn't add it
ANY element) if element is already in the list
(ignoring ANSI codes)
$ansi_utils:terminate_normal (STR - Returns text with a [normal] code
text) at the end.
$ansi_utils:ansi_title (OBJ plr) - Returns <plr>'s name with ANSI codes.
$ansi_utils:quote_ansi (STR text) - Puts [null] codes in the middle of
all the other codes so they don't show.
$ansi_utils:update_player_codes - Should be run whenever <player>'s
(OBJ player) options are changed.

Trusted Users only:
$ansi_utils:update_all () - Updates all the caches and regexps
$ansi_utils:add_group (STR group) - adds <group> to the list of groups
$ansi_utils:add_code (STR code, - adds <code> to the codes in group
STR group, ANY sequence) <group> and set's it's ANSI sequence
to <sequence>.