forked from irchelp/irchelp.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnocolor.txt
More file actions
180 lines (127 loc) · 4.76 KB
/
nocolor.txt
File metadata and controls
180 lines (127 loc) · 4.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
if (0){
Script: nocolor, http://www.best.com/~linux/ircII/nocolor
Author: [email protected], lzh@Undernet#ircII
Description: ircII script to remove mIRC color codes
as specified in http://www.best.com/~linux/ircII/mIRCcolorSpec
Version: $Id: nocolor,v 2.4 1997/02/04 12:05:20 lzh Exp $
Adtl Kywrds: colour stripper filter out cstrip
1. save to nocolor
2. /load nocolor
3. no more color codes
This version is a lot faster than the 1.x versions because it operates
on as many characters as it can at a time.
Installation
Save this to a file named nocolor if you don't already have it
there. The name is important as it is used in the /nocolor command. If
you change the name you will need to change it in the nocolor alias.
at the unix command prompt do:
cd # without any arguments should return you to your home dir
mkdir .irc # makes the .irc dir (ircII's default user script dir)
mv nocolor .irc # moves nocolor to .irc
echo ~ # shows what ~ means as used below.
shows (for me):
/home/lzh
irc # start ircII (use other command if appropriate)
In ircII:
/set load # note(ircII allows you to abbreviate many things)
ircII displays (for me):
*** Current value of LOAD_PATH is ~/.irc:/usr/lib/irc/script
If ~/.irc isn't in LOAD_PATH and you want to add it:
/eval set load_path ~/.irc:$load_path
If that was needed you most likely would also want to add it to your
~/.ircrc, as noted below.
/which nocolor
ircII displays (for me):
*** /home/lzh/.irc/nocolor
/load nocolor
ircII displays:
*** Viewing Color Codes turned off
*** You can use /nocolor to toggle viewing Color Codes
voila! no more mIRC colors. :)
/nocolor
ircII displays:
*** Viewing C1,4ColorC Codes turned on
*** Viewing Color Codes turned on
With color viewing on you'll see both the line containing the codes
followed by the line with them removed.
/nocolor
ircII displays:
*** Viewing Color Codes turned off
If you would like nocolor loaded whenever you run ircII you can add:
load nocolor
to the .ircrc file in your home directory. If one doesn't exist of
course you can create it with a text editor.
---------------------------------------------------------------------
In the following ^C or ^<letter> means a single control character. If
you would like to produce a ^C, /bind ^c self_insert should work. Note
in the /bind command an actual ^ is typed.
mIRC users apparently type ^K to insert the ^C and then enter the
foreground and background numbers or just ^C to turn off a color
change. To ircII users this appears as an inverse C followed by 1 or 2
digits and possibly a comma and 1 or 2 more digits. Beautifully
intermixed with the other characters to look like an awful mess.
Example (you usually won't see something this bad):
C11,11PCC11,11rC11,11eCC11,11tCC11,11tCC11,11yC C11,11HCC11,11CuCC11,11hC?
P r e t t y H u h ?
Note the 1's are just there to show where a color value would go.
www servers negotiate with the client to determine what the client
supports, why not irc servers? In that scheme color codes would only
be seen if requested, leaving the existing clients unchanged.
If you need or want to put a real Control C in [^C],
in emacs you type ^Q then ^C, or
in vi you type ^V followed by ^C, while in insert mode.
}
@nc.c = [^C]
if (@nc.c == 2){
input "" assign nc.c $$0
parsekey quote_character
type ^c
parsekey send_line
}
if (@nc.c == 1){
@nc.d = [//if (index(0123456789 $mid($nc.i 1 $*))>-1)]
@nc.p = [@nc.i=nc.i+1]
@nc.a = [@nc.o=nc.o##mid($nc.i $nc.n $*)]
alias nc.rmv {
#$nc.i = index
#$nc.n = number of chars between index and next ^C
@nc.i=0
#while ^C is between index and end
//while ((nc.n=index($nc.c $mid($nc.i 999 $*)))>-1){
#$nc.a = append normal chars to output var
$nc.a
#set index to ^C
@nc.i=nc.i+nc.n
#set index past ^C or ^C's if several are next to each-other
//if ((nc.n=index(^$nc.c $mid($nc.i 999 $*)))>-1){
@nc.i=nc.i+nc.n
#$nc.d = if char is digit
#$nc.p = increment pointer (index)
$nc.d{
$nc.p;$nc.d{$nc.p}
#if char is comma
//if (mid($nc.i 1 $*)==[,]){$nc.p;$nc.d{$nc.p;$nc.d{$nc.p}}}
}
}{
#else only ^C's remain so don't check any more
@nc.i=999
}
}
$nc.a
@function_return=nc.o
@nc.o=[]
}
alias nocolor {if (nc.w){@nc.w=0}{@nc.w=1};load nocolor}
if (nc.w){
on ^window "% *$nc.c*" {//echo $1-;//echo $nc.rmv($1-)}
eval echo *** Viewing $(nc.c)1,4Color$nc.c Codes turned on
}{
on ^window "% *$nc.c*" {//echo $nc.rmv($1-)}
eval echo *** Viewing $(nc.c)1,4Color$nc.c Codes turned off
}
if (nc.w==[]){
echo *** You can use /nocolor to toggle viewing Color Codes
}
}{
echo *** nocolor needs a real ^C (Control C).
}