Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Filtering llListen for more than one Key

Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
04-05-2009 22:07
I'd like to control a listen event by filtering with llListen so that the script will only respond to one of two people. I know I can't do this .......

CODE

llListen(CHAN,"","aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" | "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb","START");
CODE


but does anyone have a clever idea that DOES work? I know I can always use NULL_KEY and test whatever is passed to the listen event, but is there a way to filter before it's passed? If there is, would that method reduce lag at all, or am I dreaming?
Ravanne Sullivan
Pole Dancer Extraordinair
Join date: 10 Dec 2005
Posts: 674
04-05-2009 22:21
Open two listens, each filtered for the desired av. You can have multilpe listens running together each with its own set of filters.
_____________________
Ravanne's Dance Poles and Animations

Available at my Superstore and Showroom on Insula de Somni
http://slurl.com/secondlife/Insula de Somni/94/194/27/
Papalopulus Kobolowski
working mind
Join date: 11 Aug 2006
Posts: 326
04-05-2009 23:06
just use an access List with 2 keys inside or the amount you whant, and then check the user keys into that list , grant access to who is in the list and not if they dont.

CODE

list access=["first key","second key"];

key toucher;

//some code to get the key by touch to open a listen event

if(~llListFindList(access, (list)toucher))
{
do something
//it exists
//This works because ~(-1) == 0
//It saves bytecode and is faster then doing != -1

}



http://wiki.secondlife.com/wiki/LlListFindList
_____________________


RAW terrain files - terraform your SIM!!
http://www.wishland.info/
PD:the wiki its your friend ;)
http://wiki.secondlife.com/wiki/LSL_Portal
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
04-06-2009 06:55
From: Ravanne Sullivan
Open two listens, each filtered for the desired av. You can have multilpe listens running together each with its own set of filters.


I thought you couldn't have two listen handlers on the same channel. Not true?
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
04-06-2009 07:07
From: Rolig Loon
I thought you couldn't have two listen handlers on the same channel. Not true?

nope, i had a poofer that had 3 listens on the same channel, 1 for each command and it worked just fine. (poof, hide, show)
_____________________
Dark Heart Emporium

http://www.xstreetsl.com/modules.php?name=Marketplace&MerchantID=133020

want more layers for tattoos, specifically for the head? vote here
http://jira.secondlife.com/browse/VWR-1449?

llDetectedCollision* Functions similar to touch
http://jira.secondlife.com/browse/SVC-3369
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
04-06-2009 07:13
From: Ruthven Willenov
nope, i had a poofer that had 3 listens on the same channel, 1 for each command and it worked just fine. (poof, hide, show)


Cool! Problem solved. Thanks! :D
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
04-06-2009 10:43
the benefit of the multiple listens is that the server will filter your listens for you and you can key word filter in the listen at the same time. the drawback is that you have two listens eating server time and they get filtered individually.

the benefit of filtering by key list in the script is you only have one listen and the sim has less to process since it's unfiltered at that end. the drawback is you're script processing time goes up and you'll need to filter key words within the script.

for 2-3 keys I'd go with with multiple listens, for much more than that the internal list checked with if (~llListFindList( gLstAllowed, (list)Id ) probably has less overall impact on the server (unless it's a heavily used channel, then maybe up the changeover limits)
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
04-06-2009 11:15
Thanks. That's the sort of advice I was hoping for. I had a gut feeling that it was more efficient to filter with llListen than to use a key list, when I only have two people to listen for. I just couldn't figure how to make it work since I had the mistaken idea that I couldn't have two listen handles on the same channel.