CODE
red,Roses are red!
blue,Violets are blue!
green,Grass is green!
So now if I type in /1 blue, I will get the response "Violets are blue!"
I have tried at the code for some time now taken from some examples I see here in the forums and the wiki. But I could use some help, I am doing something wrong:
CODE
integer input = 1; // channel to listen to
list myList = [];
integer lineNum = 0;
default
{
dataserver(key id, string data)
{
if (data != EOF) // Not EOF, so we're still reading lines
{
list myList = llCSV2List(data);
myList += [llToLower(data)];
lineNum++;
llGetNotecardLine("List of commands", lineNum);
}
}
state_entry()
{
llListen(input,"","","");
llGetNotecardLine("List of Commands", lineNum);
}
listen(integer channel, string name, key id, string message)
{
string myCommand = llList2String(myList ,0);
string myResponse = llList2String(myList ,1);
if(message == myCommand) //here is where I think I need help because it's not hearing the command
{
llWhisper(0, myResponse);
}
}
}