Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Accessing User's Inventory

Lofty Lane
Registered User
Join date: 27 Feb 2007
Posts: 3
03-12-2007 07:21
Hi all!

I have a perfectly functional doormat at the entrance to my little domain which greets visitors. What I'd like to do is allow it to give the user that passes over it a notecard explaining the rules of my place, but i only want to do this the first time they visit.

Is there any way to see if the user already has my notecard?

many thanks
Keknehv Psaltery
Hacker
Join date: 11 Apr 2005
Posts: 1,185
03-12-2007 07:31
You can't view their inventory, as that would cause massive privacy problems. You can, however, keep a list in the script of people who have visited recently-- so it would at least be a rare occurence.
Lofty Lane
Registered User
Join date: 27 Feb 2007
Posts: 3
03-12-2007 07:40
From: Keknehv Psaltery
You can't view their inventory, as that would cause massive privacy problems. You can, however, keep a list in the script of people who have visited recently-- so it would at least be a rare occurence.



Oooh! A cunning plan!

I like that. I'll give it a go!
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
03-12-2007 08:57
While you can store quite a few keys in a script (upwards of a hundred or so), if you have more folks show up, it will eventually fill up the script's memory, and will fail, giving a stack/heap collision error. There are in-world scritped workarounds, like using multiple scripts designed as a "database", but probably the best way is via database storage on a website that you update with llHTTPRequest.
Lofty Lane
Registered User
Join date: 27 Feb 2007
Posts: 3
03-12-2007 09:02
Hmmm...

That's not really feasible. I need to keep it "in world".

Maybe I'll just direct them to go and pick up a copy of the "Rules and Regulations" manually.

Many thanks for your helpful comments, though.

Cheers
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
03-12-2007 09:12
Well, you might also do some kind of "cycling" of keys, so that it doesn't give out a notecard to anyone it did recently, but if someone hadn't been to your place in a while, their key would have fallen off of the list, and they would get another copy. Frequent visitors wouldn't get one repeatedly, unless you had over a hundred or so unique frequent visitors.

Basically, a few ways to compromise to give you what you want. :)