OsGetNotecardLine

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
Line 3: Line 3:
 
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:  
 
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:  
  
<br> ''From OSSL_Api.cs:''  
+
''From OSSL_Api.cs:''  
<blockquote>"due to the synchronous method this function uses to fetch assets, its use may be dangerous and unreliable while running in grid mode."</blockquote>
+
:::"due to the synchronous method this function uses to fetch assets, its use may be dangerous and unreliable while running in grid mode."
  
 
+
<source lang="lsl">
<code><pre>//Example usage:
+
//Example usage:
 
default {
 
default {
 
     state_entry() {
 
     state_entry() {
Line 17: Line 17:
 
     }
 
     }
 
}
 
}
</pre></code>
+
</source>
  
  
  
 
[[Category:OSSL]]
 
[[Category:OSSL]]

Revision as of 17:30, 5 June 2011

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&lt;=osGetNumberOfNotecardLines(notecard); i++) {
            llSay(0, osGetNotecardLine(notecard, i));
        }
    }
}
Personal tools
General
About This Wiki