helloworld program of Linden Scripting Language

Code
default
{
    state_entry()
    {
               
// llResetScript();
        llListen(0,"","","");
        
// listens for just the owner, on channel 0
    }

    listen(integer chan, 
string name, key id, string mess)
    {
        
if(mess == "hello"){
           llOwnerSay(
"hello world!");
           llOwnerSay((
string)id);
           llOwnerSay(name);
           llOwnerSay((
string)chan);
        }
    }
}

sit for teleport script

Code
vector target=<17,17,129>// Enter the target coordinates here!!! 
default 

    state_entry() 
    { 
        llSetText(
"talking in the sky",<255,255,255>,5); 
        llSetSitText(
"Teleport"); 
        rotation my_rot
=llGetRot(); 
        llSitTarget((target 
- llGetPos()) / my_rot,ZERO_ROTATION / my_rot); 
    } 
    changed(integer change) 
    { 
        llUnSit(llAvatarOnSitTarget()); 
    } 

 简单的单词查询功能

Code
key url;
default
{
    state_entry()
    {
        llListen(
1,"",NULL_KEY,"");
    }
    
    touch_start(integer totalnums){
        llOwnerSay(
"type the unfamilar words here for translate.For example:");
        llOwnerSay(
"/1 hello"); 
    }
    
    listen( integer channel, 
string name, key id, string message )
    {
        
//llOwnerSay(message);
        
//url = llHTTPRequest("http://dict.cn/mini.php?q=" + message + "&utf8=true",[],"");
        
//llWhisper(0,message);
        url = llHTTPRequest("http://tstring.com.cn/dict.aspx?q="+llEscapeURL(message)+"&o=korn",[],"");
        
//llWhisper(0,"http://tstring.com.cn/dict.aspx?q="+ message);
    }
    
    http_response(key request_id, integer status, list metadata, 
string body)
    {
        
if (request_id == url);
        {
            
//llOwnerSay((string)status);
            llOwnerSay(body);
        }
    }
}

http://oz.slinked.net/history/lsl2_reference.htm

http://lslwiki.net/lslwiki/wakka.php?wakka=glossary

原文地址:https://www.cnblogs.com/kkun/p/1577720.html