Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Visitor List Maker with Partner Access

Ark Vuckovic
Registered User
Join date: 28 Mar 2007
Posts: 41
07-07-2008 06:52
Hi everybody,
I'm looking for a Visitor List Maker that could have an option to include a partner to manage it. The Visitor List script created by Aaron Linden that widely used across SL is made only to respond to the owner's commands. I would like to have my partner to be able to see the list even if I am not around.

Thanks.
Deanna Trollop
BZ Enterprises
Join date: 30 Jan 2006
Posts: 671
07-07-2008 08:48
Wherever you see llGetOwner() in an if filter, add a clause which will also return true for your partner's key or name. e.g., in a touch* event handler:

CODE
if( llDetectedTouch(0) == llGetOwer() || llDetectedTouch(0) == "[ your partner's key ]" )

or in a listen event handler:

CODE
if( id == llGetOwner() || name == "[ your partner's name ]" )

etc.

Or, you could create a list of authorized keys, and instead of testing for equality with each case, just search the list for the relevant key, and test for a -1 (not found) result:

CODE
// global var:
list auth = [ "[ your key ]", "[ your partner's key ]" ];

// inside touch* event handler:
if( llListFindList( auth, (list)llDetectedKey(0) ) != -1 )
{
// do authorized stuff
}
Daten Thielt
Registered User
Join date: 1 Dec 2006
Posts: 104
07-07-2008 08:48
Just fill in key Partner = ""; with the key of your partner

CODE

// Global variables
list visitor_list;
float range = 10.0; // in meters
float rate = 1.0; // in seconds
key Partner = "";

// 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()
{
llSay(0, "Visitor List Maker started...");
llSay(0, "The owner can say 'help' for instructions.");
llSensorRepeat( "", "", AGENT, range, TWO_PI, rate );
llListen(0, "", llGetOwner(), "");
}


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 )
{
visitor_list += detected_name;
}
}
}
}

listen( integer channel, string name, key id, string message )
{
if(id == llGetOwner() || id == Partner)
{
if( message == "help" )
{
llSay( 0, "This object records the names of everyone who" );
llSay( 0, "comes within "+ (string)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." );
}
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 == "reset list" )
{
visitor_list = llDeleteSubList(visitor_list, 0, llGetListLength(visitor_list));
llSay( 0, "Done resetting.");
}
}
}
}

Ark Vuckovic
Registered User
Join date: 28 Mar 2007
Posts: 41
07-07-2008 09:14
Thanks everyone for helpful tips. My partner an I appreciate your input.:)
Ark Vuckovic
Registered User
Join date: 28 Mar 2007
Posts: 41
07-08-2008 04:13
I tried the code suggested by Daten Thielt but still my partner is not recognized by the script. Also it adding the owner to the visitor list now. I entered the partners key in the code, but, it seems to me, it ignoring it.:confused:
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
09-14-2008 20:51
From: Ark Vuckovic
I tried the code suggested by Daten Thielt but still my partner is not recognized by the script. Also it adding the owner to the visitor list now. I entered the partners key in the code, but, it seems to me, it ignoring it.:confused:


forgot to take out the llGetOwner in the llListen call

llListen(0, "", llGetOwner(), "";);

should be

llListen(0, "", "", "";);
_____________________
Dark Heart Emporium

http://www.xstreetsl.com/modules.php?name=Marketplace&MerchantID=133020

want more layers for tattoos, specifically for the head? vote here
http://jira.secondlife.com/browse/VWR-1449?

llDetectedCollision* Functions similar to touch
http://jira.secondlife.com/browse/SVC-3369