Difference between revisions of "LlEval"

From Second Life Wiki
Jump to navigation Jump to search
Line 1: Line 1:




Line 7: Line 8:
== It would be great to execute outsourced Code where stored in a string. ==
== It would be great to execute outsourced Code where stored in a string. ==


integer llEval(string code); - Should return NULL, TRUE or FALSE
integer llEval(string code); - Should return -1, 0, 1




llEval() returns NULL  unless return is called in the evaluated code, in which case the value passed to return is returned. If there is a parse error in the evaluated code, llEval()  returns FALSE and execution of the following code continues normally.
llEval() returns "0" unless return is called in the evaluated code, in which case the value passed to return is returned. If there is a parse error in the evaluated code, llEval()  returns "-1" and execution of the following code continues normally.


Why ?
Why ?

Revision as of 11:13, 23 March 2010




It would be great to execute outsourced Code where stored in a string.

integer llEval(string code); - Should return -1, 0, 1


llEval() returns "0" unless return is called in the evaluated code, in which case the value passed to return is returned. If there is a parse error in the evaluated code, llEval() returns "-1" and execution of the following code continues normally.

Why ?

The first answer is : Make sure you can update your items everytime.

Second answer: Prevent Copybots from stealing your code

Third answer: Use minimal Disk usage on LL-Servers for LSL-Code ;)

Fourth ...


OutSourced Code (Notecard, external Homepage, ...) : <php> <?php $test = $_GET['vari']; echo urlencode("llSetText(\"Hello $test\",<1,1,1>,1); llOwnerSay(\"Thanks for your attention\");"); ?> </php>

...and the inworld code :

<lsl> key http_request_id;

default {

   state_entry()
   {
       http_request_id = llHTTPRequest("http://my.testdomain.lan?vari=ANSI%20Soderstrom", [], "");
   }

   http_response(key request_id, integer status, list metadata, string body)
   {
       if (request_id == http_request_id && status == 200)
       {
           if(llEval(llUnescapeURL(body))) {
              llOwnerSay("Back to normal Operations...");
           }
           return;
       } 
       llOwnerSay("Something goes wrong...");
   }

} </lsl>

See and Vote for this : SVC-1671