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(ownerkey, DATA_ONLINE);
}
timer()
{
llRequestAgentData(ownerkey, DATA_ONLINE);
}
dataserver(key request, string data)
{
if (data == "1")
{
llSetText(ownername + " is Online", <0,1,0>, 1);
}
else
{
llSetText(ownername + " is Offline", <1,0,0>, 1);
}
}
}
|