Join us in Outworldz at www.outworldz.com:9000 or follow us:

Search dozens of selected web sites for OpenSim and LSL script

New! Script Meta-Search will search thousands of scripts here and at other sites for LSL or Opensim scripts.
Loading

Want to add a script or a project? Upload it and a half million people will see it and your name here this year.

Home   Show All
Category: Contributor: Creator
Online Indicator Online_Status_Indicator_v1  

Online_Status_Indicator_v1

Online Status Indicator v1.lsl

Category: Online Indicator
By : Anonymous
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for Online_Status_Indicator_v1
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Online_Status_Indicator_v1_1.lsl
1
2 integer glow = TRUE;
3 integer bounce = FALSE;
4 integer interpColor = TRUE;
5 integer interpSize = TRUE;
6 integer wind = FALSE;
7 integer followSource = FALSE;
8 integer followVel = FALSE;
9
10 // Choose a pattern from the following:
11 // PSYS_SRC_PATTERN_EXPLODE
12 // PSYS_SRC_PATTERN_DROP
13 // PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY
14 // PSYS_SRC_PATTERN_ANGLE_CONE
15 // PSYS_SRC_PATTERN_ANGLE
16 integer pattern = PSYS_SRC_PATTERN_ANGLE_CONE;
17
18 key target = "";
19
20 float age = 4;
21 float minSpeed = 0;
22 float maxSpeed = 0;
23 string texture = "";
24 float startAlpha = 1;
25 float endAlpha = 1;
26 vector startColor = <1,1,1>;
27 vector endColor = <1,1,1>;
28 vector startSize = <.1,.1,.02>;
29 vector endSize = <.1,.1,.6>;
30 vector push = <0,0,0>;
31
32
33 float rate = .01;
34 float radius = .2;
35 integer count = 50;
36 float outerAngle = 0;
37 float innerAngle = PI;
38 vector omega = <5,5,5>;
39
40 integer flags;
41
42 updateParticles()
43 {
44 if(target == "owner") target = llGetOwner();
45 if(target == "self") target = llGetKey();
46 if(glow) flags = flags | PSYS_PART_EMISSIVE_MASK;
47 if(bounce) flags = flags | PSYS_PART_BOUNCE_MASK;
48 if(interpColor) flags = flags | PSYS_PART_INTERP_COLOR_MASK;
49 if(interpSize) flags = flags | PSYS_PART_INTERP_SCALE_MASK;
50 if(wind) flags = flags | PSYS_PART_WIND_MASK;
51 if(followSource) flags = flags | PSYS_PART_FOLLOW_SRC_MASK;
52 if(followVel) flags = flags | PSYS_PART_FOLLOW_VELOCITY_MASK;
53 if(target != "") flags = flags | PSYS_PART_TARGET_POS_MASK;
54
56 PSYS_PART_FLAGS, flags,
57 PSYS_PART_START_COLOR, startColor,
58 PSYS_PART_END_COLOR, endColor,
59 PSYS_PART_START_SCALE, startSize,
60 PSYS_PART_END_SCALE, endSize,
61 PSYS_SRC_PATTERN, pattern,
63 PSYS_SRC_ACCEL, push,
68 PSYS_SRC_TARGET_KEY, target,
69 PSYS_SRC_INNERANGLE, innerAngle,
70 PSYS_SRC_OUTERANGLE, outerAngle,
71 PSYS_SRC_OMEGA, omega,
72 PSYS_SRC_TEXTURE, texture,
73 PSYS_PART_START_ALPHA, startAlpha,
74 PSYS_PART_END_ALPHA, endAlpha
75 ]);
76 }
77
78 integer gIsOnline = FALSE;
79 integer gLandOwner = FALSE;
80 key gKey = NULL_KEY;
81 string gName = "";
82 float UPDATE_INTERVAL = 5.0;
83
84 updateStatus(string s){
86 if(s=="1"){
87 gIsOnline = TRUE;
88 }else{
89 gIsOnline = FALSE;
90 }
91 }
92
93 key getWhom(){
94 if(gKey == NULL_KEY){
95 if(gLandOwner){
96 return llGetLandOwnerAt(llGetPos());
97 }else{
98 return llGetOwner();
99 }
100 }else{
101 return gKey;
102 }
103 }
104
105 doUpdate(){
107 }
108
109 updateName(){
111 }
112
113 enable(){
114 updateName();
115 doUpdate();
117 llWhisper(0,"Online status display enabled.");
118
119 }
120 disable(){
122 llSetText("Display Disabled",<1,1,1>,1);
123 llSetColor(<0,0,1>,ALL_SIDES);
124 startColor = <0,0,1>;
125 endColor = <0,0,1>;
126 updateParticles();
127 llWhisper(0,"Online status display disabled.");
128 }
129
130 default
131 {
133 {
134 llListen(0, "", llGetOwner(), "");
135 enable();
136 llWhisper(0,"Type /ol help for a list of commands");
137 }
138 on_rez(integer n){
140 }
141 dataserver(key req, string data){
142 if(data == "1" || data == "0"){
143 updateStatus(data);
144 }else{
145 gName = data;
146 llSetText("Getting online status for " + gName,<1,1,1>,1);
147 llSetColor(<0,0,1>,ALL_SIDES);
148 startColor = <0,0,1>;
149 endColor = <0,0,1>;
150 updateParticles();
151 llSetTimerEvent(UPDATE_INTERVAL);
152 }
153 }
154 timer(){
155 doUpdate();
156 if(gIsOnline){
157 llSetText(gName + " is Online",<1,1,1>,1);
158 llSetColor(<0,1,0>,ALL_SIDES);
159 startColor = <0,1,0>;
160 endColor = <0,1,0>;
161 updateParticles();
162 }else{
163 llSetText(gName + " is Offline",<1,1,1>,1);
164 llSetColor(<1,0,0>,ALL_SIDES);
165 startColor = <1,0,0>;
166 endColor = <1,0,0>;
167 updateParticles();
168 }
169 }
170 listen(integer number, string name, key id, string msg){
171 if(llGetSubString(msg, 0,0) != "/"){
172 return;
173 }
174 list argv = llParseString2List(msg, [" "], []);
175 integer argc = llGetListLength(argv);
176 string cmd = llToLower(llList2String(argv, 0));
177 if(cmd == "/ol"){
178 string arg = llToLower(llList2String(argv, 1));
179 if(arg=="on"){
180 enable();
181 }else if(arg=="off"){
182 disable();
183 }else if(arg=="land"){
184 gLandOwner = TRUE;
185 gKey = NULL_KEY;
186 updateName();
187 }else if(arg=="key"){
188 gKey = llList2Key(argv,2);
189 updateName();
190 }else if(arg=="me"){
191 gLandOwner = FALSE;
192 gKey = NULL_KEY;
193 updateName();
194 }else if(arg=="help"){
195 llWhisper(0,"/ol on - activate online status display");
196 llWhisper(0,"/ol off - disable online status display");
197 llWhisper(0,"/ol land - display online status for owner of this land");
198 llWhisper(0,"/ol me - display your online status");
199 }
200 }
201 }
202
203 }
204 // END //

Back to the Best Free Tools in Second Life and OpenSim.