Jump to content

Using Lists


ChaosRaine
 Share

You are about to reply to a thread that has been inactive for 1913 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I have a script listening to a chat channel. When it hears a word it checks the list for the word. If it's not already on the list, it adds it. I'm having trouble checking the list for the word. Here's what I am doing.

Quote


        integer MC = 0;
        integer Done = llGetListLength(Liked);
        for (; MC<Done; ++MC)
        { 
        if (llList2String(Liked, MC) != (string)Match)
{
    
            llListenRemove(listener);
    
        Matches += Match;
        Matches += ",";
        
        
            ++mm; 
            
    llSetText((string)xx + " Likes \n" + (string)mm + " Matches", ZERO_VECTOR, 1);
        listener = llListen(MatchChannel,"",NULL_KEY,"");
        
}
else
{
    
     
    
    
        }
        }

 

Link to comment
Share on other sites

something like...

list liked = ["one", "Two", "three"];
default
{
    state_entry()
    { llListen(10, "","", "");
    }   
    listen( integer channel, string name, key id, string message )
    {
        if(message)          
        {     
            if (!~llListFindList(liked,[message])) 
            { llOwnerSay("adding *" + message + "* to list...");
              liked += message;              
            } 
            else
            { llOwnerSay("already on list...");
            }   
        }
     }
}

 

  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1913 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...