Sayrah Parx Posted August 11, 2011 Share Posted August 11, 2011 Is it more efficient to have something like this: state_entry(){ llListen(12345, "Object 1", "", ""); llListen(12345, "Object 2", "", ""); llListen(12345, "Object 3", "", "");}listen(integer channel, string name, key id, string message){ do_something();}Instead of something like this: state_entry(){ llListen(12345, "", "", "");}listen(integer channel, string name, key id, string message){ if ((name == "Object 1") || (name == "Object 2") || (name == "Object 3")) { do_something(); }} Or is it always better to have fewer listens, even when the listens are narrowly defined? Link to comment Share on other sites More sharing options...
0 Rolig Loon Posted August 11, 2011 Share Posted August 11, 2011 There's less load on the servers if you do your filtering in the script itself instead of making the servers do it three times. My solution would be something like default{ state_entry() { llListen(12345,"","",""); } listen (integer channel, string name key id, string msg) { if (~llListFindList(["Object 1","Object 2","Object 3"],[name])) { //Do something } }} Link to comment Share on other sites More sharing options...
0 Dora Gustafson Posted August 11, 2011 Share Posted August 11, 2011 Define "better"! One will be better under some conditions the other under others:smileyhappy: The question rightly belongs in the LSL Scripting forum Link to comment Share on other sites More sharing options...
Question
Sayrah Parx
Is it more efficient to have something like this:
Instead of something like this:
Or is it always better to have fewer listens, even when the listens are narrowly defined?
Link to comment
Share on other sites
2 answers to this question
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