Top Free Scripts
Script ID : 11
Audience : Default
Version 1.00.04
Published Date: 2007/1/22 5:21:22
Reads : 11813
Agent/Avatar

This script can do two things: It will make a list of all that Touch it, except the owner, and it can Instant Message owner the name of each person Touching as it happens...


What it cannot do is add people to a group. Unfortunately, that is not yet available in LSL as of now (JAN 2007.)

A good way to use this script is to place it inside of a sign like I have at my store. Check it once or twice a day, reseting the list after getting the current names and adding them manually to group.

IMPORTANT: You must Reset the List before it gets to around 125 or the script will stop working.

integer sendIM TRUE//sends IM to Owner


list names;
integer total;

integer menu_handler;
integer menu_channel;
menu(key user,string title,list buttons)
{
    
menu_channel = (integer)(llFrand(99999.0) * -1);
    
menu_handler llListen(menu_channel,"","","");
    
llDialog(user,title,buttons,menu_channel);
    
llSetTimerEvent(15.0);
}

default
{
    
on_rez(integer r)
    {
        
llResetScript();
    }
    
    
state_entry()
    {
        
names = [""];
        
total 0;
        
llSetText("Touch to join our Group", <0.901960.725490.35294>, 1.0); //Floating Text, edit or remove
        
llOwnerSay("Ready... list is reset to 0.");
    }

    
touch_start(integer num_detected)
    {
        
integer x;
        for(
x;<= num_detected1;x++)
        {
            if ( 
llDetectedKey(x) != llGetOwner() )
        {
                
integer find llListFindList(names,[llDetectedName(x)]);
                if(
find 1)
                {
                    
llInstantMessage(llDetectedKey(x), "Your request has been sent. Please be patient and you will be added to the group as soon as possible."); //Message to Toucher
                    
names names+ [llDetectedName(x)];
                    
total total 1;
                    if (
sendIM)
                    {
                        
llInstantMessage(llGetOwner(), " " llDetectedName(x) + " has requested to be added."); //Message to Owner
                    
}
                }
                else
                {
                    
llInstantMessage(llDetectedKey(x), "You've already requested to be added."); //Message to repeat Toucher
                
}
            }
            else if ( 
llDetectedKey(x) == llGetOwner() )
            {
                
llOwnerSay((string)total " people have Touched me so far!");
                
menu(llGetOwner(),"Please Select One",["Show List","Reset""Turn Off"]);
            }
        }  
    }
    
    
timer() 
    {
        
llSetTimerEvent(0.0);
        
llListenRemove(menu_handler);
    }

    
listen(integer channel,string name,key id,string message)
    {
        if (
channel == menu_channel
        {
            if(
message == "Show List")
            {
                
integer len llGetListLengthnames );
                
integer i;
                for( 
0leni++ )
                {
                    
integer a i;
                    
llOwnerSay((string)" : " llList2String(namesi));
                }
            }
            else if(
message == "Reset")
            {
                
llOwnerSay("Clearing List & Reseting Script now.");
                
llResetScript();
            }
            else if(
message == "Turn Off")
            {
                
llOwnerSay("Turning Off Now. Touch again to turn back On.");
                
state off;
            }
        }
    }
}

state off
{
    
on_rez(integer r)
    {
        
llResetScript();
    }
    
    
state_entry()
    {
        
llSetText("", <000>, 1.0);
    }
    
    
touch_start(integer total_number)
    {
        if (
llGetOwner())
        {
            
llOwnerSay("Turning back On now.");
            
llResetScript();
        }
    }
}

0
|  Links 
Printer Friendly Page Send this Script to a Friend
Search for Help
New Product
Free Item
Sponsor

Site Info
Total Hits