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
Profile Status Online_Status_Indicator  

Online_Status_Indicator

Online_Status_Indicator

Category: Profile Status
By : janasadvertise
Created: 2012-07-26 Edited: 2012-07-26
Worlds: Second Life

the Zip file

Download all files for Online_Status_Indicator
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Online_Status_Indicator_1.lsl
1 integer gIsOnline = FALSE;
2 integer gLandOwner = FALSE;
3 key gKey = NULL_KEY;
4 string gName = "";
5 float UPDATE_INTERVAL = 5.0;
6 string onlinetexture = "_onlinetexture_";
7 string offlinetexture = "_offlinetexture_";
8
9 updateStatus(string s){
11 if(s=="1"){
12 gIsOnline = TRUE;
13 }else{
14 gIsOnline = FALSE;
15 }
16 }
17
18 key getWhom(){
19 if(gKey == NULL_KEY){
20 if(gLandOwner){
21 return llGetLandOwnerAt(llGetPos());
22 }else{
23 return llGetOwner();
24 }
25 }else{
26 return gKey;
27 }
28 }
29
30 doUpdate(){
32 }
33
34 updateName(){
36 }
37
38 enable(){
39 updateName();
40 doUpdate();
42 llWhisper(0,"Online status display enabled.");
43
44 }
45 disable(){
47 llSetText("Display Disabled",<1,1,1>,1);
48 llSetTexture(offlinetexture, 1);
49 llWhisper(0,"Online status display disabled.");
50 }
51
52 default
53 {
55 {
56 llListen(0, "", llGetOwner(), "");
57 enable();
58 llWhisper(0,"Type /ol help for a list of commands");
59 }
60 on_rez(integer n){
62 }
63 dataserver(key req, string data){
64 if(data == "1" || data == "0"){
65 updateStatus(data);
66 }else{
67 gName = data;
68 llSetText("Getting online status for " + gName,<1,1,1>,1);
69 llSetTexture(offlinetexture, 1);
70 llSetTimerEvent(UPDATE_INTERVAL);
71 }
72 }
73 timer(){
74 doUpdate();
75 if(gIsOnline){
76 llSetText(gName + " is Online",<1,1,1>,1);
77 llSetTexture(onlinetexture, 1);
78 }else{
79 llSetText(gName + " is Offline",<1,1,1>,1);
80 llSetTexture(offlinetexture, 1);
81 }
82 }
83 listen(integer number, string name, key id, string msg){
84 if(llGetSubString(msg, 0,0) != "/"){
85 return;
86 }
87 list argv = llParseString2List(msg, [" "], []);
88 integer argc = llGetListLength(argv);
89 string cmd = llToLower(llList2String(argv, 0));
90 if(cmd == "/ol"){
91 string arg = llToLower(llList2String(argv, 1));
92 if(arg=="on"){
93 enable();
94 }else if(arg=="off"){
95 disable();
96 }else if(arg=="land"){
97 gLandOwner = TRUE;
98 gKey = NULL_KEY;
99 updateName();
100 }else if(arg=="key"){
101 gKey = llList2Key(argv,2);
102 updateName();
103 }else if(arg=="me"){
104 gLandOwner = FALSE;
105 gKey = NULL_KEY;
106 updateName();
107 }else if(arg=="help"){
108 llWhisper(0,"/ol on - activate online status display");
109 llWhisper(0,"/ol off - disable online status display");
110 llWhisper(0,"/ol land - display online status for owner of this land");
111 llWhisper(0,"/ol me - display your online status");
112 }
113 }
114 }
115
116 }

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