Hello so, I've created a dialog menu meant to say things in chat when a certain button is touched. I want to announce the toucher did the action to the owner. For example; "Toucher has called on Owner" however, I am new to scripting so I inserted part of another script I did correctly where I wanted the same action to occur but I'm not sure if I'm doing it correctly resulting in an error (of course). What am i doing wrong here?
list buttons = ["-", "Call On", "Pick", "Test"];
string dialogInfo = "\nPlease make a choice.";
key ToucherID;
integer dialogChannel;
integer listenHandle;
integer lock = FALSE;
integer chan;
key owner_key;
key toucher_key;
string owner;
string toucher;
integer listener;
integer offset = 100;
default
{
state_entry()
{
dialogChannel = -1 - (integer)("0x" + llGetSubString( (string)llGetKey(), -7, -1) );
}
touch_start(integer num_detected)
{
ToucherID = llDetectedKey(0);
llListenRemove(listenHandle);
listenHandle = llListen(dialogChannel, "", ToucherID, "");
llDialog(ToucherID, dialogInfo, buttons, dialogChannel);
llSetTimerEvent(60.0); // Here we set a time limit for responses
}
listen(integer channel, string name, key id, string message)
{
if (message == "-")
{
llDialog(ToucherID, dialogInfo, buttons, dialogChannel);
return;
}
llListenRemove(listenHandle);
// stop timer since the menu was clicked
llSetTimerEvent(0);
if (message == "Call On")
{
{ chan = 0x80000000 | (integer)("0x"+(string)llGetOwner());
chan += offset ;
chan = -chan;
owner_key = llGetOwner();
owner = llGetDisplayName( owner_key );
}
{ listener = llListen(chan,"","","");
toucher_key = llDetectedKey(0);
toucher = llGetDisplayName( toucher_key );
llSay(0, toucher + " has called on " + owner );
}
else if (message == "Pick")
{
llSay(0, toucher + " has picked " + owner );
}
else
{
llSay(0, toucher + " has tested " + owner );
}
}
timer()
{
// stop timer
llSetTimerEvent(0);
llListenRemove(listenHandle);
llWhisper(0, "Sorry. You snooze; you lose.");
}
}