Guest User

Untitled

a guest
Sep 9th, 2018
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Read Notecard DataServer Example
  2. //by Hank Ramos
  3. string  notecardName;
  4. integer lineCounter;
  5. key     dataRequestID;
  6. list List;
  7.  
  8. default
  9. {
  10.     state_entry()
  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. {
  22.     state_entry()
  23.     {
  24.         notecardName=llGetInventoryName(INVENTORY_NOTECARD,0);
  25.         lineCounter = 0;
  26.         dataRequestID = llGetNotecardLine(notecardName, lineCounter);
  27.     }
  28.     dataserver(key queryid, string data)
  29.     {
  30.        
  31.         if (dataRequestID)
  32.         {
  33.            
  34.             if (data != EOF)
  35.             {
  36.              llOwnerSay(data);
  37.                 List+=data;
  38.                  lineCounter += 1;
  39.                 llSleep(6);
  40.                 dataRequestID = llGetNotecardLine(notecardName, lineCounter);
  41.             }
  42.             else if (data == EOF)
  43.             {
  44.                llOwnerSay("End of the list, touch again");
  45.        
  46.             llResetScript();
  47.             }
  48.            
  49.         }
  50.     }
  51. }
Add Comment
Please, Sign In to add comment