Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

I need a visitor counter

HoneyBear Lilliehook
Owner, The Mall at Cherry
Join date: 18 Jun 2007
Posts: 4,500
10-20-2007 08:49
Can anyone recommend a good visitor counter that won't break the bank, and that could be used in two locations? Or alternatively, that is copyable?
ramon Kothari
FIC
Join date: 9 Dec 2002
Posts: 249
10-20-2007 09:12
//Original script by Aaron Linden
//modified by Ramon Kothari





// Global variables change these to match your specifics

float range = 50.0; // search radius, in meters
float rate = 1.0; // time between searches, in seconds
// add your email adress inside the quotes
string email_address = "";
//add the name of the location if you want (the email will have the sim name and cordinates of
// the counter all ready in it
float last_wallclock_time = 0.0;
string location_name = "";



//dont change these

list single_name_list;
list visitor_list;
//end no change





// Returns true if "name" is already on the visitor_list
integer isNameOnList( string name )
{
list single_name_list;
single_name_list += name;

return (-1 != llListFindList( visitor_list, single_name_list ) );
}
// sends email to the address above ,if added

sendEmail()
{
string csv = llList2CSV( visitor_list );
llEmail( email_address, "Visitor List: " + location_name, csv );
}

//self explanatory
resetList()
{
visitor_list = [];
llSay( 0, "Done resetting.";);
llResetScript();
}


// Help commands
sayHelp( integer is_owner )
{
if( is_owner )
{
llSay( 0, "This object records the names of everyone who" );
llSay( 0, "comes within "+ (string)((integer)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." );
llSay( 0, "' email list' - Emails the names on the list." );
}
else
{
llSay( 0, "Sorry, only the owner can use this object." );
}
}

// state the script starts in
default
{
state_entry()
{

llSensorRepeat( "", "", AGENT, range, TWO_PI, rate );
llListen(0, "", llGetOwner(), "";);

//change this to how often you want the script to email the visitor list to you // (or comment it out if you dont want the email .... by default its set to email you
llSetTimerEvent( 120 );
}


// Sends email and resets list as set in the set timer event above
timer()
{
float time_since_midnight = llGetWallclock();
if( time_since_midnight < last_wallclock_time )
{
sendEmail();
resetList();
}

last_wallclock_time = time_since_midnight;

}




//says help if owner clicks on it



//detects avatars and keeps time
sensor( integer number_detected )
{
integer i;
for( i = 0; i < number_detected; i++ )
{
// Don't ever add the owner to the list.

if( llDetectedKey( i ) != llGetOwner() )
{
string detected_name = llDetectedName( i );
if( isNameOnList( detected_name ) == FALSE )
{
float seconds = llGetWallclock();
float minutes = seconds / 60.0;
float hours = minutes / 60.0;
integer hours_int = (integer) hours;
integer minutes_int = ((integer)minutes) % 60;
if( minutes_int < 10 )
{
visitor_list += (string) hours_int + ":0" + (string) minutes_int + " " + (string) llGetDate();
}
else
{
visitor_list += (string) hours_int + ":" + (string) minutes_int + " " + (string) llGetDate();
}

visitor_list += detected_name;
}
}
}
}

//Listens for cammands from the Owner

listen( integer channel, string name, key id, string message )
{
if( id != llGetOwner() )
{
return;
}

if( message == "help" )
{
sayHelp( TRUE );
}
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 == "email list" )
{
sendEmail();
llSay(0, "Emailing list";);

}



else
if( message == "reset list" )
{
visitor_list = [];
llSay( 0, "Done resetting.";);
}




}
}
_____________________
"Life should not be a journey to the grave with the intention of arriving safely in an attractive and well preserved body,but rather skid in sideways, beer in one hand, body thoroughly used up,totaly worn out and screaming....Damn, what a ride!!"
HoneyBear Lilliehook
Owner, The Mall at Cherry
Join date: 18 Jun 2007
Posts: 4,500
10-20-2007 09:38
Thank you for the responses!
Oryx Tempel
Registered User
Join date: 8 Nov 2006
Posts: 7,663
10-20-2007 09:39
I'm pretty sure Ramon means for you to create a prim object, create a new script, copy and paste the above script into your new script, save it, and put it into the contents of your prim object. ;) I might have a visitor counter script somewhere as well. Alternately, you can go to either YadNi's junkyard or the Freebie Warehouse, and pick up their collections of freebie scripts. Loads of useful stuff there.
_____________________
Khilah Whitfield
Calgon take me away!
Join date: 5 Mar 2007
Posts: 146
10-20-2007 09:53
I bought Dina's visitor counter, gives you a lot of options, and gives you names of your visitors. I think it was $60L...very easy to use!
Xplorer Cannoli
Cache Cleaner
Join date: 18 Sep 2005
Posts: 1,131
10-20-2007 10:37
honey, I have one to give you in-game. I will send it to you.
_____________________
Region Names for a Themed Shopping Experience:

New Region: Gifts

Accessories, Art, Avatars, Cars, Clothes, Clothing, Fashion, Fashions, Furnishings, Furniture, Gadgets, Games, Gifts, Hair, Jewellery, Jewelry, Mall, Men, Money, Music, Pets, Shoes, Shopping, Skin, Skins, Something, Women, X

Attractions:
Explore our new park at HOME
New Racetrack at CAR
WEAPONS Region Now Open!
Alliez Mysterio
Registered User
Join date: 22 Apr 2004
Posts: 230
10-20-2007 11:14
IM me in world for your visitor counter
ramon Kothari
FIC
Join date: 9 Dec 2002
Posts: 249
10-20-2007 12:35
Yes thats what i meant ....im appologize to the forum crowd , i did follow this up inworld with a copy of the script and what to do with it



From: Oryx Tempel
I'm pretty sure Ramon means for you to create a prim object, create a new script, copy and paste the above script into your new script, save it, and put it into the contents of your prim object. ;) I might have a visitor counter script somewhere as well. Alternately, you can go to either YadNi's junkyard or the Freebie Warehouse, and pick up their collections of freebie scripts. Loads of useful stuff there.
_____________________
"Life should not be a journey to the grave with the intention of arriving safely in an attractive and well preserved body,but rather skid in sideways, beer in one hand, body thoroughly used up,totaly worn out and screaming....Damn, what a ride!!"
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
people asking for free visitor scripts deserve a LM....
10-20-2007 17:26
.... or this.....
From: someone

key vKeyOwner;

default{
state_entry(){
vKeyOwner = llGetOwner();
llSensorRepeat( "", "", AGENT, 96, PI, 21.0 );
}

sensor( integer vIntFound ){
integer i = 0;
do{
llInstantMessage( vKeyOwner, llDetectedName( i ) );
}while ( ++i < vIntFound );

no_sensor(){
llInstantMessage( vKeyOwner, "Nobody here Boss" );
}

changed( integer vBitChanges ){
if (vBitChanges & CHANGED_OWNER){
vKeyOwner = llGetOwner();
}
}
}

EDIT: how's that for evil?
KC Despres
Werebutterfly
Join date: 7 Apr 2007
Posts: 166
10-20-2007 19:11
Just be careful. I bought what I thought was a visitor counter. It counted visitors allright -- and remotely relayed their chat to me. Proabably against the terms of service, but more importantly, against my scruples. -- KC
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
04-01-2008 11:00
From: KC Despres
Just be careful. I bought what I thought was a visitor counter. It counted visitors allright -- and remotely relayed their chat to me. Proabably against the terms of service, but more importantly, against my scruples. -- KC


i'm pretty sure it's only against TOS if you use that chat in any way other your own personal record. IE, chat logger set in a store could record the non prvt conversations, and the owner can read it as feedback of the store, products, etc. as long as they're not sending the conversations to anyone else. also, you could easily just have an alt sitting in your store 24/7, is that against tos?