-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathccng_old.lsl
265 lines (259 loc) · 9.25 KB
/
ccng_old.lsl
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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
/* For better readability, extend the size of the editor until this comment fits fully on one line. */
/* TODO
-Fix weird child prim lag when restoring ocolor.
- Make it faster? D: */
integer colorRoot = 1; // Needed for checking if we want to recolor the root prim
list foundPrims = []; // Internal use, don't touch.
vector color; // Internal use, don't touch.
vector ocolor;
integer fp; // Internal use, don't touch.
integer isTyping; // Typing indicator bit
integer x;
string GetLinkDesc(integer link){
return (string)llGetObjectDetails(llGetLinkKey(link), (list)OBJECT_DESC);}
blink(){
doColor(<0.75294, 1.00000, 0.00000>);
llSleep(0.03);
doColor(ocolor);
llSleep(0.03);
doColor(<0.75294, 1.00000, 0.00000>);
llSleep(0.03);
doColor(ocolor);
llSleep(0.01);
doColor(<0.75294, 1.00000, 0.00000>);
llSleep(0.01);
doColor(ocolor);
llSleep(0.05);
doColor(<0.75294, 1.00000, 0.00000>);
llSleep(0.7);
doColor(ocolor);
llSleep(0.4);
doColor(<1, 1, 1>);
llSleep(0.08);
doColor(<0.75294, 1.00000, 0.00000>);
llSleep(0.05);
doColor(ocolor);
llSleep(0.01);
doColor(<0, 0, 0>);
llSleep(1);
doColor(<1.00000, 0.25098, 0.00000>);
llSleep(1);
doColor(<0, 0, 0>);
llSleep(1);
doColor(<1.00000, 0.25098, 0.00000>);
llSleep(1);
doColor(<0, 0, 0>);
llSleep(1);
doColor(<1.00000, 0.25098, 0.00000>);
llSleep(1);
doColor(<0.60784, 0.97255, 1.00000>);
llSleep(0.03);
doColor(<0, 0, 0>);
llSleep(0.1);
doColor(<0.60784, 0.97255, 1.00000>);
llSleep(0.05);
doColor(<0, 0, 0>);
llSleep(0.1);
doColor(<0.60784, 0.97255, 1.00000>);
llSleep(0.08);
doColor(<0, 0, 0>);
llSleep(2.5);
/* doColor(ocolor);
llSleep(0.2);
doColor(<0.75294, 1.00000, 0.00000>);
llSleep(0.1);
doColor(ocolor);
llSleep(0.15);
doColor(<0.75294, 1.00000, 0.00000>);
llSleep(0.1);
doColor(ocolor);
llSleep(0.12);
doColor(<0.75294, 1.00000, 0.00000>);
llSleep(0.1);
doColor(ocolor);
llSleep(0.1);
doColor(<0.75294, 1.00000, 0.00000>);
llSleep(0.1);
doColor(ocolor);
llSleep(0.08); */
doColor(ocolor);
x=0;
}
list colorList = [
<1.00000, 0.00000, 0.00000>,
<0.31373, 0.00000, 0.00000>,
<1.00000, 0.50196, 0.00000>,
<1.00000, 0.80000, 0.40000>,
<0.70588, 0.25098, 0.00000>,
<1.00000, 0.40000, 0.40000>,
<0.00000, 0.00000, 1.00000>,
<0.40000, 1.00000, 1.00000>,
<0.00000, 0.00000, 0.31373>,
<1.00000, 0.81961, 0.00000>,
<1.00000, 1.00000, 0.40000>,
<0.84314, 0.84314, 0.00000>,
<1.00000, 1.00000, 1.00000>,
<0.50196, 0.00000, 0.50196>,
<0.80000, 0.40000, 1.00000>,
<0.25098, 0.00000, 0.50196>,
<0.00000, 1.00000, 0.00000>,
<0.50196, 1.00000, 0.00000>,
<0.00000, 0.50196, 0.00000>,
<0.00000, 0.00000, 0.00000>,
<0.60000, 0.60000, 0.60000>,
<0.40000, 0.40000, 0.40000>,
<0.20000, 0.20000, 0.20000>,
<0.65490, 0.96863, 0.24314>,
<0.60784, 0.97255, 1.00000>,
<1.00000, 0.25098, 0.00000>,
<0.75294, 1.00000, 0.00000>,
<0.58431, 0.52549, 0.86667>,
<1, 0.4705882352941176, 0.2980392156862745>
]
}
}
colorit(string message){
if(llToLower(message) == "glow red")
llList2Vector(colorList,1);
else if(llToLower(message) == "glow dkred")
llList2Vector(colorList,2);
else if(llToLower(message) == "glow orange")
llList2Vector(colorList,3);
else if(llToLower(message) == "glow ltorange")
llList2Vector(colorList,4);
else if(llToLower(message) == "glow dkorange")
llList2Vector(colorList,5);
else if(llToLower(message) == "glow pink")
llList2Vector(colorList,6);
else if(llToLower(message) == "glow blue")
llList2Vector(colorList,7);
else if(llToLower(message) == "glow ltblue")
llList2Vector(colorList,8);
else if(llToLower(message) == "glow dkblue")
llList2Vector(colorList,9);
else if(llToLower(message) == "glow yellow")
llList2Vector(colorList,10);
else if(llToLower(message) == "glow ltyellow")
llList2Vector(colorList,11);
else if(llToLower(message) == "glow dkyellow")
llList2Vector(colorList,12);
else if(llToLower(message) == "glow white")
llList2Vector(colorList,13);
else if(llToLower(message) == "glow purple")
llList2Vector(colorList,14);
else if(llToLower(message) == "glow ltpurple")
llList2Vector(colorList,15);
else if(llToLower(message) == "glow dkpurple")
llList2Vector(colorList,16);
else if(llToLower(message) == "glow green")
llList2Vector(colorList,17);
else if(llToLower(message) == "glow ltgreen")
llList2Vector(colorList,18);
else if(llToLower(message) == "glow dkgreen")
llList2Vector(colorList,19);
else if(llToLower(message) == "glow black")
llList2Vector(colorList,20);
else if(llToLower(message) == "glow ltgray")
llList2Vector(colorList,21);
else if(llToLower(message) == "glow gray")
llList2Vector(colorList,22);
else if(llToLower(message) == "glow dkgray")
llList2Vector(colorList,23);
else if(llToLower(message) == "glow reactor")
llList2Vector(colorList,24);
else if(llToLower(message) == "glow tron")
llList2Vector(colorList,25);
else if(llToLower(message) == "glow corrupt")
llList2Vector(colorList,26);
else if(llToLower(message) == "glow viral")
llList2Vector(colorList,27);
else if (llToLower(message) == "glow violet")
llList2Vector(colorList,28);
else if (llToLower(message) == "glow singularity")
llList2Vector(colorList,29);
else if(llToLower(message) == "glow random")
color = <llFrand(1.0),llFrand(1.0),llFrand(1.0)>;
else{
color = llGetColor(0);}
// llOwnerSay((string)color);
doColor(color);
if(llGetFreeMemory() < 1000){
llOwnerSay("Running out of memory!\nResetting!");
llResetScript();
}
}
doColor(vector dcolor)
{
// llOwnerSay((string)dcolor);
integer i;
for(i = 0; i < llGetListLength(foundPrims); i ++){
// Set color
llSetLinkColor(llList2Integer(foundPrims, i),dcolor, ALL_SIDES); }
// we do this to color the root prim if it contains
// the name in the description
if (colorRoot){
llSetColor(dcolor, ALL_SIDES); }
}
default{
state_entry(){
if(llGetListLength(foundPrims) < 1){
for(fp = 1; fp <= llGetNumberOfPrims(); fp ++){
if(llGetLinkName(fp) == "ColorPrim"){
foundPrims += fp;}
}
}
llListen(9,"",llGetOwner(),"");
llListen(9,"cycler","","");
llSetMemoryLimit(llGetUsedMemory() + 4096);
llSetTimerEvent(0.5);}
// We re-use the listener system from what we are replacing,
listen(integer channel, string name, key is, string message){
if(message == "blink"){
blink();
}
colorit(message);
}
timer(){
llSetTimerEvent(0);
if((llGetAgentInfo(llGetOwner())&AGENT_TYPING)){
isTyping = 1;
state typing;
} // endif
else{
isTyping = 0;
ocolor = llGetColor(0);}
llSetTimerEvent(0.5);
} // end of timer
}
state typing{
state_entry(){llSetTimerEvent(0.2);}
timer(){
ocolor = llGetColor(0);
isTyping = 1;
while((llGetAgentInfo(llGetOwner())&AGENT_TYPING)){
vector ncolor = <llFrand(1.0),llFrand(1.0),llFrand(1.0)>;
llSetColor(ncolor,ALL_SIDES);
llSleep(0.031);
integer i;
for(i = 0; i < llGetListLength(foundPrims); i ++){
// Set color
llSetLinkColor(
llList2Integer(foundPrims,i),
ncolor, ALL_SIDES);
llSleep(0.001); }
}
if(isTyping){
isTyping = 0;
llSetColor(ocolor,ALL_SIDES);
integer i;
for(i = 0; i < llGetListLength(foundPrims); i ++){
// Set color
// llSetColor(ocolor,ALL_SIDES);
llSetLinkColor(
llList2Integer(foundPrims,i),
ocolor, ALL_SIDES);
} // end for
state default;
} // endif
} // end
}