Instead of using an online detector, maybe you instead want to see if the right people are present in the house? That way pictures are blacked out if you're online, but elsewhere.
Here's my attempt. [Edit: I tested it... works ok.]
Code:
// PICTURE BLACKOUT
// LOOKS FOR PEOPLE ON A LIST
// IF NOBODY ON THE LIST IS PRESENT, IT TURNS THE PRIM BLACK
// Instructions:
// 1. Put this script in the same prim that has the picture on it.
//
// 2. In that prim's Description field, list all the people who the picture should show itself to. Separate names with a comma, no spaces.
// example:
// Cubey Terra,Beowulf Blackburn,Philip Linden,Cristiano Midnight,Aimee Weebler
float INTERVAL = 60; // how often in seconds to check for people on whitelist
float RANGE = 90; // range of sensor
vector CLR_ON = <1,1,1>;
vector CLR_OFF = <0,0,0>;
integer isOnList(string name)
{
list people = llCSV2List(llGetObjectDesc());
integer num = llGetListLength(people);
integer i;
for (i=0;i<num;i++)
{
if (llToLower(name) == llToLower(llList2String(people,i))) // compare names in lower case because SL names are often mistyped
{
return TRUE;
}
}
return FALSE;
}
default
{
state_entry()
{
llSetTimerEvent(INTERVAL);
}
timer()
{
llSensor("","",AGENT,RANGE,TWO_PI); // Scans for all agent in RANGE
}
sensor(integer num_detected)
{
integer i;
integer detected;
for (i=0;i<num_detected;i++)
{
string name = llDetectedName(i);
if (isOnList(name)) // if a detected agent is on the list...
{
detected = TRUE;
}
}
if (detected)
{
if (llGetColor(0) != CLR_ON) llSetColor(CLR_ON,ALL_SIDES);
}
else
{
if (llGetColor(0) != CLR_OFF) llSetColor(CLR_OFF,ALL_SIDES);
}
}
}