Difference between revisions of "FALSE"
Jump to navigation
Jump to search
Kireji Haiku (talk | contribs) m (some readability improvements) |
Omei Qunhua (talk | contribs) (The last edit made complete nonsense of the original example.) |
||
Line 8: | Line 8: | ||
integer is_owner(key inputKey) | integer is_owner(key inputKey) | ||
{ | { | ||
if (inputKey == llGetOwner() ) | |||
if (inputKey == | |||
return TRUE; | return TRUE; | ||
// else | // else | ||
Line 21: | Line 19: | ||
{ | { | ||
key id = llDetectedKey(0); | key id = llDetectedKey(0); | ||
if ( is_owner(id) ) | if ( is_owner(id) ) | ||
llSay( | llSay(0, "Hello, you're my owner!"); | ||
else | else | ||
llSay( | llSay(0, "Hello, you're not my owner!"); | ||
} | } | ||
} | } | ||
</lsl> | </lsl> | ||
<lsl> | <lsl> | ||
default | default | ||
{ | { | ||
state_entry() | state_entry() | ||
{ | { | ||
integer | integer q = TRUE; | ||
if(q) | |||
if( | |||
{ | { | ||
llSay(0, "TRUE"); | |||
q = FALSE; | |||
if(!q) | |||
if(! | |||
{ | { | ||
llSay(0, "FALSE"); | |||
q = TRUE; | |||
if(!q) | |||
llSay(0, "Won't say this."); | |||
else | else | ||
{ | { | ||
llSay(0, "TRUE"); | |||
q = FALSE; | |||
if(q) | |||
llSay(0, "Won't say this."); | |||
else | else | ||
llSay(0, "FALSE"); | |||
} | } | ||
} | } | ||
else | else | ||
llSay(0, "Won't say this."); | |||
} | } | ||
else | else | ||
llSay(0, "Won't say this."); | |||
} | } | ||
} | } |
Revision as of 04:29, 19 January 2013
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Caveats
Examples
<lsl> integer is_owner(key inputKey) {
if (inputKey == llGetOwner() ) return TRUE;
// else
return FALSE;
}
default {
touch_start(integer num_detected) { key id = llDetectedKey(0);
if ( is_owner(id) ) llSay(0, "Hello, you're my owner!"); else llSay(0, "Hello, you're not my owner!"); }
} </lsl> <lsl> default {
state_entry() { integer q = TRUE; if(q) { llSay(0, "TRUE"); q = FALSE; if(!q) { llSay(0, "FALSE"); q = TRUE; if(!q) llSay(0, "Won't say this.");
else { llSay(0, "TRUE"); q = FALSE; if(q) llSay(0, "Won't say this.");
else llSay(0, "FALSE"); } } else llSay(0, "Won't say this."); } else llSay(0, "Won't say this."); }
} </lsl>