<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.secondlife.com/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Topaz+Emerald</id>
	<title>Second Life Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.secondlife.com/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Topaz+Emerald"/>
	<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/wiki/Special:Contributions/Topaz_Emerald"/>
	<updated>2026-07-28T15:55:48Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LlGetNotecardLine&amp;diff=933732</id>
		<title>LlGetNotecardLine</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LlGetNotecardLine&amp;diff=933732"/>
		<updated>2010-06-01T08:11:27Z</updated>

		<summary type="html">&lt;p&gt;Topaz Emerald: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{LSL_Function/negative_index|false|line}}{{LSL_Function/notecard|name|uuid=true}}{{LSL_Function&lt;br /&gt;
|func_id=217|func_sleep=0.1|func_energy=10.0&lt;br /&gt;
|sort=GetNotecardLine&lt;br /&gt;
|func=llGetNotecardLine&lt;br /&gt;
|return_type=key&lt;br /&gt;
|p1_type=string|p1_name=name&lt;br /&gt;
|p2_type=integer|p2_name=line|p2_desc=Line number in a notecard (the index starts at zero).&lt;br /&gt;
|func_desc=Requests the line &#039;&#039;&#039;line&#039;&#039;&#039; of the notecard &#039;&#039;&#039;name&#039;&#039;&#039; from the dataserver.&lt;br /&gt;
|return_text=that is the handle for a [[dataserver]] event response.&lt;br /&gt;
|func_footnote=If &#039;&#039;&#039;line&#039;&#039;&#039; is past the end of the notecard [[EOF]] is returned by the [[dataserver]].&lt;br /&gt;
|spec&lt;br /&gt;
|caveats=* If notecard contains embedded inventory items (such as textures and landmarks), [[EOF]] will be returned, regardless of the line requested.&lt;br /&gt;
*If the requested line is longer then 255 bytes the [[dataserver]] will return the first 255 bytes of the line.&lt;br /&gt;
|constants&lt;br /&gt;
|examples=&amp;lt;lsl&amp;gt;&lt;br /&gt;
key kQuery;&lt;br /&gt;
integer iLine = 0;&lt;br /&gt;
default {&lt;br /&gt;
    &lt;br /&gt;
    state_entry() {&lt;br /&gt;
        llSay(0, &amp;quot;Reading notecard...&amp;quot;);&lt;br /&gt;
        kQuery = llGetNotecardLine(&amp;quot;My Notecard&amp;quot;, iLine);   // read in &amp;quot;My Notecard&amp;quot; when you can&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    dataserver(key query_id, string data) {&lt;br /&gt;
&lt;br /&gt;
        if (query_id == kQuery) {    // were we called to work on &amp;quot;My Notecard&amp;quot;?&lt;br /&gt;
            // this is a line of our notecard&lt;br /&gt;
            if (data == EOF) {    &lt;br /&gt;
&lt;br /&gt;
                llSay(0, &amp;quot;No more lines in notecard, read &amp;quot; + (string)iLine + &amp;quot; lines.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
            } else {&lt;br /&gt;
                &lt;br /&gt;
                llSay(0, &amp;quot;Line &amp;quot; + (string)iLine + &amp;quot;: &amp;quot; + data);   // data has the current line from this notecard&lt;br /&gt;
                &lt;br /&gt;
                //request next line&lt;br /&gt;
                iLine++;   // increment line count&lt;br /&gt;
                kQuery = llGetNotecardLine(&amp;quot;My Notecard&amp;quot;, iLine);   // read another line when you can&lt;br /&gt;
&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
|helpers=&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
/////&lt;br /&gt;
//  Generic Multi Notecard reader by Brangus Weir&lt;br /&gt;
//  Given freely and published on wiki.secondlife.com&lt;br /&gt;
//&lt;br /&gt;
//  This script will read three note cards and store the results into three lists.&lt;br /&gt;
//  It can be modified and extended to as many (or few) cards as you&#039;d like to read. &lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
list gOneCard;    // All the lines from from the first card&lt;br /&gt;
list gTwoCard;    // All the lines from from the second card&lt;br /&gt;
list gThreeCard;  // All the lines from from the third card&lt;br /&gt;
&lt;br /&gt;
string gsCardOneName = &amp;quot;One&amp;quot;;  //Set these to the name of the invetory item.&lt;br /&gt;
string gsCardTwoName = &amp;quot;Two&amp;quot;;&lt;br /&gt;
string gsCardThreeName = &amp;quot;Three&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
//Temporary variables for processing&lt;br /&gt;
string g_sNoteCardName; // Name of the card to be read.&lt;br /&gt;
list g_lTempLines;      // The resulting data pushed into a list&lt;br /&gt;
integer g_iLine;        // The line count for the card reader&lt;br /&gt;
key g_kQuery;           // The key of the card being read&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
initialize(string _action) {&lt;br /&gt;
    // Due to the execution order when using dataserver, this function sets the first card to &lt;br /&gt;
    // be read, and the excetuion finishes when called again with the _action set to &amp;quot;finish&amp;quot;.&lt;br /&gt;
    if (_action == &amp;quot;&amp;quot;) {&lt;br /&gt;
        loadNoteCard(gsCardOneName);&lt;br /&gt;
    } else if (_action == &amp;quot;finish&amp;quot;) {&lt;br /&gt;
        // All cards have been read into the lists... now you can do any kind of string&lt;br /&gt;
        // manipulations to get the data you need to set your script.&lt;br /&gt;
        // But here we will prove that the cards have been read with a loop&lt;br /&gt;
&lt;br /&gt;
        g_lTempLines = []; // lets not forget to delete this global, or it will be dead weight.&lt;br /&gt;
&lt;br /&gt;
        integer len = llGetListLength(gOneCard);  //Always evaluate this once, don&#039;t do it&lt;br /&gt;
                                                  //INSIDE the for loop like noob programers will.&lt;br /&gt;
                                                  //Reduce lag, THINK ABOUT MACHINE CYCLES!&lt;br /&gt;
        integer i = 0;&lt;br /&gt;
        for (; i&amp;lt; len; ++i)&lt;br /&gt;
            llSay(0, llList2String(gOneCard,i));&lt;br /&gt;
&lt;br /&gt;
        len = llGetListLength(gTwoCard);&lt;br /&gt;
        for (i = 0; i&amp;lt; len; ++i)&lt;br /&gt;
            llSay(0, llList2String(gTwoCard,i));&lt;br /&gt;
&lt;br /&gt;
        len = llGetListLength(gThreeCard);&lt;br /&gt;
        for (i = 0; i&amp;lt; len; ++i)&lt;br /&gt;
            llSay(0, llList2String(gThreeCard,i));&lt;br /&gt;
    }                &lt;br /&gt;
                              &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
loadNoteCard( string _notecard ) {&lt;br /&gt;
    g_lTempLines = []; //clear the temp lines&lt;br /&gt;
    g_sNoteCardName = _notecard;&lt;br /&gt;
    g_iLine = 0;&lt;br /&gt;
    g_kQuery = llGetNotecardLine(g_sNoteCardName, g_iLine);  &lt;br /&gt;
    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
notecardFinished(string _notecard){&lt;br /&gt;
    // Called at the end of each notecard as it is read. The temp results are stored&lt;br /&gt;
    // and the next card is commanded to be read.&lt;br /&gt;
    if (_notecard == gsCardOneName) {&lt;br /&gt;
        gOneCard = g_lTempLines;&lt;br /&gt;
        loadNoteCard(gsCardTwoName);&lt;br /&gt;
    } else if (_notecard == gsCardTwoName) {&lt;br /&gt;
        gTwoCard = g_lTempLines;&lt;br /&gt;
        loadNoteCard(gsCardThreeName);&lt;br /&gt;
    } else if (_notecard == gsCardThreeName) {&lt;br /&gt;
        gThreeCard = g_lTempLines;&lt;br /&gt;
        initialize(&amp;quot;finish&amp;quot;);  // Finally pass execution to finish the initialization.   &lt;br /&gt;
    }    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer _num_det){&lt;br /&gt;
        initialize(&amp;quot;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
     &lt;br /&gt;
    dataserver(key _query_id, string _data) &lt;br /&gt;
    {&lt;br /&gt;
        if (_query_id == g_kQuery) {&lt;br /&gt;
            // this is a line of our notecard&lt;br /&gt;
            if (_data != EOF) {    &lt;br /&gt;
                g_lTempLines += _data;&lt;br /&gt;
                //request a next line&lt;br /&gt;
                ++g_iLine;   // increment line count&lt;br /&gt;
                g_kQuery = llGetNotecardLine(g_sNoteCardName, g_iLine);&lt;br /&gt;
            } else {&lt;br /&gt;
                //The notecard has been read &lt;br /&gt;
                //notify end of read&lt;br /&gt;
                notecardFinished(g_sNoteCardName);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
/////&lt;br /&gt;
//  Generic Multi Notecard reader by Randur Source&lt;br /&gt;
//  Given freely and published on wiki.secondlife.com&lt;br /&gt;
//&lt;br /&gt;
//  This script will read all note cards in sequence and dump the results into chat as an example.&lt;br /&gt;
//  It can be modified and extended to do other things to the data. &lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
integer inventorycnt;&lt;br /&gt;
integer notecardlinecnt;&lt;br /&gt;
integer notecardlinenumber;&lt;br /&gt;
string notecardname;&lt;br /&gt;
key linenumberid;&lt;br /&gt;
key lineid;&lt;br /&gt;
&lt;br /&gt;
getnextnotecardlinenumber()&lt;br /&gt;
{&lt;br /&gt;
    // first get the number of lines from the notecard&lt;br /&gt;
    inventorycnt++;&lt;br /&gt;
    if (inventorycnt &amp;lt; llGetInventoryNumber(INVENTORY_NOTECARD))&lt;br /&gt;
    {&lt;br /&gt;
        notecardname = llGetInventoryName(INVENTORY_NOTECARD,inventorycnt);&lt;br /&gt;
        linenumberid = llGetNumberOfNotecardLines(notecardname);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
        llOwnerSay(&amp;quot;Done.&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
getnextnotecardline()&lt;br /&gt;
{&lt;br /&gt;
     // get the next line from the notecard or skip to the next notecard&lt;br /&gt;
    notecardlinecnt++;&lt;br /&gt;
    if (notecardlinecnt &amp;lt; notecardlinenumber)&lt;br /&gt;
        lineid = llGetNotecardLine(notecardname,notecardlinecnt);&lt;br /&gt;
    else&lt;br /&gt;
        getnextnotecardlinenumber();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        if (llDetectedKey(0) != llGetOwner()) return; // allow owner only&lt;br /&gt;
&lt;br /&gt;
        inventorycnt = -1;&lt;br /&gt;
        getnextnotecardlinenumber();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    dataserver(key queryid,string data)&lt;br /&gt;
    {&lt;br /&gt;
        if (queryid == linenumberid) // this was a line number lookup&lt;br /&gt;
        {&lt;br /&gt;
            linenumberid = NULL_KEY;&lt;br /&gt;
            notecardlinenumber = (integer)data;&lt;br /&gt;
            if (notecardlinenumber == 0)&lt;br /&gt;
                getnextnotecardlinenumber();&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                notecardlinecnt = -1;&lt;br /&gt;
                getnextnotecardline();&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        else if (queryid == lineid) // this was a data line lookup&lt;br /&gt;
        {&lt;br /&gt;
            lineid = NULL_KEY;&lt;br /&gt;
&lt;br /&gt;
            // Example of what to do with the data:&lt;br /&gt;
            // Test for valid avatar names, possibly multiple names on each line, separated by ,&lt;br /&gt;
            // and say them in chat to the owner&lt;br /&gt;
            list names = llParseString2List(data,[&amp;quot;,&amp;quot;],[]); // split lines on ,&lt;br /&gt;
            integer len = llGetListLength(names); // I wouldn&#039;t dare to put this inside the for loop&lt;br /&gt;
            integer cnt;&lt;br /&gt;
            for (cnt = 0; cnt &amp;lt; len; cnt++)&lt;br /&gt;
            {&lt;br /&gt;
                string name = llDumpList2String(llParseString2List(llList2String(names,cnt),[&amp;quot; &amp;quot;],[]),&amp;quot; &amp;quot;); // remove extra spaces&lt;br /&gt;
                if (llGetListLength(llParseString2List(name,[&amp;quot; &amp;quot;],[])) == 2) // check for first + lastname&lt;br /&gt;
                    llOwnerSay(notecardname + &amp;quot;: &amp;quot; + name);&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
            getnextnotecardline();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
|also_functions={{LSL DefineRow||[[llGetNumberOfNotecardLines]]|}}&lt;br /&gt;
|also_events={{LSL DefineRow||[[dataserver]]|}}&lt;br /&gt;
|also_articles&lt;br /&gt;
|also_tests&lt;br /&gt;
|notes=The notecard read can be no modify, or no modify/no copy.&lt;br /&gt;
|permission&lt;br /&gt;
|cat1=Notecard&lt;br /&gt;
|cat2=Dataserver&lt;br /&gt;
|cat3=&lt;br /&gt;
|cat4=&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// by Randur Source&lt;br /&gt;
&lt;br /&gt;
integer inventorycnt;&lt;br /&gt;
integer notecardlinecnt;&lt;br /&gt;
integer notecardlinenumber;&lt;br /&gt;
string notecardname;&lt;br /&gt;
key linenumberid;&lt;br /&gt;
key lineid;&lt;br /&gt;
&lt;br /&gt;
getnextnotecardlinenumber()&lt;br /&gt;
{&lt;br /&gt;
    inventorycnt++;&lt;br /&gt;
    if (inventorycnt &amp;lt; llGetInventoryNumber(INVENTORY_NOTECARD))&lt;br /&gt;
    {&lt;br /&gt;
        notecardname = llGetInventoryName(INVENTORY_NOTECARD,inventorycnt);&lt;br /&gt;
        linenumberid = llGetNumberOfNotecardLines(notecardname);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
        llOwnerSay(&amp;quot;Done.&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
getnextnotecardline()&lt;br /&gt;
{&lt;br /&gt;
    notecardlinecnt++;&lt;br /&gt;
    if (notecardlinecnt &amp;lt; notecardlinenumber)&lt;br /&gt;
        lineid = llGetNotecardLine(notecardname,notecardlinecnt);&lt;br /&gt;
    else&lt;br /&gt;
        getnextnotecardlinenumber();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        if (llDetectedKey(0) != llGetOwner()) return; // owner only&lt;br /&gt;
&lt;br /&gt;
        inventorycnt = -1;&lt;br /&gt;
        getnextnotecardlinenumber();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    dataserver(key queryid,string data)&lt;br /&gt;
    {&lt;br /&gt;
        if (queryid == linenumberid)&lt;br /&gt;
        {&lt;br /&gt;
            linenumberid = NULL_KEY;&lt;br /&gt;
            notecardlinenumber = (integer)data;&lt;br /&gt;
            if (notecardlinenumber == 0)&lt;br /&gt;
                getnextnotecardlinenumber();&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                notecardlinecnt = -1;&lt;br /&gt;
                getnextnotecardline();&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        else if (queryid == lineid)&lt;br /&gt;
        {&lt;br /&gt;
            lineid = NULL_KEY;&lt;br /&gt;
            // Test for valid names, possibly multiple names on each line, separated by ,&lt;br /&gt;
            list names = llParseString2List(data,[&amp;quot;,&amp;quot;],[]); // split lines on ,&lt;br /&gt;
            integer cnt;&lt;br /&gt;
            for (cnt = 0; cnt &amp;lt; llGetListLength(names); cnt++)&lt;br /&gt;
            {&lt;br /&gt;
                string name = llDumpList2String(llParseString2List(llList2String(names,cnt),[&amp;quot; &amp;quot;],[]),&amp;quot; &amp;quot;); // remove extra spaces&lt;br /&gt;
                if (llGetListLength(llParseString2List(name,[&amp;quot; &amp;quot;],[])) == 2) // check for first + lastname&lt;br /&gt;
                    llOwnerSay(notecardname + &amp;quot;: &amp;quot; + name);&lt;br /&gt;
            }&lt;br /&gt;
            getnextnotecardline();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Topaz Emerald</name></author>
	</entry>
</feed>