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

posted @   kkun  阅读(311)  评论(0编辑  收藏  举报
编辑推荐:
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
阅读排行:
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 提示词工程——AI应用必不可少的技术
· Open-Sora 2.0 重磅开源!
· 周边上新:园子的第一款马克杯温暖上架
点击右上角即可分享
微信分享提示