User:Talia Tokugawa/scripts/VisitInform

From Second Life Wiki
Jump to navigation Jump to search

Just a quick script so that the owner of a property can keep track of arrivals. Will remember the last hundred names so that the owner doesn't get spammed by repeated visits or people running backwards and forwards over the prim. Enjoy :P

list names=[];

default {
   state_entry() {
       llVolumeDetect(TRUE);
   }

   collision_start( integer ind ) {
       string name = llDetectedName(0);
       if (llListFindList(names, [name])==-1) {
           llInstantMessage( llGetOwner(), name + " has just arrived at " + (string)llGetParcelDetails(llGetPos(),[PARCEL_DETAILS_NAME]));
           if (llGetListLength(names) >= 100) names=(names=[]) + llDeleteSubList(names, 0,0) + name;
           else names=(names=[]) + names + name;
       }
   }
   
   on_rez(integer irp) {
       llResetScript();
   }
}