Project

General

Profile

Formatting text » History » Version 44

Per Amundsen, 05/17/2015 03:34 AM

1 1 Per Amundsen
{{>toc}}
2
3
h1. Formatting text
4
5
AdiIRC supports control codes for formatting text.
6
7 12 Per Amundsen
All control codes can be combined to format the same block.
8
9 43 Per Amundsen
Most clients supports these control codes, so they can used to send formatted text to others as well as formatting incoming text [[Scripting_Events|events]] using the [[/echo]] command.
10 42 Per Amundsen
11 2 Per Amundsen
h1. Colorchar
12
13 4 Per Amundsen
Colors blocks of text.
14
15 7 Per Amundsen
Ascii character [[$chr]](3)
16 4 Per Amundsen
17
Ctrl + K can be used in editbox to type this character.
18
19 15 Per Amundsen
The character can be followed by 1-2 digits that represent the color number.
20 1 Per Amundsen
21 7 Per Amundsen
By specifying a comma after the digits, you can add a 1-2 digit background color as well.
22
23 44 Per Amundsen
The default colors can be changed in [[Options_Dialog|Options]] -> [[Colors_Options|Colors]] -> [[Colors_Options#mIRC-Colors|mIRC Colors]].
24 7 Per Amundsen
25 8 Per Amundsen
A second color character can be used to stop the coloring and revert to default line color.
26
27 6 Per Amundsen
*Example*
28
<pre>
29
; Prints the text 'Hello World' with color 4 which is red by default.
30
//echo -ag $chr(3) $+ 3 Hello world
31 25 Per Amundsen
</pre>
32 6 Per Amundsen
33 25 Per Amundsen
Result: %{color:#FF0000}Hello World%
34
35
<pre>
36 13 Per Amundsen
; Prints the text 'Hello' with color 4 which is red by default and 'world' is the default line color.
37 36 Per Amundsen
//echo -ag $chr(3) $+ 3 Hello $+ $chr(3) world
38 26 Per Amundsen
</pre>
39 8 Per Amundsen
40 25 Per Amundsen
Result: %{color:#FF0000}Hello% world
41
42 34 Per Amundsen
<pre>
43 6 Per Amundsen
; Prints the text 'Hello World' with color 4 which is red by default and background color 12 which is blue by default.
44
//echo -ag $chr(3) $+ 3,12 Hello world
45
</pre>
46 25 Per Amundsen
47
Result: %{background:#0000CC;color:#FF0000}Hello world%
48 1 Per Amundsen
49 2 Per Amundsen
h1. Boldchar 
50 1 Per Amundsen
51 7 Per Amundsen
Makes the block use a *bold* font.
52 1 Per Amundsen
53 7 Per Amundsen
Ascii character [[$chr]](2)
54
55
Ctrl + B can be used in editbox to type this character.
56
57 8 Per Amundsen
*Example*
58
<pre>
59
//echo -ag $chr(2) this text is bold $chr(2) this text is not
60
</pre>
61
62 27 Per Amundsen
Result: *this text is bold* this text is not
63
64 1 Per Amundsen
h1. Italicchar 
65
66 7 Per Amundsen
Makes the block use a _italic_ font.
67 1 Per Amundsen
68 7 Per Amundsen
Ascii character [[$chr]](29)
69
70
Ctrl + I can be used in editbox to type this character.
71
72 9 Per Amundsen
*Example*
73 8 Per Amundsen
<pre>
74 38 Per Amundsen
//echo -ag $chr(29) this text is italic $chr(29) this text is not
75 8 Per Amundsen
</pre>
76
77 27 Per Amundsen
Result: _this text is italic_ this text is not
78
79 1 Per Amundsen
h1. Underlinechar 
80
81 7 Per Amundsen
Makes the block use a +underline+ font.
82
83
Ascii character [[$chr]](31)
84
85 10 Per Amundsen
Ctrl + U can be used in editbox to type this character.
86 9 Per Amundsen
87 8 Per Amundsen
*Example*
88
<pre>
89 38 Per Amundsen
//echo -ag $chr(31) this text is underline $chr(31) this text is not
90 8 Per Amundsen
</pre>
91 2 Per Amundsen
92 27 Per Amundsen
Result: +this text is underline+ this text is not
93
94 2 Per Amundsen
h1. Stopchar 
95 1 Per Amundsen
96 10 Per Amundsen
Stops all color and font formatting.
97
98
Ascii character [[$chr]](15)
99 1 Per Amundsen
100 38 Per Amundsen
Ctrl + O can be used in editbox to type this character.
101 11 Per Amundsen
102
*Example*
103
104 1 Per Amundsen
<pre>
105 11 Per Amundsen
//echo -ag $chr(3) $+ 4 $+ $chr(2) this text is bold and colored $chr(15) this text is not
106 1 Per Amundsen
</pre>
107 27 Per Amundsen
108 33 Per Amundsen
Result: *%{color:#FF0000}this text is bold and colored%* this text is not
109 1 Per Amundsen
110 13 Per Amundsen
h1. Alternative colorchar 
111 1 Per Amundsen
112 13 Per Amundsen
AdiIRC has an alterinative color character as of 1.9.7, this is AdiIRC only.
113
114
Unicode character [[$chr]](61442)
115
116
Works the same as colorchar, except it takes a hexcolor format RRGGBB same as html colors.
117
118 35 Per Amundsen
A normal color character can be used to stop the coloring and revert to default line color.
119 14 Per Amundsen
120 13 Per Amundsen
*Example*
121
<pre>
122
; Prints the text 'Hello World' with hex color FF0000 which is red.
123
//echo -ag $chr(61442) $+ FF0000 Hello world
124 20 Per Amundsen
</pre>
125
126 21 Per Amundsen
Result: %{color:#FF0000}Hello World%
127 13 Per Amundsen
128 22 Per Amundsen
<pre>
129 37 Per Amundsen
; Prints the text 'Hello' with hex color FF0000 which is red and 'world' is the default line color.
130 36 Per Amundsen
//echo -ag $chr(61442) $+ FF0000 Hello $+ $chr(3) world
131 22 Per Amundsen
</pre>
132 13 Per Amundsen
133 22 Per Amundsen
Result: %{color:#FF0000}Hello% world
134
135
<pre>
136 13 Per Amundsen
; Prints the text 'Hello World' with hex color FF0000 which is red and hex background color 0000CC which is bluet.
137
//echo -ag $chr(61442) $+ FF0000,0000CC Hello world
138
</pre>
139 22 Per Amundsen
140 24 Per Amundsen
Result: %{background:#0000CC;color:#FF0000}Hello world%