Difference between revisions of "Group Privacy"

From Second Life Wiki
Jump to navigation Jump to search
(New page: 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 av...)
 
(Reduce obfuscation)
 
(6 intermediate revisions by 4 users not shown)
Line 1: Line 1:
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.
{{LSL Header}}
Many landlords do not allow residents to have security devices that are continuously operating. This device is activated manually, and only operates so long as avatars are present. When avatars leave the vicinity, the device turns off. To turn on again, the device needs to be touched by an authorised person.


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


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

Latest revision as of 10:31, 21 January 2016

Many landlords do not allow residents to have security devices that are continuously operating. This device is activated manually, and only operates so long as avatars are present. When avatars leave the vicinity, the device turns off. To turn on again, the device needs to be touched by an authorised person.

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
//////////////////////////////////////////////////////////////////////////////////////
//
//    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 = 10.0;              // Scan Rate (10 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);
}

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.");
        else
        {
            if (llSameGroup(llDetectedKey(0)))
            {
                if (status)
                    off();
                else
                    on();
            }
            else
                llSay(0, "Authorized to group members only.");
        }
    }

    sensor(integer num_detected)
    {
        integer group_members;
        key id;

        integer i;
        for ( ; i < num_detected; ++i)
        {
            id = llDetectedKey(i);

            if (llSameGroup(id))
            {
                llRemoveFromLandBanList(id);
                ++group_members;
            }
            else
                boot(id);
        }

        if (!group_members)
            off();
    }

    no_sensor()
    {
        off();
    }
}