Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

click add ?

Brooklyn Davis
Owner, Parallax View
Join date: 15 May 2005
Posts: 226
01-06-2007 06:50
Hi all...

Is there a script that can add someone to a group by clicking a prim? I would so love to have that for my shop ...

Anyone know of such a thing ? Please IM me inworld if you can help. TYVM :)
_____________________
kaet Diamond
Registered User
Join date: 29 Mar 2005
Posts: 32
01-06-2007 07:14
No way to do that in LSL soz.
Isis Ophelia
Registered User
Join date: 16 Mar 2006
Posts: 18
need this too
01-12-2007 06:05
I am also looking for such script

and saw one at Crucial's store (I think that is the name)
one clicks on the prim and it whispers, that he is being added
if he clicks a second time, it says you have been removed

Asking around someone told me that what the scripts does is to add the person touching to a list, but where to get such script, can someone help please?

Brooklyn, if you find or found already it, please share with me

Thank you in advance
Domino Marama
Domino Designs
Join date: 22 Sep 2006
Posts: 1,126
01-12-2007 06:51
Something like this will maintain a list in a prim. Warning, it could lose entire list if it runs out of memory though.

CODE

list avs;
key tK;
string tS;
integer tI;

default
{
touch_start(integer num_detected)
{
while( num_detected )
{
tK = llDetectedKey ( --num_detected );
if ( tK == llGetOwner() )
{
tS = llDumpList2String( avs, "," );
while ( llStringLength( tS ) > 1023 )
{
llOwnerSay( llGetSubString ( tS, 0, 1022 ) );
tS = llGetSubString( tS, 1023, - 1 );
}
llOwnerSay( tS );
return;
}
tI = llListFindList( avs, [ tK ] );
if ( tI != -1 )
{
avs = llDeleteSubList( avs, tI, tI + 1 );
llInstantMessage( tK, "You have been removed from the list" );
}
else
{
avs = ( avs = [] ) + avs + [ tK, llDetectedName( num_detected ) ];
llInstantMessage( tK, "You have been added to the list" );
}
}
}
}
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
Newgy's return to the forums
01-12-2007 09:15
Domino beat me to it but here's my version :)

CODE

//
// Simple List maker Script
//
// Global variables
list theList;

string strAdd = " ,You have been added to the list";
string strDelete = " ,You have been deleted.";

integer Listening;
integer listenchannel;

list MenuChoices = [ "List Members", "Clear List"];

// Functions
integer isNameOnList( string name)
{
integer selection = llListFindList(theList, [ name ]);
return selection;
}

ListMembers()
{
llOwnerSay( "The List:" );
integer i;
integer len;
len = llGetListLength( theList );
for( i = 0; i < len; i++ )
{
llOwnerSay( llList2String(theList, i) );
}
llOwnerSay("Total = " + (string)len );
}

init()
{
theList = [];
llSetText("Touch Me to be Added or removed from the list", <1.0,1.0,1.0>, 1);
}


//-------------------------------------------------------
UpdateListen(key id)
{
// Cancel the existing Listen
CancelListen();
// Choose a new random channel
listenchannel = 0 - (integer) llFrand(2147483647);
// Start Listening
Listening = llListen(listenchannel,"",id,"");
// Allow the user 30 seconds to respond before we auto cancel
llSetTimerEvent(30);
}

CancelListen()
{
if(Listening > 0) llListenRemove(Listening);
Listening = 0;
llSetTimerEvent(0);
}

// Owner Conversation Dialog
StartConversation(key id)
{
string text = "Owners Menu";
// finally show the dialog
UpdateListen(id);
llDialog(id,text,MenuChoices,listenchannel);
}
// Owner Conversation Dialog
StartMemberConversation(key id, string text)
{
UpdateListen(id);
llDialog(id,text,["YES"],listenchannel);
}

// States
default
{
state_entry()
{
llOwnerSay( "List Maker started...");
init();
}

on_rez(integer times)
{
// Will cause it to loose the list on rez
init();
}

touch_start(integer total_number)
{
// Owner or owner Group control
key id = llDetectedKey(0);
if(llGetOwner() == id)
{
StartConversation(id);
}
else
{
string name = llKey2Name(id);
integer Index = isNameOnList(name);
string text;
if(Index >= 0)
text = name + "\nWould you like to be deleted?";
else
text = name + "\nWould you like to be added?";
StartMemberConversation(id, text);
}
}

timer()
{
CancelListen();
}

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


if("List Members" == message)
ListMembers();
else if("Clear List" == message)
theList = [];
else if("YES" == message)
{
string avname = llKey2Name(id);
integer Index = isNameOnList(avname);
if(Index > -1)
{
theList = llDeleteSubList(theList, Index,Index);
llSay(0,name + strDelete);
}
else
{
theList = (theList = []) + theList + [ name ];
llSay(0,name + strAdd);
}
}
}

}
Isis Ophelia
Registered User
Join date: 16 Mar 2006
Posts: 18
superb!
01-13-2007 11:39
thank you very much to both of you :)
Brooklyn Davis
Owner, Parallax View
Join date: 15 May 2005
Posts: 226
01-16-2007 08:42
wow thats great. Im gonna try that when I get home. Thanks both
_____________________