Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

help with llrequestagentdata

October Brotherhood
Registered User
Join date: 24 Jun 2005
Posts: 70
07-24-2006 14:00
i'm working on a scanner for people to be able to detect junk on thier land,
and who owns said junk.

i'm trying to use llrequestagentdata on a list of agent keys.
i've typed a very syntaxless version of what i'm trying to do below.
what happens is, it only runs the dataserver on the last one.
any thoughts on how to deal with this?
i've read the wikki and the lsl help page on the dataserver, and they don't
mention anything about this situation that i've seen.
please don't focus on my syntax here, unless you really think it's causing my issue,
i realize this would never compile.

string owner;
key objectsowner;
key ownerrequestkey;

sensor(number sensed)
{
integer I
i goes from 0 to number sensed
{
objectsowner = llgetowner(I)
ownerrequestkey = llrequestagentdata(objectsowner,DATA_NAME)
llOwnerSay("that is owned by " + owner)
}
}

dataserverthingy(somethin somethinelse)
{
if(somethin == ownerrequestkey)
{
owner = DATA;
}
}
Adriana Caligari
Registered User
Join date: 21 Apr 2005
Posts: 458
07-24-2006 14:04
It runs the last one as that is at the end of the sensor event :-(

A way to do it would be to use the sensor to build up the array, then trigger the dataserver with the first element vi llRequestAgentData

Then in the dataserver event process the returned data then fire off another llRequestAgentData for the next etc etc

That way you come out of sensor cleanly and can process the data at your leasure ( you might want to switch off the sensor befoire sending the 1st requestdata and switch it back on after processing the last return to stop the sensor interrupting the dataserver events)

Hope that makes sense - its late - i'm tired :-(
_____________________
Maker of quality Gadgets
Caligari Designs Store
October Brotherhood
Registered User
Join date: 24 Jun 2005
Posts: 70
07-24-2006 14:17
well i tried that last night with mixed results. i'll mess around with it some more.
i had the sensor make me a list, and then made a function that traversed the list and worked pretty much the same as the code inside the sensor did.

it just seems that it doen't like jumping out of the for loop into the dataserver and then back into the for loop.
October Brotherhood
Registered User
Join date: 24 Jun 2005
Posts: 70
07-24-2006 14:20
maybe instead of a for loop, i'll traverse the list with a variable that the data event increments.
Adriana Caligari
Registered User
Join date: 21 Apr 2005
Posts: 458
07-24-2006 21:40
I was about to say that - meant to say it last night


In the dataserver do something like this


dataserver---

process result

index ++

if ( not end of list )
{
request data @ index
return
}
else
{
start sensor
}
_____________________
Maker of quality Gadgets
Caligari Designs Store