Ok Im in the very early stages of a security system project that requires a list of the 12 most recent visitors to a location. So I created a collision based visitor list maker no problem there. However I need this visitor list to store both the visitors name and Key. I need the name to be able to display in an llDialog a little later, and I need the key to be able to pass to the land functions.
What I have seems to be working correctly so far except for some reason my list containing the keys is always returning an empty value. What am I doing wrong? Any assistance to make it more efficient would also be helpful.
CODE
list visitor_list;
list key_list;
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;
}
default
{
state_entry()
{
llVolumeDetect(TRUE);
}
collision_start( integer number_detected )
{
integer i;
for( i = 0; i < number_detected; i++ )
{
if( llDetectedType( i ) & AGENT )
{
//if( llDetectedKey( i ) != llGetOwner() ) //commented out for testing
// { //commented out for testing
string detected_name = llDetectedName( i );
string detected_key = llDetectedKey(i);
llOwnerSay(detected_name + " added");//Debug
llOwnerSay(detected_key + " added");//debug
if( isNameOnList( detected_name ) == FALSE )
{
visitor_list = llList2List( visitor_list + detected_name, -12, -1 );
key_list = llList2List( key_list + detected_key, -12, -1 );
}
// } //commented out for testing
}
}
}
touch_start(integer total_number) //For testing purposes
{
integer i;
integer length = llGetListLength(visitor_list);
string visitor;
string visitor_key;
for( i = 0; i < length; i++)
visitor = llList2String(visitor_list,i);
visitor_key = llList2String(key_list,i);
llOwnerSay(visitor + " = " + visitor_key );
}
}

;