Jump to content

llListen done Correctly


LepreKhaun
 Share

You are about to reply to a thread that has been inactive for 3932 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

If any of you new scripters ever get confused about the correct way to keep track of listeners, you only need to study and understand https://wiki.secondlife.com/wiki/Dialog_Menus, where some of the top minds in LSL scripting have worked it out for you.

 

Pay particular attention to the section Further Listener Removal, since this covers an aspect that is often overlooked by those that have begun to think there's nothing left to learn.

Link to comment
Share on other sites

I also use a toggle, to keep others from closing a listen that is

being used by the original toucher.....

 touch_start(integer num_detected)
    {
        ToucherID = llDetectedKey(0);
        if(tog == 1){llSay(0,"In Use"); }
        else
        {
        tog = 1;
        llListenRemove(listenHandle);    // It doesn't matter if we try closing an already closed, or non-existent listener  
        listenHandle = llListen(dialogChannel, "", ToucherID, "");
        llDialog(ToucherID, dialogInfo, buttons, dialogChannel);
        llSetTimerEvent(60.0); // Here we set a time limit for responses
        }
    }

 

//  then reset the toggle when the listen is closed, and in the timer :)

//  this allows only one user at a time, if you needed more, you could

// open a new listener and  add one to the channel after comparing

// id's ?

  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3932 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...