I'm using a free script. I think we made some minor changes to it, mostly in terms of text.
Could someone who is good with this kind of stuff take a look at the following script, and see if you notice an errors that would cause it to stop working periodically? Or is this just another Linden bug?
Thanks,
Princess Ivory
This is the exact content copied from the script:
// Original script taken from a freebie i found somewhere
//
// Modified to say a greeting to each visitor
// The greeting is held in th eobject description field
//
// All says have been changed to ownersays so to relieve channel 0 talk
// and keep the output private to the owner
//
// Touch_start section added to re-read the greeting if you change the description field
//
// Original Author unknown
// Mods by Adriana Caligari
string welcome;
// Global variables
list visitor_list;
float range = 20.0; // in meters
float rate = 1.0; // in seconds
// Functions
integer isNameOnList( string name )
{
integer len = llGetListLength( visitor_list );
integer i;
integer pos;
for( i = 0; i < len; i++ )
{
pos=llSubStringIndex(llList2String(visitor_list, i), ":**"
- 1;if(llGetSubString(llList2String(visitor_list, i), 0, pos) == name )
{
return TRUE;
}
}
return FALSE;
}
init()
{
welcome = llGetObjectDesc();
llOwnerSay( "Visitor List Maker started..."
;llOwnerSay( "The owner can say 'help' for instructions."
; llSensorRepeat( "", "", AGENT, range, TWO_PI, rate );
llListen(0, "", llGetOwner(), ""
;}
// States
default
{
state_entry()
{
init();
}
on_rez( integer param )
{
init();
}
touch_start( integer num )
{
welcome = llGetObjectDesc();
}
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 )
{
llInstantMessage( llDetectedKey( i ), welcome + detected_name );
visitor_list += detected_name + ":** arrived at " + llGetTimestamp();
llOwnerSay ( detected_name + " has been added to your visitors list at " + llGetRegionName() );
}
}
}
}
listen( integer channel, string name, key id, string message )
{
if( id != llGetOwner() )
{
return;
}
if( message == "help" )
{
llOwnerSay( "This object records the names of everyone who" );
llOwnerSay( "comes within "+ (string)range + " meters." );
llOwnerSay( "Commands the owner can say:" );
llOwnerSay( "'help' - Shows these instructions." );
llOwnerSay( "'say list' - Says the names of all visitors on the list."
;llOwnerSay( "'reset list' - Removes all the names from the list." );
llOwnerSay ( "TO change the greeting - change the object description and touch the object" );
}
else
if( message == "say list" )
{
llOwnerSay( "Visitor List:" );
integer len = llGetListLength( visitor_list );
integer i;
for( i = 0; i < len; i++ )
{
llOwnerSay( llList2String(visitor_list, i) );
}
llOwnerSay( "Total = " + (string)len );
}
else
if( message == "reset list" )
{
visitor_list = llDeleteSubList(visitor_list, 0, llGetListLength(visitor_list));
llOwnerSay( "Done resetting."
;}
}
}
This will allow you to have more items in your list before it runs out of memory.