integer gIntTime; integer gIntDist = 10; integer gFltXStart = 4; integer gFltYStart = 4; integer gFltZStart = 4; float gFltX; float gFltY; float gFltZ; integer gIntSwitch = 0; list gLstObjectVectors; list gLstObjectKeys; float range = 20; float rate = 5.0; vector gVecPos; integer fnKeyInList( key KyThisObjKey ) { integer len = llGetListLength( gLstObjectKeys ); integer i; for( i = 0; i < len; i++ ) { if( llList2Key(gLstObjectKeys, i) == KyThisObjKey ) { return TRUE; } } return FALSE; } default { state_entry() { gIntTime = 15; } touch_start(integer p) { gIntSwitch =! gIntSwitch; if (gIntSwitch == 1) { llSensorRepeat( "", "", PASSIVE, range, TWO_PI, rate ); llOwnerSay(" Sensor On."); llSetTimerEvent(gIntTime); } if (gIntSwitch == 0) { llSensorRemove(); llOwnerSay(" Sensor Off."); llSetTimerEvent(0); } } sensor( integer number_detected ) { integer i; for( i = 0; i < number_detected; i++ ) { key kyThisObjKey = llDetectedKey( i ); if( fnKeyInList( kyThisObjKey ) == FALSE ) { gLstObjectKeys += kyThisObjKey; } else { } } for (i=0; i < number_detected; i++) { gLstObjectVectors = gLstObjectVectors + llList2List(llGetObjectDetails(llList2Key(gLstObjectKeys,i),[OBJECT_POS]),0,0); } for (i=0; i < number_detected; i++) { if (llList2Vector(gLstObjectVectors,i) == llList2Vector(gLstObjectVectors,i+1)) { string command = "delete object id"; command = command + " " + llList2Key(gLstObjectKeys,i+1); integer result = osConsoleCommand(command); if (result == TRUE) { llSay(PUBLIC_CHANNEL, "Command \"" + command + "\" executed with success ..."); } else { llSay(PUBLIC_CHANNEL, "Command \"" + command + "\" executed without success ..."); } gLstObjectVectors = llDeleteSubList(gLstObjectVectors,i,i); gLstObjectKeys = llDeleteSubList(gLstObjectKeys,i,i); } } gLstObjectVectors = ""; gLstObjectKeys = ""; } timer() { gFltX = gFltX + gIntDist; if (gFltX > 250) { gFltX = gFltXStart; gFltY = gFltY + gIntDist; if (gFltY > 250) { gFltY = gFltYStart; gFltZ = gFltZ + gIntDist; if (gFltZ > 250) { gFltZ = gFltZStart; } } } gVecPos = ; llSetRegionPos(gVecPos); } }