Innula Zenovka Posted April 30, 2011 Share Posted April 30, 2011 Someone asked me to help them tweak a script they'd bought, which I did, and while I was so doing, I noticed something I've never seen before.The script was switching between listening to the owner on integer chat_channel and integer dialog_channel, depending on whether there was a menu open or not. Now, when I do this, I have a global called integer handle, and then sayllListenRemove(handle); handle = llListen(dialog_channel,"",owner,""); // or handle = llListen(chat_channel,"",owner,""); as appropriate, which is how I learned to do it from the old lsl wiki.The way this script did it, though, was on the lines of llListen(-999,"",owner,"");//open the dialog listener //and then llListenRemove(-999);//to close itI don't think anything gets closed that way, and I've certainly never seen it done like that. I thought the integer you remove in llListenRemove(integer number) was the callback number and nothing to do with the channel. However, the original script was clearly written by someone who was reasonably competent, so I'm wondering if it's a shortcut I didn't know about. Link to comment Share on other sites More sharing options...
Darkie Minotaur Posted April 30, 2011 Share Posted April 30, 2011 llListenRemove needs the handle, not the channel - at least to my knowledge - but you can easily test it to make sure - I can't go on right now. Link to comment Share on other sites More sharing options...
Rolig Loon Posted April 30, 2011 Share Posted April 30, 2011 That's a mistake. It's pretty clear on the wiki: llListenRemove takes the callback number as its argument, not the channel. Link to comment Share on other sites More sharing options...
Innula Zenovka Posted April 30, 2011 Author Share Posted April 30, 2011 Thanks, both. That confirms what I thought. It just looked so odd, I wondered if it was a clever trick I'd never seen before. Link to comment Share on other sites More sharing options...
Void Singer Posted May 1, 2011 Share Posted May 1, 2011 oh I wish we could do something like that... unfortunately it'd cause massive conflicts as is with the integer based handles we get now.... some scheme like that could work if the listen handle spit out keys, and they put in some logic to close all the KEY handles with matching channels when listen remove got an integer.... I doubt such a setup will ever occur though Link to comment Share on other sites More sharing options...
Recommended Posts
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