Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string notecard1 = "notecard1"; // First notecard in inventory
- string notecard2 = "notecard2";
- key QueryNotecard1; // Key assigned to the dataserver query to read the first notecard.
- key QueryNotecard2; // Key asssigned to the dataserver query to read the the second notecard.
- // We give each notecard to be read a unique identifier so the dataserver event knows which notecard to read.
- integer i; // Notecard line
- integer total1;
- integer total2;
- default
- {
- state_entry()
- {
- total1 = llGetNumberOfNotecardLines(notecard1);
- QueryNotecard1 = llGetNotecardLine(notecard1,i = 0); // Assigning reading of the first notecard to a key that is passed to the dataserver to identify what notecard to read.
- }
- touch_start(integer total_number)
- {
- total2 = llGetNumberOfNotecardLines(notecard2);
- QueryNotecard2 = llGetNotecardLine(notecard2,i = 0); // Assigning reading of the second notecard to a key that is passed to the dataserver to identify what notecard to read.
- }
- dataserver(key queryid, string data)
- {
- if(queryid == QueryNotecard1) // The id passed to the dataserever event was the id for the first notecard so read the first notecard.
- {
- if(data != EOF)
- {
- llOwnerSay("Data on line " + (string)i + " of "+ (string)total1 + " is " + data + ".");
- QueryNotecard1 = llGetNotecardLine(notecard1, ++i); // Read the next line of the first notecard
- }
- else
- {
- llOwnerSay("Finished reading notecard.");
- }
- }
- else if(queryid == QueryNotecard2) // The id passed to the dataserever event was the id for the second notecard so read the second notecard.
- {
- if(data != EOF)
- {
- llOwnerSay("Data on line " + (string)i + " of "+ (string)total2 + " is " + data + ".");
- QueryNotecard2 = llGetNotecardLine(notecard2, ++i); // Read the next line of the second notecard
- }
- else
- {
- llOwnerSay("Finished reading notecard.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement