Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Discussion: Online status and online tracker IM sender

Packard Sonic
Registered User
Join date: 2 Jun 2006
Posts: 9
10-19-2006 18:40
I'm some what new to scripting, but ive been trying to put two scripts together that should work together but im at a loss at how to do it. I'll post the two scripts which are usefull in them selves and if some one could figure a way to put them together and post it here, that would be most apprecated.

Online tracking Script:
CODE

integer glow = TRUE;
integer bounce = FALSE;
integer interpColor = TRUE;
integer interpSize = TRUE;
integer wind = FALSE;
integer followSource = FALSE;
integer followVel = FALSE;

// Choose a pattern from the following:
// PSYS_SRC_PATTERN_EXPLODE
// PSYS_SRC_PATTERN_DROP
// PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY
// PSYS_SRC_PATTERN_ANGLE_CONE
// PSYS_SRC_PATTERN_ANGLE
integer pattern = PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY;

key target = "";

float age = 4;
float minSpeed = 0;
float maxSpeed = 0;
string texture = "";
float startAlpha = 1;
float endAlpha = 1;
vector startColor = <1,1,1>;
vector endColor = <1,1,1>;
vector startSize = <.1,.1,.02>;
vector endSize = <.1,.1,.6>;
vector push = <0,0,0>;


float rate = .01;
float radius = .2;
integer count = 50;
float outerAngle = 0;
float innerAngle = PI;
vector omega = <5,5,5>;

integer flags;

updateParticles()
{
if (target == "owner") target = llGetOwner();
if (target == "self") target = llGetKey();
if (glow) flags = flags | PSYS_PART_EMISSIVE_MASK;
if (bounce) flags = flags | PSYS_PART_BOUNCE_MASK;
if (interpColor) flags = flags | PSYS_PART_INTERP_COLOR_MASK;
if (interpSize) flags = flags | PSYS_PART_INTERP_SCALE_MASK;
if (wind) flags = flags | PSYS_PART_WIND_MASK;
if (followSource) flags = flags | PSYS_PART_FOLLOW_SRC_MASK;
if (followVel) flags = flags | PSYS_PART_FOLLOW_VELOCITY_MASK;
if (target != "") flags = flags | PSYS_PART_TARGET_POS_MASK;

llParticleSystem([ PSYS_PART_MAX_AGE, age,
PSYS_PART_FLAGS, flags,
PSYS_PART_START_COLOR, startColor,
PSYS_PART_END_COLOR, endColor,
PSYS_PART_START_SCALE, startSize,
PSYS_PART_END_SCALE, endSize,
PSYS_SRC_PATTERN, pattern,
PSYS_SRC_BURST_RATE, rate,
PSYS_SRC_ACCEL, push,
PSYS_SRC_BURST_PART_COUNT, count,
PSYS_SRC_BURST_RADIUS, radius,
PSYS_SRC_BURST_SPEED_MIN, minSpeed,
PSYS_SRC_BURST_SPEED_MAX, maxSpeed,
PSYS_SRC_TARGET_KEY, target,
PSYS_SRC_INNERANGLE, innerAngle,
PSYS_SRC_OUTERANGLE, outerAngle,
PSYS_SRC_OMEGA, omega,
PSYS_SRC_TEXTURE, texture,
PSYS_PART_START_ALPHA, startAlpha,
PSYS_PART_END_ALPHA, endAlpha
]);
}

integer gIsOnline = FALSE;
integer gLandOwner = FALSE;
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//***PUT THE KEY OF THE PERSON IN THE ""***
key gKey = " ";
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
string gName = "";
float UPDATE_INTERVAL = 5.0;

updateStatus(string s){
key k = llGetLandOwnerAt(llGetPos());
if(s=="1"){
gIsOnline = TRUE;
}else{
gIsOnline = FALSE;
}
}

key getWhom(){
if(gKey == NULL_KEY){
if(gLandOwner){
return llGetLandOwnerAt(llGetPos());
}else{
return gKey;
}
}else{
return gKey;
}
}

doUpdate(){
llRequestAgentData(getWhom(),DATA_ONLINE);
}

updateName(){
llRequestAgentData(getWhom(),DATA_NAME);
}

enable(){
updateName();
doUpdate();
llSetTimerEvent(1);
llWhisper(0,"Online status display enabled.");

}
disable(){
llSetTimerEvent(0);
// llSetText("Display Disabled",<1,1,1>,1);
llSetColor(<0,0,1>,ALL_SIDES);
startColor = <0,0,1>;
endColor = <0,0,1>;
updateParticles();
llWhisper(0,"Online status display disabled.");
}

default
{
state_entry()
{
llListen(0, "", llGetOwner(), "");
enable();
llWhisper(0,"Type /ol help for a list of commands");
}
on_rez(integer n){
llResetScript();
}
dataserver(key req, string data){
if(data == "1" || data == "0"){
updateStatus(data);
}else{
gName = data;
// llSetText("Getting online status for " + gName,<1,1,1>,1);
llSetColor(<0,0,1>,ALL_SIDES);
startColor = <0,0,1>;
endColor = <0,0,1>;
updateParticles();
llSetTimerEvent(UPDATE_INTERVAL);
}
}
timer(){
doUpdate();
if(gIsOnline){
// llSetText("Your private dancer " + gName + " is Online",<1,1,1>,1);
llSetColor(<0,1,0>,ALL_SIDES);
startColor = <0,1,0>;
endColor = <0,1,0>;
updateParticles();
}else{
// llSetText(gName + " is Offline",<1,1,1>,1);
llSetColor(<1,0,0>,ALL_SIDES);
startColor = <1,0,0>;
endColor = <1,0,0>;
updateParticles();
}
}
listen(integer number, string name, key id, string msg){
if (llGetSubString(msg, 0,0) != "/"){
return;
}
list argv = llParseString2List(msg, [" "], []);
integer argc = llGetListLength(argv);
string cmd = llToLower(llList2String(argv, 0));
if(cmd == "/ol"){
string arg = llToLower(llList2String(argv, 1));
if(arg=="on"){
enable();
}else if(arg=="off"){
disable();
}else if(arg=="land"){
gLandOwner = TRUE;
gKey = NULL_KEY;
updateName();
}else if(arg=="key"){
gKey = llList2Key(argv,2);
updateName();
}else if(arg=="me"){
gLandOwner = FALSE;
gKey = NULL_KEY;
updateName();
}else if(arg=="help"){
llWhisper(0,"/ol on - activate online status display");
llWhisper(0,"/ol off - disable online status display");
llWhisper(0,"/ol land - display online status for owner of this land");
llWhisper(0,"/ol me - display your online status");
}
}
}

}



The online status tracker for one person which i want to set up so i can change it to some one else like the one above:

Online tracking and IM sender for one person :
CODE

string owner_name = "Owner ";
key namerequest;
key onlinerequest;

integer online = FALSE;

list agents = [];
list handles = [];
list messages = [];

init()
{
llSetText("Initializing...", <1,1,1>, 1);
llSetTimerEvent(5);
namerequest = llRequestAgentData(llGetOwner(), DATA_NAME);
}

regurgitate()
{
integer i;
for (i=0; i<llGetListLength(messages); i++) {
llInstantMessage(llGetOwner(), llList2String(messages, i));
}
messages = [];
}

default
{
on_rez(integer param)
{
init();
}

state_entry()
{
init();
}

timer()
{
onlinerequest = llRequestAgentData(llGetOwner(), DATA_ONLINE);
}

touch(integer touch_num)
{
integer i;
for (i=0; i<touch_num; i++) {
agents += llDetectedKey(i);
handles += llListen(0, "", llDetectedKey(i), "");
llSay(0, llDetectedName(i) + ", please say your message on one line and it will be recorded and/or sent.");
}
}

listen(integer channel, string name, key id, string message)
{
integer agent_index = llListFindList(agents, [id]);
if (agent_index != -1) {
llListenRemove(llList2Integer(handles, agent_index));
handles = llDeleteSubList(handles, agent_index, agent_index);
agents = llDeleteSubList(agents, agent_index, agent_index);
if (online) {
llInstantMessage(llGetOwner(), name + ": " + message);
llSay(0, "Thank you, " + name + ", your message has been sent.");
} else {
messages += name + ": " + message;
llSay(0, "Thank you, " + name + ", your message has been recorded, and will be sent when " + owner_name + " is online.");
}
}
}

dataserver(key request, string data)
{
if (request == namerequest) {
owner_name = data;
llSetTouchText("Send IM");
} else {
if (data == "1") {
llSetColor(<0,1,0>, ALL_SIDES);
llSetText(owner_name + " is online.\nClick here to send an instant message.", <0,1,0>, 1);
online = TRUE;
regurgitate();
} else {
llSetColor(<1,0,0>, ALL_SIDES);
llSetText(owner_name + " is offline.\nClick here to leave a message.", <1,0,0>, 1);
online = FALSE;
}
}
}
}

edit - added code tags for readability
Nada Epoch
The Librarian
Join date: 4 Nov 2002
Posts: 1,423
Original Thread
10-22-2006 20:59
/15/12/144421/1.html
_____________________
i've got nothing. ;)
Wiseguy Capra
Resident Wenzel Hopper
Join date: 21 Jan 2007
Posts: 160
02-12-2007 09:18
Has there been any update to this - did you get it work?
Is the final version available, I would love to use this. :D
AlphaDraco Arkin
Registered User
Join date: 20 Dec 2006
Posts: 1
02-12-2007 15:36
Hi I just want to ask is were do you put your friends name in the script to track them,can you track there location as well? and were do you put it in or attach this to?
Ace Albion
Registered User
Join date: 21 Oct 2005
Posts: 866
02-13-2007 03:06
I use online tracker/IM senders at my stores. I picked them up somewhere free, maybe they use these scripts. The target for the IMs is the owner of the object, but you could replace that with the key of whoever you want to message?
_____________________
Ace's Spaces! at Deco (147, 148, 24)
ace.5pointstudio.com
Usherah Raymond
Registered User
Join date: 10 Apr 2006
Posts: 8
06-18-2007 01:03
I tried both of your scripts. I found that the 2nd one does both jobs. The 1st one isn't really needed unless I'm missing something.
Nichiren Dinzeo
Registered User
Join date: 14 Feb 2007
Posts: 203
10-05-2007 13:03
Hi. Can someone explain how this is implemented? Does the person you want to track have to be wearing an object with the script in it? or, do you just place an object with this script someplace on your land and begin receiving tracking info of the person you are tracking?

thx