Trenza SIM

LMmapTrenza02.jpg

LSL script

// Multi TP-board

integer col=8;  // 横の分割数
integer row=8;  // 縦の分割数

list tp=[ // "テレポート先","SIM名",位置,

"K.H","Trenza",<41,214,23>,//1
"K.H","Trenza",<41,214,23>,//2
"Cafe Eagle","Trenza",<109,222,26>,//3
"Cafe Eagle","Trenza",<109,222,26>,//4

"Cafe Eagle","Trenza",<109,222,26>,//5
"Cafe Eagle","Trenza",<109,222,26>,//6
"Trenza Yacht Club","Trenza",<219,223,21>,//7
"Trenza Yacht Club","Trenza",<219,223,21>,//8

"K.H","Trenza",<41,214,23>,//9
"K.H","Trenza",<41,214,23>,//10
"Cafe Eagle","Trenza",<109,222,26>,//11
"Cafe Eagle","Trenza",<109,222,26>,//12

"Cafe Eagle","Trenza",<109,222,26>,//13
"Cafe Eagle","Trenza",<109,222,26>,//14
"Trenza Yacht Club","Trenza",<219,223,21>,//15
"Trenza Yacht Club","Trenza",<219,223,21>,//16


"PASTEL","Trenza",<62,145,21>,//17
"PASTEL","Trenza",<62,145,21>,//18
"Fuss Method","Trenza",<134,140,1502>,//19
"Fuss Method","Trenza",<134,140,1502>,//20

"Fuss Method","Trenza",<134,140,1502>,//21
"Fuss Method","Trenza",<134,140,1502>,//22
"Raki","Trenza",<208,182,22>,//23
"Raki","Trenza",<208,182,22>,//24

"Play Space Carrot","Trenza",<62,145,21>,//25
"Play Space Carrot","Trenza",<62,145,21>,//26
"Fuss Method","Trenza",<134,140,1502>,//27
"Fuss Method","Trenza",<134,140,1502>,//28

"Fuss Method","Trenza",<134,140,1502>,//29
"Fuss Method","Trenza",<134,140,1502>,//30
"Cafe Omega","Trenza",<222,92,26>,//31
"Cafe Omega","Trenza",<222,92,26>,//32


"Forest of lead","Trenza",<59,102,21>,//33
"Forest of lead","Trenza",<59,102,21>,//34
"Fuss Method","Trenza",<134,140,1502>,//35
"Fuss Method","Trenza",<134,140,1502>,//36

"Fuss Method","Trenza",<134,140,1502>,//37
"Fuss Method","Trenza",<134,140,1502>,//38
"Cafe Omega","Trenza",<222,92,26>,//39
"Cafe Omega","Trenza",<222,92,26>,//40

"Kamo-Negi Honpo","Trenza",<53,80,31>,//41
"Kamo-Negi Honpo","Trenza",<53,80,31>,//42
"Fuss Method","Trenza",<134,140,1502>,//43
"Fuss Method","Trenza",<134,140,1502>,//44

"Fuss Method","Trenza",<134,140,1502>,//45
"Fuss Method","Trenza",<134,140,1502>,//46
"Cafe Omega","Trenza",<222,92,26>,//47
"Cafe Omega","Trenza",<222,92,26>,//48


"Trenza Festival tools","Trenza",<46,28,22>,//49
"Trenza Festival tools","Trenza",<46,28,22>,//50
"Nenashigusa Nest","Trenza",<182,199,23>,//51
"Neko Hama","Trenza",<80,56,22>,//52

"Event Area","Trenza",<161,45,22>,//53
"Event Area","Trenza",<161,45,22>,//54
"Event Area","Trenza",<161,45,22>,//55
"Event Area","Trenza",<161,45,22>,//56

"Trenza Info","Trenza",<9,8,24>,//57
"Trenza Festival tools","Trenza",<46,28,22>,//58
"Nenashigusa Nest","Trenza",<182,199,23>,//59
"Neko Hama","Trenza",<103,59,21>,//60

"Event Area","Trenza",<161,45,22>,//61
"Event Area","Trenza",<161,45,22>,//62
"Event Area","Trenza",<161,45,22>,//63
"Event Area","Trenza",<161,45,22>,//64

NULL_KEY];  // データの最後のカンマ用
integer len;

string slurl(integer i)
{  // SLURL生成
    vector v=llList2Vector(tp,i+2);
    string str=llList2String(tp,i);
    // SIM名をブランクにしてるものは閉店表示
    if (llList2String(tp,i+1) == "") return str+"... closed\n";
    str+=" http://slurl.com/secondlife/";
    str+=llEscapeURL(llList2String(tp,i+1));
    str+="/"+(string)((integer)v.x);
    str+="/"+(string)((integer)v.y);
    str+="/"+(string)((integer)v.z)+" \n";
    return str;
}

map(integer num)
{  // マップ表示用
    integer i=num*3;
    if (i >= len) {  // テレポートの登録数が少ないとき
        llWhisper(0,"This area is a blank.");
        return;  // リターン
    }
    string sim=llList2String(tp,i+1);
    vector pos=llList2Vector(tp,i+2);
    if (sim) llMapDestination(sim,pos,ZERO_VECTOR);  // マップ表示
    llWhisper(0,slurl(i));  // SLURL表示
}

default
{
    state_entry()
    {
        len=llGetListLength(tp)-1;  // ヌルキーを除いたリストの長さ
    }

    touch_start(integer total_number)
    {
        integer i=llDetectedTouchFace(0);  // タッチした面の番号を取得
        if (i != -1) { // SLビューワーが対応のとき
            vector v=llDetectedTouchST(0);  // タッチした表面の座標
            i=llFloor(v.x*col)+(row-llCeil(v.y*row))*col;  // 座標を番号に変換
            map(i);  // mapへ
        }
        else { // SLビューワーが非対応だったらSLURLを全部表示
            string str="Open the chat histry and click the SLURL.\n";
            for (i=0; i < len; i+=3) str+=slurl(i);
            llWhisper(0,str);  // チャットでSLURL表示
        }
    }
}

  • 最終更新:2012-03-22 11:02:53

このWIKIを編集するにはパスワード入力が必要です

認証パスワード