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

Search dozens of selected web sites for OpenSim and LSL script

New! Script Meta-Search will search thousands of scripts here and at other sites for LSL or Opensim scripts.
Loading

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
Notecard Reader Read_Notecard_DataServer_Example  

Read_Notecard_DataServer_Example

Read Notecard DataServer Example.lsl

Category: Notecard Reader
By : Anonymous
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for Read_Notecard_DataServer_Example
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Read_Notecard_DataServer_Example_1.lsl
1
2 //Read Notecard DataServer Example
3 //by Hank Ramos
4 string notecardName = "My Notecard";
5 integer lineCounter;
6 key dataRequestID;
7
8 default
9 {
11 {
12 llSay(0, "Ready. Click to start.");
13 }
14 touch_start(integer num_detected)
15 {
16 state readNotecard;
17 }
18 }
19
20 state readNotecard
21 {
23 {
24 lineCounter = 0;
25 dataRequestID = llGetNotecardLine(notecardName, lineCounter);
26 }
27 dataserver(key queryid, string data)
28 {
29 //Check to make sure this is the request we are making.
30 //Remember that when data comes back from the dataserver,
31 //it goes to *all* scripts in your prim.
32 //So you have to make sure this is the data you want, and
33 //not data coming from some other script.
34 if(dataRequestID)
35 {
36 //If we haven't reached the end of the file
37 //Display the incoming data, then request the next line #
38 if(data != EOF)
39 {
40 dataRequestID = llGetNotecardLine(notecardName, lineCounter);
41 lineCounter += 1;
42 llSay(0, "Line #" + (string)lineCounter + ": " + data);
43 }
44 else
45 {
46 state default;
47 }
48 }
49 }
50 }// END //

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