llGetText
Revision as of 12:28, 13 February 2010 by David Thurman (talk | contribs) (Created page with '{{LSL_Function |func_id |mode=request |func=llGetText |sort=GetText |return_type=string |func_desc |return_text=with the content of the Text inserted with llSetText. |spec |examp...')
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
LSL Feature Request | |
The described function does not exist. This article is a feature request. |
Summary
Function: string llGetText( );REQUEST | Function ID |
Forced Delay | |
Energy |
Returns a string with the content of the Text inserted with llSetText.
Caveats
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.