OsGetNotecardLine: Difference between revisions

From OpenSimulator
Jump to navigationJump to search
imported>ZauberExonar
No edit summary
imported>Fritigern
No edit summary
Line 19: Line 19:
</pre></code>
</pre></code>


--[[User:ZauberExonar|ZauberExonar]] 08:20, 5 February 2010 (UTC)
 
 
[[Category:OSSL]]

Revision as of 16:44, 19 November 2010

osGetNotecardLine(string name, integer line)

This function directly reads a line of text from the specified notecard, if it exists within the task inventory, and returns the text as a string. It skips the dataserver event, thereby reducing code complexity. This function has a threat level of Very High:


From OSSL_Api.cs:

"due to the synchronous method this function uses to fetch assets, its use may be dangerous and unreliable while running in grid mode."


//Example usage:
default {
    state_entry() {
        integer i;
        string notecard = llGetInventoryName(INVENTORY_NOTECARD, 0);
        for(i=1; i<=osGetNumberOfNotecardLines(notecard); i++) {
            llSay(0, osGetNotecardLine(notecard, i));
        }
    }
}