Read about scripting
Generates an ANSI colour sequence
View list of data type meanings
BSTR ANSI(short Code);
This generates an ANSI colour sequence, like this:
ESC [ code m
The code number is supplied as an argument.
This is intended to be used with the ANSINote function - which lets you write to the output window with ANSI formatting, or to send to other clients via the chat system.
Useful numbers to use would be:
3: blink (is rendered as italic)
22: cancel bold
23: cancel blink
24: cancel underline
27: cancel inverse
Foreground (text) colour
// 256 colour ANSI foreground
38;5;n where n is 0 to 255
// 256 colour ANSI background
48;5;n where n is 0 to 255
Suggestion - you could conceivably replace colours in incoming chat messages by doing a world.Replace using ANSI, providing the incoming ANSI codes conform exactly to the rendering used here.
mymessage = world.Replace (incoming_message, ANSI (36), ANSI (37))
This would hopefully replace the code for Cyan with the code for White.
Available in MUSHclient version 3.37 onwards.
ANSINote "This is normal" & ANSI (33) & " and this is yellow"
ANSINote ("This is normal" + ANSI (33) + " and this is yellow");
ANSINote ("This is normal" . ANSI (33) . " and this is yellow");
world.ANSINote ("This is normal",
world.ANSI (33, 47), " and this is yellow")
AnsiNote ("This is normal ",
ANSI (33, 47),
"and this is yellow on white")
You can supply multiple arguments, as in the above example.
Each one will generate its own ANSI code, so you can easily do multiple changes
(eg. foreground, background, bold) in a single call to ANSI.
If you supply multiple arguments they will be placed into the same ANSI sequence, like this:
ANSI (33, 47) --> ESC[33;47m
A string consisting of: ESC "[" Code "m"
See Also ...
(AdjustColour) Adjust an RGB colour
(AnsiNote) Make a note in the output window from text with ANSI colour codes imbedded
(BoldColour) Gets/sets the RGB colour for one of the 8 ANSI bold colours
(ChatMessage) Sends a message to a chat user (raw format)
(ChatNote) Does a note using ANSI codes for the chat system
(ColourNameToRGB) Converts a named colour to a RGB colour code.
(ColourNote) Sends a message to the output window in specified colours
(ColourTell) Sends a message to the output window in specified colours - not terminated by a newline
(CustomColourBackground) Sets the RGB value for the background of a custom colour
(CustomColourText) Sets the RGB value for the text of a custom colour
(GetCustomColourName) Gets the name of a custom colour
(GetMapColour) Returns the mapping for how a particular colour will be displayed
(MapColour) Changes the colour mapping - the way colours are displayed
(MapColourList) Returns an array of all the mapped colours
(NormalColour) Gets/sets the RGB colour for one of the 8 ANSI normal colours
(NoteColour) Chooses which custom colour will be used for world notes.
(NoteColourBack) Chooses which RGB colour will be used for world notes - background colour
(NoteColourFore) Chooses which RGB colour will be used for world notes - text colour
(NoteColourName) Chooses which RGB colour name will be used for world notes - text and background
(NoteColourRGB) Chooses which RGB colour will be used for world notes - text and background
(PickColour) Invokes the MUSHclient colour picker dialog
(RGBColourToName) Converts an RGB colour code to its equivalent name
(SetCustomColourName) Sets the name of a custom colour
(StripANSI) Strips ANSI colour sequences from a string
(Help topic: function=ANSI)