May 7, 2011, 4:58 a.m.
posted by voila
IRC does not limit you to using plain text. Add extra formatting, such as underlining and italics, to your messages.
Even though most IRC clients support color, simpler formatting can sometimes be more effective. Too much use of color tends to annoy people. In such circumstance, channel operators have at their disposal the option of banning the use of color. If this happens, it will still be possible to send messages with simpler formatting. To highlight a particular word in a message, you could underline it. To catch somebody's attention, you could make your message bold. To emphasize something, you could make it italic. All of these options are possible, regardless of channel restrictions.
1 Formatting Text in mIRC
mIRC lets you view and send formatted text. Many other IRC clients behave in similar ways. Three main types of text formatting are available from mIRC. All of these can be accessed by keyboard shortcuts. These styles are complementary, so you can make text both bold and underlined, for example.
When composing a line or message, the text can be formatted as bold by pressing Ctrl-B. You will see a control character appear in your message. Anything you type after this will appear in bold. You will not see the result of this until you actually send your message to the server.
1.3 Italic or reversed
Italic text can also be used. However, because some clients are incapable of rendering italic text, you will find that most clients (including those that can render italic text) display this as normal text with the background and foreground colors swapped. For this reason, it is also known as reversed text formatting and can be achieved in mIRC by pressing Ctrl-R.
Combinations of these options are illustrated in Figure.
Combinations of formatting rendered by mIRC
2 Formatting Text with a Bot
Formatting text with the aforementioned attributes is simpler than applying colors, as only one control character is required for each style. There are no parameters to add after each style character.
String bold = "\u0002This is bold";
String underlined = "\u001FThis is underlined";
2.3 Italic or reversed
String reversed = "\u0016This is reversed";
To remove all formatting from a message, use ASCII character 0x0F, or Unicode character \u000F. Any text after this point in the message will return to its normal state, unless other formatting characters are applied again.
String mixture = "\u0002Bold\u000F and gone";
3 Formatting Text with PircBot
The Colors class in the PircBot Java IRC API [Hack #35] contains useful constants, not only for coloring, but also for formatting text with these styles. Using these is probably easier than remembering the Unicode characters.
String bold = Colors.BOLD + "This is bold"; String underlined = Colors.UNDERLINE + "This is underlined"; String reversed = Colors.REVERSE + "This is reversed"; String mixture = Colors.BOLD + "Bold" + Colors.NORMAL + " and gone";