Online Indicator using texture
|
|
Kilmarac Drago
Registered User
Join date: 5 Sep 2004
Posts: 44
|
08-26-2005 19:36
Greetings,
Is anyone aware of a script that can be placed into an object that would change the texture depending on if the specified user, or perhaps easier, the owner of the object is online or not.
Thanks
|
|
a lost user
Join date: ?
Posts: ?
|
08-26-2005 19:38
Yes, wrote one 2 days ago for someone 
|
|
Kilmarac Drago
Registered User
Join date: 5 Sep 2004
Posts: 44
|
08-26-2005 19:44
could I either get (or reasonably purchase) a full mods one? I have a friend who wants to make signs with something like this, that people in her group can use.
Thanks
|
|
a lost user
Join date: ?
Posts: ?
|
08-26-2005 19:56
Well I'm kinda waiting for you to get in the game again  Got it all ready for you to show you.
|
|
Kairen Overdrive
Registered User
Join date: 12 Jul 2005
Posts: 38
|
08-27-2005 05:36
key id; string name; default { state_entry() { llSetTimerEvent(5); name = llKey2Name(llGetOwner()); key = llGetOwner(); timer() { llRequestAgentData(key, DATA_ONLINE); } dataserver(key queryid, string data) { if ( data == "TRUE" ) { // is online so execute this code llSetTexT(name + " is online.",<0,1,0>,1.0); llSetColor(<0,1,0>,ALL_SIDES); llSetTexture("insert online texture here", ALL_SIDES); } else { // is offline so execute this code llSetTexT(name + " is offline.",<1,0,0>,1.0); llSetColor(<1,0,0>,ALL_SIDES); llSetTexture("insert offline texture here", ALL_SIDES); } } }
I just wrote that off the top of my head. So it might work or not work. You will need to change the text in the quotes to a texture you put into the objects contents OR the key of the texture.
|
|
a lost user
Join date: ?
Posts: ?
|
08-27-2005 05:54
That will work.. once.. for the owner of the object. I have a prefab for this very "product" I'm not going to post the script.. if other people are going to, that's fine.  It's a little bit more involved than what you have posted but yes.. that's the "basics" of what needs to happen.
|
|
a lost user
Join date: ?
Posts: ?
|
08-27-2005 06:08
Here's my freebie online detector, complete with notecard information: Online Detector v1.1 by Gaz Hornpipe The Online Detector by Gaz Hornpipe is a cheap, fully-functional object that detects whether people are on or off line. To keep track of the amount of people "interested" in this object the price is set to 1L but it is free to copy/transfer. Features: - Does not have to be owned by the person it is detecting like other similar products. - Simple menu-based setup. - Free to copy/transfer to friends. Functions: Online: - Detector turns green for instant online recognition. - Detector shows name of person being detected. - May send IM messages to the person being detected when touched. - Person being detected may touch the detector to turn IMs on or off. Offline: - Detector turns red for instant offline recognition. - Detector shows name of person being detected. - Detector shows time and date the person logged off. - Will not send IMs when person is offline. string name_str = ""; string last_online = ""; key person_id = ""; integer listening = 0; integer IM = TRUE; integer ONLINE = FALSE;
string get_date() { integer t;
integer hours; integer minutes; integer seconds; string time;
t = llRound(llGetWallclock());
// one hour has 3600 seconds hours = t / 3600; // get hours (integer division chops off the decimals) // the modulo operator % gets the remainder of a divison // in this case, the remaining seconds after removing the full hours minutes = (t % 3600) / 60; // divide by 60 because we want minutes, chops off decimals again
seconds = t % 60; // get the seconds that didn't fit into full minutes time = (string)hours + ":"; if(minutes < 10) time += "0" + (string)minutes + ":"; else time += (string)minutes + ":"; if(seconds < 10) time += "0" + (string)seconds; else time += (string)seconds; string DateToday = ""; string DateUTC = llGetDate(); list DateList = llParseString2List(DateUTC, ["-", "-"], []); integer year = llList2Integer(DateList, 0); integer month = llList2Integer(DateList, 1); integer day = llList2Integer(DateList, 2); if(day < 10) DateToday = "0"; DateToday += (string)day + "-"; if(month == 1) DateToday += "Jan-"; if(month == 2) DateToday += "Feb-"; if(month == 3) DateToday += "Mar-"; if(month == 4) DateToday += "Apr-"; if(month == 5) DateToday += "May-"; if(month == 6) DateToday += "Jun-"; if(month == 7) DateToday += "Jul-"; if(month == 8) DateToday += "Aug-"; if(month == 9) DateToday += "Sep-"; if(month == 10) DateToday += "Oct-"; if(month == 11) DateToday += "Nov-"; if(month == 12) DateToday += "Dec-"; DateToday += (string)year; time = time + " " + DateToday; return time; }
start_listen(key id) { if(listening) llListenRemove(listening); listening = llListen(512,"",id,""); }
default { on_rez(integer p) { llResetScript(); } state_entry() { llSetText("Online Detector\nTouch for Menu",<1,1,1>,1); }
touch_start(integer total_number) { if(name_str == "") { start_listen(llDetectedKey(0)); llDialog(llDetectedKey(0),"Click Set ID to use your ID for the detection:",["Set ID"],512); return; } if(llDetectedName(0) == name_str) { start_listen(llDetectedKey(0)); llDialog(llDetectedKey(0),"Turn the InstantMessager ON or OFF:",["On","Off"],512); return; } else { if(IM && ONLINE) { llInstantMessage(person_id, llDetectedName(0) + " is paging you from " + llGetRegionName()); llWhisper(0,"A message has been sent to " + llKey2Name(person_id)); } } } listen(integer channel, string name, key id, string message) { if(message == "Set ID") { person_id = id; name_str = name; llListenRemove(listening); llWhisper(0, "/me will now detect if " + name_str + " is online or not."); llSetText(name_str + "\nInitializing...",<1,1,1>,1); llSetTimerEvent(5.0); return; } if(message == "On") { IM = TRUE; llWhisper(0, "/me will send you IMs when touched."); llListenRemove(listening); return; } if(message == "Off") { IM = FALSE; llWhisper(0, "/me will no longer send IMs when touched."); llListenRemove(listening); return; } } timer() { if(person_id) { llRequestAgentData(person_id,DATA_ONLINE); } } dataserver(key query, string data) { string text = ""; if((integer)data == 1) { ONLINE = TRUE; llSetColor(<0,1,0>,ALL_SIDES); text = name_str + " is ONLINE"; if(IM) text += "\nClick to Send IM"; llSetText(text, <0.25,1.0,0.25>,1); last_online = ""; } else { ONLINE = FALSE; llSetColor(<1,0,0>,ALL_SIDES); text = name_str + " is OFFLINE"; if(last_online == "") last_online = get_date(); text += "\nLast Online: " + last_online; llSetText(text, <1.0,0.25,0.25>,1); } } }
This "little" script can be modified for what you need.. all I ask is that you give credit where credit is due.
|
|
Kairen Overdrive
Registered User
Join date: 12 Jul 2005
Posts: 38
|
08-27-2005 07:03
Well the thread starter was asking for a online indicator using textures not text 
|
|
WhiteFire Sondergaard
Registered User
Join date: 17 Jun 2005
Posts: 21
|
08-27-2005 13:35
From: Kairen Overdrive Well the thread starter was asking for a online indicator using textures not text  He did say that it could be modified to do what the fellow needed it to... string name_str = ""; string last_online = ""; key person_id = ""; integer listening = 0; integer IM = TRUE; integer ONLINE = FALSE; string texture_on = "texture_on"; string texture_off = "texture_off";
string get_date() { integer t;
integer hours; integer minutes; integer seconds; string time;
t = llRound(llGetWallclock());
// one hour has 3600 seconds hours = t / 3600; // get hours (integer division chops off the decimals) // the modulo operator % gets the remainder of a divison // in this case, the remaining seconds after removing the full hours minutes = (t % 3600) / 60; // divide by 60 because we want minutes, chops off decimals again
seconds = t % 60; // get the seconds that didn't fit into full minutes time = (string)hours + ":"; if(minutes < 10) time += "0" + (string)minutes + ":"; else time += (string)minutes + ":"; if(seconds < 10) time += "0" + (string)seconds; else time += (string)seconds; string DateToday = ""; string DateUTC = llGetDate(); list DateList = llParseString2List(DateUTC, ["-", "-"], []); integer year = llList2Integer(DateList, 0); integer month = llList2Integer(DateList, 1); integer day = llList2Integer(DateList, 2); if(day < 10) DateToday = "0"; DateToday += (string)day + "-"; if(month == 1) DateToday += "Jan-"; if(month == 2) DateToday += "Feb-"; if(month == 3) DateToday += "Mar-"; if(month == 4) DateToday += "Apr-"; if(month == 5) DateToday += "May-"; if(month == 6) DateToday += "Jun-"; if(month == 7) DateToday += "Jul-"; if(month == 8) DateToday += "Aug-"; if(month == 9) DateToday += "Sep-"; if(month == 10) DateToday += "Oct-"; if(month == 11) DateToday += "Nov-"; if(month == 12) DateToday += "Dec-"; DateToday += (string)year; time = time + " " + DateToday; return time; }
start_listen(key id) { if(listening) llListenRemove(listening); listening = llListen(512,"",id,""); }
default { on_rez(integer p) { llResetScript(); } state_entry() { //llSetText("Online Detector\nTouch for Menu",<1,1,1>,1); }
touch_start(integer total_number) { if(name_str == "") { start_listen(llDetectedKey(0)); llDialog(llDetectedKey(0),"Click Set ID to use your ID for the detection:",["Set ID"],512); return; } if(llDetectedName(0) == name_str) { start_listen(llDetectedKey(0)); llDialog(llDetectedKey(0),"Turn the InstantMessager ON or OFF:",["On","Off"],512); return; } else { if(IM && ONLINE) { llInstantMessage(person_id, llDetectedName(0) + " is paging you from " + llGetRegionName()); llWhisper(0,"A message has been sent to " + llKey2Name(person_id)); } } } listen(integer channel, string name, key id, string message) { if(message == "Set ID") { person_id = id; name_str = name; llListenRemove(listening); llWhisper(0, "/me will now detect if " + name_str + " is online or not."); //llSetText(name_str + "\nInitializing...",<1,1,1>,1); llSetTimerEvent(5.0); return; } if(message == "On") { IM = TRUE; llWhisper(0, "/me will send you IMs when touched."); llListenRemove(listening); return; } if(message == "Off") { IM = FALSE; llWhisper(0, "/me will no longer send IMs when touched."); llListenRemove(listening); return; } } timer() { if(person_id) { llRequestAgentData(person_id,DATA_ONLINE); } } dataserver(key query, string data) { string text = ""; if((integer)data == 1) { ONLINE = TRUE; //llSetColor(<0,1,0>,ALL_SIDES); text = name_str + " is ONLINE"; if(IM) text += "\nClick to Send IM"; //llSetText(text, <0.25,1.0,0.25>,1); last_online = ""; llSetTexture(texture_on, ALL_SIDES); } else { ONLINE = FALSE; //llSetColor(<1,0,0>,ALL_SIDES); text = name_str + " is OFFLINE"; if(last_online == "") last_online = get_date(); text += "\nLast Online: " + last_online; //llSetText(text, <1.0,0.25,0.25>,1); llSetTexture(texture_off, ALL_SIDES); } } } Happy?  Feel free to replace the strings with UUIDs in the top instead of dragging the textures into the prims. This is untested in game, may contain typos. But I doubt it. Fairly simple change.
|
|
a lost user
Join date: ?
Posts: ?
|
08-27-2005 21:05
What they actually wanted, after speaking to them in the game, is something a lot more involved than a simple Online Detector that used textures. I have made what they wanted now and they are happy. Basically ended up with an Escort rental system, with all sorts of features and money events. The script is about twice the size of the one given above.
|
|
Tobyus Flanagan
Registered User
Join date: 1 Jul 2007
Posts: 6
|
Need Help
12-31-2008 04:27
From: someone Here's my freebie online detector, complete with notecard information: Online Detector v1.1 by Gaz Hornpipe The Online Detector by Gaz Hornpipe is a cheap, fully-functional object that detects whether people are on or off line. To keep track of the amount of people "interested" in this object the price is set to 1L but it is free to copy/transfer. Features: - Does not have to be owned by the person it is detecting like other similar products. - Simple menu-based setup. - Free to copy/transfer to friends. Functions: Online: - Detector turns green for instant online recognition. - Detector shows name of person being detected. - May send IM messages to the person being detected when touched. - Person being detected may touch the detector to turn IMs on or off. Offline: - Detector turns red for instant offline recognition. - Detector shows name of person being detected. - Detector shows time and date the person logged off. - Will not send IMs when person is offline. string name_str = ""; string last_online = ""; key person_id = ""; integer listening = 0; integer IM = TRUE; integer ONLINE = FALSE; string get_date() { integer t; integer hours; integer minutes; integer seconds; string time; t = llRound(llGetWallclock()); // one hour has 3600 seconds hours = t / 3600; // get hours (integer division chops off the decimals) // the modulo operator % gets the remainder of a divison // in this case, the remaining seconds after removing the full hours minutes = (t % 3600) / 60; // divide by 60 because we want minutes, chops off decimals again seconds = t % 60; // get the seconds that didn't fit into full minutes time = (string)hours + ":"; if(minutes < 10) time += "0" + (string)minutes + ":"; else time += (string)minutes + ":"; if(seconds < 10) time += "0" + (string)seconds; else time += (string)seconds; string DateToday = ""; string DateUTC = llGetDate(); list DateList = llParseString2List(DateUTC, ["-", "-"], []); integer year = llList2Integer(DateList, 0); integer month = llList2Integer(DateList, 1); integer day = llList2Integer(DateList, 2); if(day < 10) DateToday = "0"; DateToday += (string)day + "-"; if(month == 1) DateToday += "Jan-"; if(month == 2) DateToday += "Feb-"; if(month == 3) DateToday += "Mar-"; if(month == 4) DateToday += "Apr-"; if(month == 5) DateToday += "May-"; if(month == 6) DateToday += "Jun-"; if(month == 7) DateToday += "Jul-"; if(month == 8) DateToday += "Aug-"; if(month == 9) DateToday += "Sep-"; if(month == 10) DateToday += "Oct-"; if(month == 11) DateToday += "Nov-"; if(month == 12) DateToday += "Dec-"; DateToday += (string)year; time = time + " " + DateToday; return time; } start_listen(key id) { if(listening) llListenRemove(listening); listening = llListen(512,"",id,""); } default { on_rez(integer p) { llResetScript(); } state_entry() { llSetText("Online Detector\nTouch for Menu",<1,1,1>,1); } touch_start(integer total_number) { if(name_str == "") { start_listen(llDetectedKey(0)); llDialog(llDetectedKey(0),"Click Set ID to use your ID for the detection:",["Set ID"],512); return; } if(llDetectedName(0) == name_str) { start_listen(llDetectedKey(0)); llDialog(llDetectedKey(0),"Turn the InstantMessager ON or OFF:",["On","Off"],512); return; } else { if(IM && ONLINE) { llInstantMessage(person_id, llDetectedName(0) + " is paging you from " + llGetRegionName()); llWhisper(0,"A message has been sent to " + llKey2Name(person_id)); } } } listen(integer channel, string name, key id, string message) { if(message == "Set ID") { person_id = id; name_str = name; llListenRemove(listening); llWhisper(0, "/me will now detect if " + name_str + " is online or not."); llSetText(name_str + "\nInitializing...",<1,1,1>,1); llSetTimerEvent(5.0); return; } if(message == "On") { IM = TRUE; llWhisper(0, "/me will send you IMs when touched."); llListenRemove(listening); return; } if(message == "Off") { IM = FALSE; llWhisper(0, "/me will no longer send IMs when touched."); llListenRemove(listening); return; } } timer() { if(person_id) { llRequestAgentData(person_id,DATA_ONLINE); } } dataserver(key query, string data) { string text = ""; if((integer)data == 1) { ONLINE = TRUE; llSetColor(<0,1,0>,ALL_SIDES); text = name_str + " is ONLINE"; if(IM) text += "\nClick to Send IM"; llSetText(text, <0.25,1.0,0.25>,1); last_online = ""; } else { ONLINE = FALSE; llSetColor(<1,0,0>,ALL_SIDES); text = name_str + " is OFFLINE"; if(last_online == "") last_online = get_date(); text += "\nLast Online: " + last_online; llSetText(text, <1.0,0.25,0.25>,1); } } } This "little" script can be modified for what you need.. all I ask is that you give credit where credit is due. Nice script, but would be nice if it would read the Key from the Description of the Object. I have tried tweaking it for a while but can't figure out how to do it exactly.
|