///Add this script to an object once you edit the email address, drop on your land and get alerts on who is visiting your property! ///MODDED BY MAX CASE http://www.maxcase.info ///MODDED BY ALAN MARTIN / ALAN JOYCE http://www.everythingdigital.org/weblog/ ///EXAMPLE FOR SL TO RL WATCH - PHILLIP TORRONE / TORRONE TRUMBO http://www.makezine.com ///Please send any changes, updates, etc to the MAKE team pt@makezine.com ///MAKE:land secondlife://Crescent/13/99 // Global variables list visitor_list; float range = 50.0; // in meters float rate = 1.0; // in seconds integer gchannel = 13; string owner; integer checked = 0; string address = "YOUREMAIL@YOUREMAIL.com"; //Change this to your email address // Functions integer isNameOnList( string name ) { integer len = llGetListLength( visitor_list ); integer i; for( i = 0; i < len; i++ ) { if( llList2String(visitor_list, i) == name ) { return TRUE; } } return FALSE; } // States default { state_entry() { owner = llGetOwner(); llSetTimerEvent(120); //Change the amount of seconds between checks llSay(0, "Visitor List Maker started..."); llSay(0, "The owner can say 'help' for instructions."); llSensorRepeat( "", "", AGENT, range, TWO_PI, rate ); llListen(gchannel, "", llGetOwner(), ""); // llListen(gchannel, guest,NULL_KEY, ""); } sensor( integer number_detected ) { integer i; for( i = 0; i < number_detected; i++ ) { if( llDetectedKey( i ) != llGetOwner() ) { string detected_name = llDetectedName( i ); if( isNameOnList( detected_name ) == FALSE ) { visitor_list += detected_name; visitor_list += "at " + llGetTimestamp() + "\n"; checked = 1; } } } } on_rez(integer foo) { if( owner != llGetOwner()) { llResetScript(); } } listen( integer channel, string name, key id, string message ) { if( message == "help" ) { llSay( 0, "This object records the names of everyone who" ); llSay( 0, "comes within "+ (string)range + " meters." ); llSay( 0, "Commands the owner can say:" ); llSay( 0, "'help' - Shows these instructions." ); llSay( 0, "'say list' - Says the names of all visitors on the list."); llSay( 0, "'reset list' - Removes all the names from the list." ); } else if( message == "say list" ) { llSay( 0, "Visitor List:" ); integer len = llGetListLength( visitor_list ); integer i; for( i = 0; i < len; i++ ) { llSay( 0, llList2String(visitor_list, i) ); } llSay( 0, "Total = " + (string)len ); } else if( message == "reset list" ) { visitor_list = llDeleteSubList(visitor_list, 0, llGetListLength(visitor_list)); llSay( 0, "Done resetting."); } } timer() { if (checked == 1) { llSay (0, "pinging RL wrist watch"); checked = 0; integer len = llGetListLength( visitor_list ) /2 ; integer i; string listtemp; llEmail(address, "SL Visitor Detector: New Visitor Report", "Visitor List:\n\n" + llDumpList2String (visitor_list, "\n") + "\nTotal = " + (string)len ); } } }