Bonus Question:
How do you use the not statement for a string
if (signal NOT ""
launch=1How do I best send the following to another object by llWhisper
quantity = 12
color = "red"
item = "pencil"
These forums are CLOSED. Please visit the new forums HERE
How to get a listen event to only happen at intervals? |
|
|
Tegg Bode
FrootLoop Roo Overlord
Join date: 12 Jan 2007
Posts: 5,707
|
08-09-2008 01:22
I want to make a listen even only check for messages every minute or so rather than all the time to make it lag friendly, is there a way to put a listen event inside a timer(0) event?
Bonus Question: How do you use the not statement for a string if (signal NOT "" launch=1How do I best send the following to another object by llWhisper quantity = 12 color = "red" item = "pencil" _____________________
Level 38 Builder [Roo Clan]
Free Waterside & Roadside Vehicle Rez Platform, Desire (88, 17, 107) Avatars & Roadside Seaview shops and vendorspace for rent, $2.00/prim/week, Desire (175,48,107) |
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
08-09-2008 02:04
The only way I can think of that you can get the listen to CHECK for events every once in a while but not MISS any would be by use of llMinEventDelay(), but note that this will affect other events in your script as well (link messages and multiple scripts might be helpful here, but watch out for the limit on queued link messages: 64).
http://www.lslwiki.net/lslwiki/wakka.php?wakka=llMinEventDelay As for string equality, try the != operator, just like integers, floats, etc. (e.g. signal != "" .Finally, you could either have the receiving script understand that certain places in your message represent certain fields: CODE
...or you could actually send name/value pairs. For example: CODE
These are just examples. You may need to handle cases differently depending on your application. For example, llCSV2List() may not work well for you if any of your string values might include commas (,), though they ARE handled automatically by that function for the inside of vector and rotation values. Hopefully it gives you an idea of how to approach the problem though. |
|
Lightwave Valkyrie
Registered User
Join date: 30 Jan 2004
Posts: 666
|
08-09-2008 02:21
you can turn it on a listen with
Handle =llListen(0,"",NULL_KEY,"" ;you can turnoff a listen with llListenRemove(Handle); NOT is ! if (signal != "" launch=1the last one i would use llParseString2List and llList2String llWhisper(1,12 red pencil" ;in listen event list my_list = llParseString2List(message,[" "],["."]); then pull out your commands with command1 = (integer)llList2String(my_list,0); //0=12,1=red,2=pencil command2 = llList2String(my_list,1); command3 = llList2String(my_list,2); _____________________
L$ is the root of all evil
videos work! thanks SL ![]() |
|
Tyken Hightower
Automagical
Join date: 15 Feb 2006
Posts: 472
|
08-09-2008 02:46
IMHO, you're trying way too hard to be lag-friendly. Just run a normal listen. There's no way to have it trigger once every so often and still collect the data it needs to trigger, anyway.
_____________________
![]() |
|
Tegg Bode
FrootLoop Roo Overlord
Join date: 12 Jan 2007
Posts: 5,707
|
08-09-2008 03:23
Cool thanx, cool help there,I had found most of that in the wiki, but couldn't get my head round quite how to use it or which ways were better. And my whispering data only needs to be listened every 30 seconds or so and there may be a lot of them spread about in the sim on the same transmit channel so don't want to fill that channel with noise that's not needed every 0.1 seconds but then again it might miss the message 90% of the time so probably better to limit the llWhisper than the listens
![]() _____________________
Level 38 Builder [Roo Clan]
Free Waterside & Roadside Vehicle Rez Platform, Desire (88, 17, 107) Avatars & Roadside Seaview shops and vendorspace for rent, $2.00/prim/week, Desire (175,48,107) |
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
08-09-2008 14:02
There's no way to have it trigger once every so often and still collect the data it needs to trigger, anyway. Except llMinEventDelay(), as I said. It should do exactly that. It just does it for ALL events in the current script. |