|
Rock Ryder
Registered User
Join date: 6 Oct 2006
Posts: 384
|
02-03-2008 14:04
Hi guys,
I need to script a visitor detector that can do the following:
a) Detect an avatar that come within 20m of the detector b) Sends me an IM when that happens, giving me the name of the visitor c) Detects when the avatar leaves, and sends me an IM, again with the name d) Include the date and time in each IM
ie:
Superdetector: Jason Smythe arrived, 20 Jan 2008, at 1:30PST Superdetector: Jason Smythe departed, 20 Jan 2008, at 1:37PST
As I get very infrequent visitors I am wondering if I should bother scripting for several avis being detected in a scan (thoughts on this please).
I was also wondering what the best approach to varying the range was, Notecard? Voice Command? Put it in the description of the host prim?
If there is an open source script that comes close to the above I would appreciate a pointer.
Many thanks in advance
Rock
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
02-03-2008 14:14
First you'll want to know about sensors. Particularly: http://www.lslwiki.net/lslwiki/wakka.php?wakka=llSensorRepeathttp://www.lslwiki.net/lslwiki/wakka.php?wakka=sensorhttp://www.lslwiki.net/lslwiki/wakka.php?wakka=no_sensorYou'll want to store information for up to 16 avatars (the max that can be detected by any sensor). You could possibly increase your coverage with sensors in multiple prims, each with a partial detection arc, but this gets complicated very quickly, especially because it entails communicating information between multiple scripts. You will want the resident's key at a minimum; possibly their name in addition or instead (so you can be sure you have it without complicated lookups or the risk of losing simple calls to llKey2Name() if they leave the sim). Keeping this list data is important so that you can compare the avatars detected in one sensor (or no_sensor) result to those in the next. Avatars who show up in the first but not the second have left, and avatars who show up in the second but not the first have arrived. To IM yourself, use 'llInstantMessage(llGetOwner(), message)' ( http://www.lslwiki.net/lslwiki/wakka.php?wakka=llInstantMessage). For including the time, see the various time functions ( http://www.lslwiki.net/lslwiki/wakka.php?wakka=time). The easiest is probably llGetTimestamp(), though you may want to parse the result into a form that is more quickly readable for most people, or use a combination of date and time functions to put together a result.
|