Online Status

Date 2008/4/1 8:24:48 | Topic: Agent/Avatar

Will show if the object owner is Online or Offline in Second Life.

key ownerkey;
string ownername;

default
{
    
on_rez(integer start_param)
    {
        
llResetScript();
    }
    
    
state_entry()
    {
        
ownerkey llGetOwner();
        
ownername llKey2Name(ownerkey);
        
llSetTimerEvent(30.0); //check every 30 seconds
        
llRequestAgentData(ownerkeyDATA_ONLINE);
    }

    
timer()
    {
        
llRequestAgentData(ownerkeyDATA_ONLINE);
    }
    
    
dataserver(key requeststring data)
    {
        if (
data == "1")
        {
                
                
llSetText(ownername " is Online", <0,1,0>, 1);
        }
        else
        {
                
llSetText(ownername " is Offline", <1,0,0>, 1);
        }
    }
}




This script comes from Alicia Stella Design - Best Tip Jars in Second Life
http://www.aliciastella.com

The URL for this script is:
http://www.aliciastella.com/modules/AMS/article.php?storyid=19