Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

touch guest book list

Jesse Murdock
Moves You
Join date: 23 Jun 2004
Posts: 149
02-24-2005 20:58
I just need a script that senses when an avie is within a defined range, queries them if they would like to sign the guest book , and upon approval, records them into a list. Of course that list will have to be accessable for collection later. Would appreciate any help you can give!
_____________________
The writing's on the wall...
Olmy Seraph
Valued Member
Join date: 1 Nov 2004
Posts: 502
02-24-2005 22:43
i have a script that does that w/o the sign-in, but that should be easy to add. IM me in-world and i can drop you a copy, or i'll post it here when i can.
_____________________
Some people are like Slinkies... not really good for anything, but they sure bring a smile to your face when you push them down the stairs.
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
02-25-2005 05:55
There are several visitor counters around that do this, without asking them for permission as well...
Jesse Murdock
Moves You
Join date: 23 Jun 2004
Posts: 149
02-25-2005 12:23
yes i know , but i want it to:)
_____________________
The writing's on the wall...
Lo Jacobs
Awesome Possum
Join date: 28 May 2004
Posts: 2,734
02-25-2005 12:25
Ooh! I want one as well. That would be kind of cool!
_____________________
http://churchofluxe.com/Luster :o
Olmy Seraph
Valued Member
Join date: 1 Nov 2004
Posts: 502
visitor list
02-25-2005 13:11
Here is the visitor list I use on my home. I based it on a freebie script I found somewhere. It is keyed to group ownership, so set the group on the object and anyone with that group active can view or reset the list. Admin is done by touching the object and selecting a command from a dialog.

This script uses a sensor to detect visitors. It does not ask them to sign in. You could do that by presenting them a dialog to sign in or not, or you could ask them to come touch the object. I'd go with the dialog.

CODE

// Global variables
list visitor_list;
float range = 35.0; // in meters
float rate = 6.0; // in seconds

integer CHANNEL = 424242;
integer ListenHandle = 0;
key User = NULL_KEY;

// 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()
{
llSensorRepeat( "", "", AGENT, range, TWO_PI, rate );
}

touch_start(integer total_number)
{
User = llDetectedKey(0);
if ( ! llSameGroup(User) ) return;

ListenHandle = llListen(CHANNEL, "", User, ""); // listen for the dialog answer
llDialog(User, "Guest List action:", ["List", "Reset"], CHANNEL);
}

sensor( integer number_detected )
{
integer i;
for( i = 0; i < number_detected; i++ )
{
// llShout(0, "PING! " + llGetTimestamp() );
if( llDetectedKey( i ) != llGetOwner() )
{
string detected_name = llDetectedName( i );
if( isNameOnList( detected_name ) == FALSE )
{
visitor_list += detected_name;
}
}
}
}

listen( integer channel, string name, key id, string message )
{
llListenRemove(ListenHandle);

if( llSameGroup(id) )
{
if( message == "List" )
{
llSay( 0, "Guest 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" )
{
visitor_list = llDeleteSubList(visitor_list, 0, llGetListLength(visitor_list));
llSay( 0, "Done resetting.");
}
}
}
}
_____________________
Some people are like Slinkies... not really good for anything, but they sure bring a smile to your face when you push them down the stairs.
Tiger Crossing
The Prim Maker
Join date: 18 Aug 2003
Posts: 1,560
03-08-2005 11:41
I'd replace the isNameOnList function with a call to llListFindList.

if ( llListFindList( visitor_list, [name] ) >= 0 )
// then a match was found
_____________________
~ Tiger Crossing
~ (Nonsanity)