Join us in Outworldz at http://www.outworldz.com:9000 or follow us:

[Table of Contents]

Want to add a script or a project? Upload it and a half million people will see it and your name here this year.

Home   Show All
Category: Contributor: Creator
Inventory Giver NotecardGiver  

NotecardGiver

NotecardGiver

Category: Inventory Giver
By : Encog Dod
Created: 2010-01-10 Edited: 2017-11-18
Worlds: Second Life

the Zip file

Download all files for NotecardGiver
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. NotecardGiver_1.lsl
1 // From the book:
2 //
3 // Scripting Recipes for Second Life
4 // by Jeff Heaton (Encog Dod in SL)
5 // ISBN: 160439000
6 X// Copyright 2007 by Heaton Research, Inc.
7 //
8 // This script may be freely copied and modified so long as this header
9 // remains unmodified.
10 //
11 // For more information about this book visit the following web site:
12 //
13 // http://www.heatonresearch.com/articles/series/22/
14 // Mod to give out a web link added by Ferd
15
16 // Tuneable things you need to set
17 integer giveNotecard = TRUE;
18 integer giveWebSite = TRUE;
19 string Message = "Visit the Outworldz Website";
20 string WebLink = "http://www.outworldz.com";
21 float Distance = 20;
22 string notecard = "Welcome Notecard";
23
24
25 integer freq = 5; // how often it scans, Keep this slow.
26 integer maxList = 100; // saves the last 100 people to avoid spamming
27 list given; // the list of people
28
29
30 default
31 {
33 {
34 llSensorRepeat("", "",AGENT, Distance, PI, freq);
35 }
36
37 sensor(integer num_detected)
38 {
39 integer i;
40 key detected;
41
42 for(i=0;i<num_detected;i++)
43 {
44 detected = llDetectedKey(i);
45
46 if( llListFindList(given, [detected]) < 0 )
47 {
48 given += llDetectedKey(i);
49 if(giveNotecard) {
50 llGiveInventory(detected, notecard);
51 }
52 if(giveWebSite) {
53 llLoadURL(detected,Message, WebLink);
54 }
55
56 if(llGetListLength(given) >= maxList)
57 {
58 given = llDeleteSubList(given,0,0);
59 }
60 }
61 }
62 }
63 }

Back to the Best Free Tools in Second Life and OpenSim.