Difference between revisions of "LlOverMyLand"

From Second Life Wiki
Jump to navigation Jump to search
m (No need to check for lindens in a sensor, they are extremely rarely out of godmode.)
m (tweaked example, corrected script comment, removed my signature)
Line 15: Line 15:


//-- @@ = Contains code optimizations, see the following page for details
//-- @@ = Contains code optimizations, see the following page for details
//-- http://wiki.secondlife.com/wiki/User_talk:Void_Singer#Coding_Practices_Part_2_.28optimizations.29
//-- https://wiki.secondlife.com/wiki/User:Void_Singer/Optimizations


//-- list of people not to pester, lower case only
//-- list of people not to pester, lower case only
list vgLstIgnore = ["void singer"];
list gLstIgnore = ["void singer"];
key  gKeyAv;


default
default{
{
     state_entry(){
     state_entry()
    {
         llOwnerSay( "I'll pester anyone on your land I can find,"
         llOwnerSay( "I'll pester anyone on your land I can find,"
                  + " unless they're in your ignore list." );
                    + " unless they're in your ignore list." );
         llSensorRepeat( "", "", AGENT, 96, PI, 30 );
         llSensorRepeat( "", "", AGENT, 96, PI, 30 );
     }
     }


     sensor( integer vIntFound )
     sensor( integer vIntFound ){
    {
        integer vIntCounter = 0;
         do{
         do{
             string vStrName = llToLower( llDetectedName( vIntCounter ) );
             gKeyAv = llDetectedKey( --vIntFound ); //--@@
 
            //-- check if they are over our land
            //-- if they are over our land, check 'em
             if (llOverMyLand( gKeyAv )){ //-- @@
             if (llOverMyLand( llDetectedKey( vIntCounter ) ))
                //-- check if they are in the ignore list
            {
                 if (!~llListFindList( gLstIgnore, (list)llToLower( llKey2Name( gKeyAv ) ) )){ //-- @@
                //-- don't pester people in the ignore list
                    //-- pester everyone not in the ignore list !!!
                 if (!~llListFindList( vgLstIgnore, (list)vStrName )) //-- @@ x 2
                     llInstantMessage( gKeyAv, "You are on private land, please leave this parcel" );
                {
                    //-- pester everyone else !!!
                     llInstantMessage( llDetectedKey( vIntCounter ),
                          "You are on private land, please leave this parcel" );
                 }
                 }
             }
             }
         }while (++vIntCounter < vIntFound); //-- @@
         }while (vIntFound);
     }
     }
}
}
</lsl>
</lsl>
[[User:Void Singer|Void Singer]] 02:04, 15 October 2007 (PDT)
|helpers
|helpers
|also_functions
|also_functions

Revision as of 19:46, 10 April 2009

Deletion Requested
The deletion of this article was requested for the following reason:

Template is no longer used and it's creator thinks it does not function properly.

If there is a need to discuss the deletion of this article, please add your comment(s) here.

Summary

Function: integer llOverMyLand( key id );
0.0 Forced Delay
10.0 Energy

Returns an integer boolean, TRUE if id is over land owned by the script owner, FALSE otherwise.

• key id

On group deeded land the object containing the script must be deeded to the same group. (It is not enough to set the script to the group.)

Examples

<lsl> //--// private land message //--//

//-- @@ = Contains code optimizations, see the following page for details //-- https://wiki.secondlife.com/wiki/User:Void_Singer/Optimizations

//-- list of people not to pester, lower case only list gLstIgnore = ["void singer"]; key gKeyAv;

default{

   state_entry(){
       llOwnerSay( "I'll pester anyone on your land I can find,"
                   + " unless they're in your ignore list." );
       llSensorRepeat( "", "", AGENT, 96, PI, 30 );
   }
   sensor( integer vIntFound ){
       do{
           gKeyAv = llDetectedKey( --vIntFound );  //--@@
            //-- check if they are over our land
           if (llOverMyLand( gKeyAv )){ //-- @@
                //-- check if they are in the ignore list
               if (!~llListFindList( gLstIgnore, (list)llToLower( llKey2Name( gKeyAv ) ) )){ //-- @@
                    //-- pester everyone not in the ignore list !!!
                   llInstantMessage( gKeyAv, "You are on private land, please leave this parcel" );
               }
           }
       }while (vIntFound);
   }

}

</lsl>

Deep Notes

Signature

function integer llOverMyLand( key id );