//Constants
string EMAIL_ADDRESS = "";
string EMAIL_SUBJECT = "";
integer MAX_LENGTH = 100; // max names for the list
float INTERVAL = 604800; // 604800 seconds in a week
// Globals
string owner_name;
list visitor_list;
// Functions
sendEmail() {
llEmail(EMAIL_ADDRESS, EMAIL_SUBJECT, llDumpList2String(visitor_list, "\n"

);
visitor_list = [];
}
// States
default {
state_entry() {
owner_name = llKey2Name(llGetOwner());
llOwnerSay("Click List Maker started... Say 'help' for instructions."

;
llListen(0, "", llGetOwner(), ""

;
llSetTimerEvent(INTERVAL);
}
on_rez(integer start_param) {
llResetScript();
}
touch( integer num_detected ) {
integer i;
for( i = 0; i < num_detected; i++ ) {
string detected_name = llDetectedName(i);
if(detected_name != owner_name) {
if(llListFindList(visitor_list, [detected_name]) == -1) {
visitor_list += detected_name;
if (llGetListLength(visitor_list) == MAX_LENGTH) sendEmail();
}
}
}
}
listen( integer channel, string name, key id, string message ) {
if( message == "help" ) {
llOwnerSay("This object records names of all who click it."

;
llOwnerSay("Commands the owner can say:"

;
llOwnerSay("'help' - Shows these instructions."

;
llOwnerSay("'say list' - Says the names of all clickers on the list."

;
llOwnerSay("'reset list' - Removes all the names from the list."

;
return;
}
if( message == "say list" ) {
llOwnerSay("Visitor List:\n" + llDumpList2String(visitor_list, "\n"

);
llOwnerSay("Total = " + (string)llGetListLength(visitor_list));
return;
}
if( message == "reset list" ) {
visitor_list = [];
llOwnerSay("Done resetting."

;
}
}
timer() {
sendEmail();
}
}