llGetText

From Second Life Wiki
Revision as of 13:59, 13 February 2010 by Strife Onizuka (talk | contribs)
Jump to navigation Jump to search
Emblem-important-yellow.png LSL Feature Request
The described function does not exist. This article is a feature request.

Summary

Function: string llGetText( );

Returns a string with the content of the Text inserted with llSetText.

Examples

<lsl> //Script that count the times touched //Author: David Thurman integer counter; default { touch_end(integer i) { integer data = (integer)llGetText(); counter = data + 1; llSetText((string)counter, <1,0,1>,1); } } </lsl>

<lsl> //Script that count the amount of money donated: //Author: David Thurman string text; default {

   state_entry()
   {
       llRequestPermissions(llGetOwner(), PERMISSION_DEBIT);
   }
   run_time_permissions(integer perm)
   {
       if(perm & PERMISSION_DEBIT)
           state cash;
   }

}

state cash {

   money(key id, integer amount)
   {        
     text = llGetText(); //this text is preformated as seen in the llSetText below.
     integer balance = (integer)llGetSubString(text, 25, -1); //Extract the value of the previus balance from the text.
     integer total = balance + amount; //Add the balance with the amount of money donated
     llSetText("Total of money donated: L$" + (string)total, <1,0,1>,1); //Update the Text with the new total.
   }

}

</LSL>

Notes

The link for the related Jira is this: Jira for llGetText.

Deep Notes

Search JIRA for related Issues

Signature

//function string llGetText();