Difference between revisions of "Group Privacy"

From Second Life Wiki
Jump to navigation Jump to search
(Brush up and add to category index)
Line 1: Line 1:
{{LSL Header}}
Many landlords do not allow residents to have security devices that are continiously operating. This device is activated manually, and only operates so long as avatars are present. When avatars leave the vicinity, the device turns off.
Many landlords do not allow residents to have security devices that are continiously operating. This device is activated manually, and only operates so long as avatars are present. When avatars leave the vicinity, the device turns off.


Line 12: Line 13:
# Insure that group members have the group tag active
# Insure that group members have the group tag active
# Touch to activate; touch to deactivate
# Touch to activate; touch to deactivate
<lsl>
//////////////////////////////////////////////////////////////////////////////////////
//
//    Version 1.0 Release
//    Copyright (C) 2007, Chance Unknown
//
//    This library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public License
//    as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    This library is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public License
//    along with this library; if not, write to the Free Software
//    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
//
//////////////////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////////////////
float duration = 60.0;          // Duration of Land Ban Following the Eject (1Hr)
//
float RANGE = 40.0;            // Scan Range (40m)
//    Version 1.0 Release
float RATE = 2.0;              // Scan Rate (2 Sec)
//    Copyright (C) 2007, Chance Unknown
 
//   
integer status;
//    This library is free software; you can redistribute it and/or
 
//    modify it under the terms of the GNU Lesser General Public License
off()
//    as published by the Free Software Foundation; either
{
//    version 2.1 of the License, or (at your option) any later version.
    status = FALSE;
//   
 
//    This library is distributed in the hope that it will be useful,
    llSensorRemove();
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    llSetColor(<1,1,1>, ALL_SIDES);
//    GNU Lesser General Public License for more details.
 
//   
    llSay(0, "Deactivated.");
//    You should have received a copy of the GNU Lesser General Public License
 
//    along with this library; if not, write to the Free Software
    llSetText("Group Privacy\nOff\n\nTouch to Turn On", <1,1,1>, 1.0);
//    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
}
//
 
//////////////////////////////////////////////////////////////////////////////////////
on()
{
float duration = 60.0;          // Duration of Land Ban Following the Eject (1Hr)
    status = TRUE;
float RANGE = 40.0;            // Scan Range (40m)
 
float RATE = 2.0;              // Scan Rate (2 Sec)
    llSensorRepeat("", NULL_KEY, AGENT, RANGE, PI, RATE);
 
integer status;
    llSetColor(<1,0,0>, ALL_SIDES);
 
off()
    llSay(0, "Activated while group memebers are present.");
{
 
    status = FALSE;
    llSetText("Group Privacy\nOn\n\nTouch to Turn Off", <1,1,1>, 0.5);
       
}
    llSensorRemove();
 
       
boot(key id)
    llSetColor(<1,1,1>, ALL_SIDES);
{
   
    if (llOverMyLand(id) == TRUE)
    llSay(0, "Deactivated.");
    {
   
        llUnSit(id);
    llSetText("Group Privacy\nOff\n\nTouch to Turn On", <1,1,1>, 1.0);
 
}
        llEjectFromLand(id);
 
on()
        llAddToLandBanList(id, duration); // Hour of Ban
{
    }
    status = TRUE;
}
   
 
    llSensorRepeat("", NULL_KEY, AGENT, RANGE, PI, RATE);
default
   
{
    llSetColor(<1,0,0>, ALL_SIDES);
    state_entry()
   
    {
    llSay(0, "Activated while group memebers are present.");
        off();
   
    }
    llSetText("Group Privacy\nOn\n\nTouch to Turn Off", <1,1,1>, 0.5);
 
}
    touch_start(integer num_detected)
    {
boot(key id)
        if (llGetLandOwnerAt(llGetPos()) != llGetOwner())
{
        {
    if (llOverMyLand(id) == TRUE)
            llSay(0, "Deed device to match land group.");
    {
 
        llUnSit(id);
            return;
               
        }
        llEjectFromLand(id);
 
               
        if (llSameGroup(llDetectedKey(0)) == TRUE)
        llAddToLandBanList(id, duration); // Hour of Ban
        {
    }
            if (status == FALSE)
}
            {
                on();
default
            }
{
            else
    state_entry()
            {
    {
                off();
        off();
            }
    }
        }
   
 
    touch_start(integer num_detected)
        else
    {
        {
        if (llGetLandOwnerAt(llGetPos()) != llGetOwner())
            llSay(0, "Authorized to group members only.");
        {
        }
            llSay(0, "Deed device to match land group.");
    }
           
 
            return;
    sensor(integer num_detected)
        }
    {
       
        integer i;
        if (llSameGroup(llDetectedKey(0)) == TRUE)
 
        {
        integer group_members = 0;
            if (status == FALSE)
 
            {
        for (i = 0; i != num_detected; i++)
                on();
        {
            }
            if (llSameGroup(llDetectedKey(i)) == FALSE)
            else
            {
            {
                boot(llDetectedKey(i));
                off();
            }
            }
 
        }
            else
       
            {
        else
                llRemoveFromLandBanList(llDetectedKey(i));
        {
 
            llSay(0, "Authorized to group members only.");
                group_members++;
        }
            }
    }
        }
           
 
    sensor(integer num_detected)
        if (group_members == 0)
    {
        {
        integer i;
            off();
       
        }
        integer group_members = 0;
    }
       
 
        for (i = 0; i != num_detected; i++)
    no_sensor()
        {
    {
            if (llSameGroup(llDetectedKey(i)) == FALSE)
            {
                boot(llDetectedKey(i));
            }
           
            else
            {
                llRemoveFromLandBanList(llDetectedKey(i));
               
                group_members++;
            }
        }
       
        if (group_members == 0)
        {
            off();
        }
    }
   
    no_sensor()
    {
         off();
         off();
    }
    }
   
}
}
</lsl>
 
{{LSLC|Library}}

Revision as of 06:15, 11 December 2007

Many landlords do not allow residents to have security devices that are continiously operating. This device is activated manually, and only operates so long as avatars are present. When avatars leave the vicinity, the device turns off.

Place this script into a single prim, and decorate to taste.

Requirements:

  1. Edit script range and timer frequency to suit
  2. Deed to match the land group

Operation:

  1. Insure that group members have the group tag active
  2. Touch to activate; touch to deactivate

<lsl> ////////////////////////////////////////////////////////////////////////////////////// // // Version 1.0 Release // Copyright (C) 2007, Chance Unknown // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public License // as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public License // along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //////////////////////////////////////////////////////////////////////////////////////

float duration = 60.0; // Duration of Land Ban Following the Eject (1Hr) float RANGE = 40.0; // Scan Range (40m) float RATE = 2.0; // Scan Rate (2 Sec)

integer status;

off() {

   status = FALSE;
   llSensorRemove();
   llSetColor(<1,1,1>, ALL_SIDES);
   llSay(0, "Deactivated.");
   llSetText("Group Privacy\nOff\n\nTouch to Turn On", <1,1,1>, 1.0);

}

on() {

   status = TRUE;
   llSensorRepeat("", NULL_KEY, AGENT, RANGE, PI, RATE);
   llSetColor(<1,0,0>, ALL_SIDES);
   llSay(0, "Activated while group memebers are present.");
   llSetText("Group Privacy\nOn\n\nTouch to Turn Off", <1,1,1>, 0.5);

}

boot(key id) {

   if (llOverMyLand(id) == TRUE)
   {
       llUnSit(id);
       llEjectFromLand(id);
       llAddToLandBanList(id, duration); // Hour of Ban
   }

}

default {

   state_entry()
   {
       off();
   }
   touch_start(integer num_detected)
   {
       if (llGetLandOwnerAt(llGetPos()) != llGetOwner())
       {
           llSay(0, "Deed device to match land group.");
           return;
       }
       if (llSameGroup(llDetectedKey(0)) == TRUE)
       {
           if (status == FALSE)
           {
               on();
           }
           else
           {
               off();
           }
       }
       else
       {
           llSay(0, "Authorized to group members only.");
       }
   }
   sensor(integer num_detected)
   {
       integer i;
       integer group_members = 0;
       for (i = 0; i != num_detected; i++)
       {
           if (llSameGroup(llDetectedKey(i)) == FALSE)
           {
               boot(llDetectedKey(i));
           }
           else
           {
               llRemoveFromLandBanList(llDetectedKey(i));
               group_members++;
           }
       }
       if (group_members == 0)
       {
           off();
       }
   }
   no_sensor()
   {
       off();
   }

} </lsl>