====== Gruppen-Invitor mit Sensor ======
Einfach ein Prim erstellen und diese zwei Scripte reinlegen, danach noch ggf. die Range anpassen und BOT_KEY und BOT_GROUP ändern.
===== Skript 1 =====
list visitor_list;
float range = 96.0; // in meters
float rate = 10.0; // in seconds
// Bot_LLUUID (status 3 gives you the Bot-Key)
//
key BOT_KEY=" >>> HERE <<< ";
// Die Gruppe in die der Bot einladen soll, einfach den Bot in die Gruppe einladen und dann "mygroups" aufrufen
//
key BOT_GROUP=" >>> HERE <<< ";
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()
{
llSay(0, "Visitor List Maker started...");
llSay(0, "The owner can say 'help' for instructions.");
llSensorRepeat( "", "", AGENT, range, TWO_PI, rate );
llListen(0, "", llGetOwner(), "");
// Eves
//
llMessageLinked(LINK_THIS, 0, (string)BOT_KEY + "|members " + (string)BOT_GROUP, NULL_KEY);
}
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;
// Eves
//
llMessageLinked(LINK_THIS, 0, (string)BOT_KEY +"|invite " + (string)llDetectedKey(i) + " " + (string)BOT_GROUP, NULL_KEY);
}
}
}
}
listen( integer channel, string name, key id, string message )
{
if( id != llGetOwner() )
{
return;
}
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.");
}
}
}
===== Skript 2 =====
// InstantMessage per llLinkedMessage
//
integer isKey(key in) {
if (in) return 2;
return (in == NULL_KEY);
}
default
{
link_message(integer sender_num, integer num, string str, key id)
{
if (num != 0) { return; }
list PARS;
PARS = llParseString2List(str, ["|"], []);
if (isKey(llList2Key(PARS,0))) {
// llOwnerSay("debug => " + llList2String(PARS, 0) + " => " + llList2String(PARS, 1));
llInstantMessage(llList2Key(PARS,0), llList2String(PARS, 1));
}
}
}
\\
~~UP~~
----