Send same command on multi channels?
|
|
Kornscope Komachi
Transitional human
Join date: 30 Aug 2006
Posts: 1,041
|
08-22-2007 18:59
I'm sure there is a better/quicker way to do this. To send the same command on a range of channels. I've seen a listen that uses an index but I can't get to work. int1() { llSay(25001,"Int-One"  ; llSay(25002,"Int-One"  ; llSay(25003,"Int-One"  ; llSay(25007,"Int-One"  ; llSay(25008,"Int-One"  ; llSay(25009,"Int-One"  ; llSay(25019,"Int-One"  ; llSay(25022,"Int-One"  ; llSay(25011,"Int-One"  ; } Thanks team.
_____________________
SCOPE Homes, Bangu -----------------------------------------------------------------
|
|
Kidd Krasner
Registered User
Join date: 1 Jan 2007
Posts: 1,938
|
08-22-2007 20:45
What exactly doesn't work? You could, if you wanted, do something like: ------------- list channelList = <...>
integer numberOfChannels = llGetListLength(channelList); integer i; string message="Int-One";
for (i=0; i<numberOfChannels;i++) { llSay(llList2Integer(channelList, i), message); }
------------ But are you sure this is what you want? Why do you need so many channels all for the same message?
|
|
Kornscope Komachi
Transitional human
Join date: 30 Aug 2006
Posts: 1,041
|
08-22-2007 21:47
I have a set of walls, each with touch/dialog and channel. And a separate control prim. It's the only way ive got it to work and I have spent much time diagnosing and comparing scripts. Notecard configs have me totally stumped and, as you can tell, my communication is not good. I just thought that this bit of code could be shortened somehow.
I don't know if this is what I want and I am certain there are better ways to do things but I know this works for telling all the walls to change textures etc. When I learn a better way, it goes into the next version, as is the way of things.
Thanks for your help, I'll try and implement it.
_____________________
SCOPE Homes, Bangu -----------------------------------------------------------------
|
|
Squirrel Wood
Nuteater. Beware!
Join date: 14 Jun 2006
Posts: 471
|
08-22-2007 23:06
Why not have those walls all listen on the same channel and just issue the command once?
|
|
ed44 Gupte
Explorer (Retired)
Join date: 7 Oct 2005
Posts: 638
|
08-23-2007 17:56
Your long code will actually execute more quickly than your for loop. Space is only an issue if you are running out of memory.
|
|
Kornscope Komachi
Transitional human
Join date: 30 Aug 2006
Posts: 1,041
|
08-23-2007 19:23
Thanks for the advice..I got the llListen channel added and it shortens the code considerably. I have no idea about 'handling memory' just yet.
_____________________
SCOPE Homes, Bangu -----------------------------------------------------------------
|
|
Kidd Krasner
Registered User
Join date: 1 Jan 2007
Posts: 1,938
|
08-24-2007 08:44
From: Kornscope Komachi I have a set of walls, each with touch/dialog and channel. And a separate control prim. It's the only way ive got it to work and I have spent much time diagnosing and comparing scripts.
Do you always want all of the walls to change at the same time? If so, just use the same channel for each wall prim. There's no reason they need to be on separate channels.
|
|
Kidd Krasner
Registered User
Join date: 1 Jan 2007
Posts: 1,938
|
08-24-2007 08:47
From: ed44 Gupte Your long code will actually execute more quickly than your for loop. Space is only an issue if you are running out of memory. But in this case, cleaner code is the more important issue. People aren't going to be changing the walls so frequently that the speed of execution is that big an issue. Besides, the time involved with handling the llSay, and firing up each script in each wall segment will overwhelm any time difference between using a loop or using a sequence.
|