Wednesday, August 18, 2010

Sensor land detection

I recently moved lands and my new neighbor asked if I could turn of my sensor that greeted visitors. I guess it was going off when people were visiting their land.

I first detected the location of the Agent who tripped the sensor. Then get the land owner key at that location. It's hard to tell what that key is so I wrote code to print that out if the sensor detected me, then went into my neighbor's land. Then took that number and hard coded it into the welcome message. Now the sensor will only greet someone if they are on a different land than my neighbors.

sensor( integer number_detected )
{
integer i;
for( i = 0; i < detpos =" llDetectedPos(" k =" llGetLandOwnerAt(detpos);" k ="="" k = "+(string)k); // } //} if ( (llDetectedKey( i ) != llGetOwner()) && (k != ">

No comments: