Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

event queue & speed

Mark Busch
DarkLife Developer
Join date: 8 Apr 2003
Posts: 442
11-05-2004 06:20
if you have an object that listens to multiple channels to do several things (mostly done by other scripts) would it help to create 1 script for each listen-channel? or is the event-queue working on the object instead of the script?

for example

script: listen 1
listens on channel 2
on receive send link message to script action 1

script listen 2
listens on channel 10
on receive send link message to script action 2

would this mean that if the object receives messages on both channels at the same time that these messages are handles seperatly, or does the object have 1 event-que total, so the event in script 2 waits for the event in script 1 to finish?
Evil Fool
"==" != "="
Join date: 30 Jul 2004
Posts: 110
11-05-2004 12:14
still not quite sure what you meant there

but here's an idea
CODE
//
integer lcallA; // callback for listen on channel 1, or whatever
integer lcallB; // callback for listen on channel 2, or whatever
state_entry()
{
lcallA = llListen(1,"",llGetOwner(),"");
lcallB = llListen(2,"",llGetOwner(),"");
}

listen(integer chan, string name, key id, string msg)
{
if (chan == 1)
{
do stuff;
}else if (chan == 2)
{
do something else;
}
}


you can add else if's, and modify what it does, etc

edit:
if you need 2 of the listens to trigger at the SAME EXACT moment, then you might want to use 2 scripts... although it would probably be pointless, unless you are doing alot of llParseString2Lists or llInstantMessages
Samhain Broom
Registered User
Join date: 1 Aug 2004
Posts: 298
11-05-2004 12:28
Oh, I thought that kind of multiple listen was now borked by (correct me if I am wrong) LSL 1.5.5. (or was it 1.5.4?)

I think you need to open the listen completely (just 1 of them) and then still you need to do the conditionals on the channel ID to see if it was something to which your script was interested in listening.
_____________________
rm -rf /bin/ladden #beware of geeks bearing grifts