CODE
// Global variables
integer CHANNEL = 37;
string firstDialog = "Choose one set of poses from the list below:";
list list1 = ["Drink","Chat","Work","Cancel"];
list DrinkList = ["Drink Animation","Toast","Laugh","Cancel"];
list ChatList = ["Talk 1","Talk 2","Talk 3","Cancel"];
list WorkList = ["Draw","Stand and Look","Lean Forward","Cancel"];
default
{
state_entry()
{
llSitTarget(<0,0,.5>, ZERO_ROTATION); // Sit here
llListen(CHANNEL, "", NULL_KEY, ""); // Listen for answers
}
changed(integer change) // When somebody sits on the prim
{
if (change & CHANGED_LINK)
{
if (llAvatarOnSitTarget() != NULL_KEY)
{
llSleep(1.0);
llDialog(llDetectedKey(0), firstDialog, list1, CHANNEL); // Launches dialog window
llSay(0, "Yes, I know you're sitting on me."); // Debugging chat line
}
}
}
listen(integer channel, string name, key id, string message)
{
if (llListFindList(list1, [message]) != -1) // handles first dialog box
{
if (message == "Drink")
{
llDialog(id, "Choose a pose:", DrinkList, CHANNEL); //Drink submenu
}
else if (message == "Chat")
{
llDialog(id, "Choose a pose:", ChatList, CHANNEL); // Chat submenu
}
else if (message == "Work")
{
llDialog(id, "Choose a pose:", WorkList, CHANNEL);
}
else if (message == "Cancel")
{
return;
}
}
if (llListFindList(DrinkList, [message]) != -1) // DrinkList submenu
{
if (message == "Drink Animation")
{
llSay(0, "Drink animation goes here");
}
else if (message == "Toast")
{
llSay(0, "Toast animation goes here");
}
else if (message == "Laugh")
{
llSay(0, "Laugh animation goes here");
}
}
if (llListFindList(ChatList, [message]) != -1) // ChatList submenu
{
if (message == "Talk 1")
{
llSay(0, "Talk 1 animation goes here");
}
else if (message == "Talk 2")
{
llSay(0, "Talk 2 animation goes here");
}
else if (message == "Talk 3")
{
llSay(0, "Talk 3 animation goes here");
}
}
if (llListFindList(WorkList, [message]) != -1) //WorkList submenu
{
if (message == "Draw")
{
llSay(0, "Draw animation goes here");
}
else if (message == "Stand and Look")
{
llSay(0, "Stand and Look animation goes here");
}
else if (message == "Lean Forward")
{
llSay(0, "Lean Forward animation goes here");
}
}
}
}
What's odd is that if I type into channel 37 the dialog message that I want to send, it works as though I had selected it from the box itself - that is, it looks like the dialog box is running, but not showing up on the screen. Any idea what I'm doing wrong?
This is my first script, so it's more than likely that I'm making some horrible rookie mistake.

EDIT - oh, and the "Yes, I know you're sitting on me." line does indeed appear in chat channel 0, just in case that wasn't clear.
