First Dialog:
CODE
integer MENU_CHANNEL = 1024;
integer TIMEOUT_SECS = 20;
key detectedkey;
default
{
touch_start(integer total_number)
{
detectedkey = llDetectedKey(0);
llDialog(detectedkey, "What do you want to do?", ["A1", "A2", "Help", "Reset"], MENU_CHANNEL);
llSetTimerEvent(TIMEOUT_SECS);
}
listen(integer channel, string name, key id, string str)
{
if (channel == MENU_CHANNEL)
{
if (str == "A1")
{
detectedkey = llDetectedKey(0);
llMessageLinked(LINK_SET, 0, "1OPTIONS", detectedkey);
llOwnerSay("I did my side of things");
}
if (str == "A2")
{
detectedkey = llDetectedKey(0);
llMessageLinked (LINK_SET, 0, "2OPTIONS", detectedkey);
}
if (str == "Help")
{
llMessageLinked(LINK_SET, 0, "helpcard", detectedkey);
llOwnerSay("Giving Help Notecard");
}
else if (str == "Reset")
{
llMessageLinked(LINK_SET, 0, "reset", detectedkey);
}
}
}
timer()
{
llOwnerSay("Timed Out");
}
on_rez(integer start_param)
{
llResetScript();
}
}
Second Dialog:
CODE
integer MENU_CHANNEL = 1025;
integer TIMEOUT_SECS = 20;
key detectedkey;
default
{
link_message(integer sender_num, integer num, string str, key id)
{
if (str == "1OPTIONS")
{
detectedkey = id;
llDialog(detectedkey, "What do you want to do?", ["On", "Off", "List", "Clear"], MENU_CHANNEL);
llOwnerSay("I heard the linked message");
llSetTimerEvent(TIMEOUT_SECS);
}
}
listen(integer channel, string name, key id, string str)
{
if (channel == MENU_CHANNEL)
{
if (str == "On")
{
llMessageLinked(LINK_SET, 0, "On", detectedkey);
}
if (str == "Off")
{
llMessageLinked(LINK_SET, 0, "Off", detectedkey);
}
if (str == "List")
{
llMessageLinked(LINK_SET, 0, "list", detectedkey);
}
else if (str == "Clear")
{
llMessageLinked(LINK_SET, 0, "clear", detectedkey);
}
}
}
timer()
{
llOwnerSay("Timed Out");
}
on_rez(integer start_param)
{
llResetScript();
}
}