Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llRequestAgentData

Landing Normandy
Proposing 4968
Join date: 28 Nov 2005
Posts: 240
11-02-2006 15:34
Can you use llRequestAgentData and pass more than one key?

While trying to find the solution to this I decided to try putting the keys of all three users together, so you have key1|key2|key3. I know that works in some systems, but it either doesn't work in this case or I've done something wrong further down the line... any ideas?
_____________________
<VOTE PROPOSITION 4968/>
http://jira.secondlife.com/browse/VWR-4968
For SecondLife Builders who need better mapping for better building
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
11-02-2006 15:41
From: Landing Normandy
Can you use llRequestAgentData and pass more than one key?

While trying to find the solution to this I decided to try putting the keys of all three users together, so you have key1|key2|key3. I know that works in some systems, but it either doesn't work in this case or I've done something wrong further down the line... any ideas?


I've never heard of that being done in LSL, nor has it ever been mentioned as being supported in LSL. If you want multiple user status info, you need to send multiple requests.
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey
Landing Normandy
Proposing 4968
Join date: 28 Nov 2005
Posts: 240
11-02-2006 16:01
Don't suppose you want to give me an example? I'm trying desperately to modify my 'doorbell' that notifies me when someone enters the building as long as I'm online, to have it notify a group of people. I've set it up to do so from a list of three user's keys, but beyond that I'm stuck!
_____________________
<VOTE PROPOSITION 4968/>
http://jira.secondlife.com/browse/VWR-4968
For SecondLife Builders who need better mapping for better building
Bino Arbuckle
Registered User
Join date: 31 Dec 2002
Posts: 369
11-05-2006 02:39
How is your doorbell notifying you?

What information are you getting from llRequestAgentData() that enables you to notify people?

Most communication functions I know of use keys, which you already seem to have...
Landing Normandy
Proposing 4968
Join date: 28 Nov 2005
Posts: 240
11-05-2006 05:39
It uses Volume Detect to detect someone, and then IMs you if, and only if, you're online
_____________________
<VOTE PROPOSITION 4968/>
http://jira.secondlife.com/browse/VWR-4968
For SecondLife Builders who need better mapping for better building
Deanna Trollop
BZ Enterprises
Join date: 30 Jan 2006
Posts: 671
11-05-2006 08:10
Keys can't be ORed together like bitfields.

This is the slow way to do it, but:

Have a list of keys to be notified and a global integer you increment to step through them. When the "doorbell" is triggered, set the integer to zero, and call llRequestAgentData on the first key. Inside the dataserver event, if returned that they're online, send them the notification. Increment the integer, and if less than the length of the list, call llRequestAgentData on the next listed key, and so on.

CODE
list Keys; // [ key1, key2, key3... ]
integer i;

collision_start( integer Num )
{
i = 0;
llRequestAgentData( llList2Key( Keys, i ), DATA_ONLINE );
}

dataserver( key QID, string Data )
{
if( Data == "1" )
llInstantMessage( llList2Key( Keys, i ), "Someone's here!" );

if( ++i < llGetListLength( Keys ) )
llRequestAgentData( llList2Key( Keys, i ), DATA_ONLINE );
}
[ Note: the above won't compile as-is, it's just a quick-n-dirty example ]

Notifications won't go out instantly, but will dribble out as fast as responses come into the dataserver event, plus the 2 sec. delay imposed by each llInstantMessage call.
Bino Arbuckle
Registered User
Join date: 31 Dec 2002
Posts: 369
11-05-2006 12:18
Aha, Landing, it's an online-only thing, gotcha.

Deanna's suggestion is a good one, if as mentioned, a bit 'slow'.

Another idea might be to break the functionality out into multiple scripts, and use linkmessages to pass data. That way you could have separate scripts absorb the various inherent delays for llRequestAgentData() and llInstantMessage() and not sacrifice your doorbell monitor's effectiveness.