, and I can't seem to get it to wait for an input before ploughing on through the script. The rest of the script is working fine - all the variables are properly typecast, the listens all listen as expected, llListFindList is selecting the correct message in messageList (the first one with position matching the position of the user's name in avList.) As far as I can tell, the rest of the script also works ok too (if I change the default to delete, instead of not delete, it deletes.) I just don't seem to be able to make it wait for input from the user.I had thought that llListen( 0, "", currentname, "" ) would stop it proceeding until it heard something (anything) on channel 0 from the user in question, but this does not seem to be the case. Can any kind soul tell me, am I missing something obvious? Or does LSL just hate me? :0
the relevant section is:
listen( integer channel, string name, key id, string message )
{
...<snip for clarity>...
else if (channel == 899) { // 'edit' button relays name of button-pusher as message on this channel
string currentname = (string)message;
llSay(0, "HELLO " + (string)currentname + " STARTING EDITING MENU..."
;list current = [currentname];
integer index = llListFindList(avList, current);
if (index != -1)
{
llSay(0, currentname + " - would you like to delete the following entry? Please type 'yes' or 'no'"
;llListen( 0, "", currentname, "" );
// HERE'S THE PROBLEM POINT - how to make it wait for a response before ploughing on through the script?
llSay(0, llList2String(messageList, position));
if (message == "yes"
{
messageList = llDeleteSubList(messageList, position, position);
avList = llDeleteSubList(avList, position, position);
timestamps = llDeleteSubList(timestamps, position, position);
llSay( 0, "Thankyou " + (string)currentname + ", your entry has been deleted."
;}
else
{
// otherwise don't delete entry if "no" (or anything else) is typed:
llSay (0, "Okay " + (string)currentname + " - this entry has not been deleted."
; }
}
}
}
or no).