string FrontPart = "https://docs.google.com/forms/d/#########################################"; string LocationKey = "#########"; string AvatarKey = "############"; string GridName = "Your Grid's Name"; // Script Name: Google Spreadsheet Visitor Recorder v2.0 // By Maria Korolov of Hypergrid Business // Updated by Zuza Ritt in August 2013 // Adapted from Visitor_List_Maker.lsl // And from Hyperica Lookup HG Teleport Script (with code contributed by Paul Emery) // This program is free software; you can redistribute it and/or modify it. // Creative Commons licenses apply to all scripts from the Second Life // wiki and script library and are Copyrighted by Linden Lab. See // http://creativecommons.org/licenses/ // Please leave any author credits and headers intact in any script you use or publish. // If you don't like these restrictions, then don't use these scripts. // Global variables string Location; string Avatar; string URL; integer list_size =10; //how many avatar names to keep in memory float range = 10.0; // in meters float rate = 1.0; // in seconds list visitor_list; integer len; // Functions integer isNameOnList( string name ) { 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() { llSetText("", <0,1,0>, 1.0); Location = llGetRegionName()+" on " + GridName; llOwnerSay("Visitor recording script started..."); state recording; } } state recording { state_entry() { llSensorRepeat( "", "", AGENT, range, TWO_PI, rate ); } sensor( integer number_detected ) { integer i; for( i = 0; i < number_detected; i++ ) // if( llDetectedKey( i ) != llGetOwner() ) { Avatar = llDetectedName( i ); if( isNameOnList( Avatar ) == FALSE ) { string URL = FrontPart + "/formResponse" + "?entry."+LocationKey + "=" + Location + "&entry." + AvatarKey + "=" + Avatar + "&submit=Submit"; key httpkey=llHTTPRequest(URL, [] ,""); visitor_list += Avatar; if (len > list_size) { visitor_list = llDeleteSubList(visitor_list,0,0); } } } } } // END //