Trenza Cafe SIM

LMmapTrenzacafe02.jpg

LSL script

// Multi TP-board

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

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

"Trenza Info","Trenza Cafe",<13,240,24>,//1
"Trenza Info","Trenza Cafe",<13,240,24>,//2
"Sleeping Koala","Trenza Cafe",<104,215,499>,//3
"Sleeping Koala","Trenza Cafe",<104,215,499>,//4

"Cafe Andromeda","Trenza Cafe",<228,192,21>,//5
"Cafe Andromeda","Trenza Cafe",<228,192,21>,//6
"Cafe Andromeda","Trenza Cafe",<228,192,21>,//7
"Cafe Andromeda","Trenza Cafe",<228,192,21>,//8

"Trenza Info","Trenza Cafe",<13,240,24>,//9
"Trenza Info","Trenza Cafe",<13,240,24>,//10
"Sleeping Koala","Trenza Cafe",<104,215,499>,//11
"Sleeping Koala","Trenza Cafe",<104,215,499>,//12

"Cafe Andromeda","Trenza Cafe",<228,192,21>,//13
"Cafe Andromeda","Trenza Cafe",<228,192,21>,//14
"Cafe Andromeda","Trenza Cafe",<228,192,21>,//15
"Cafe Andromeda","Trenza Cafe",<228,192,21>,//16


"La Pomodorina","Trenza Cafe",<55,157,22>,//17
"La Pomodorina","Trenza Cafe",<55,157,22>,//18
"CASSL(Cafe Andromeda School of SL)","Trenza Cafe",<74,164,22>,//19
"CASSL(Cafe Andromeda School of SL)","Trenza Cafe",<74,164,22>,//20

"Cafe Andromeda","Trenza Cafe",<228,192,21>,//21
"Cafe Andromeda","Trenza Cafe",<228,192,21>,//22
"Cafe Andromeda","Trenza Cafe",<228,192,21>,//23
"Cafe Andromeda","Trenza Cafe",<228,192,21>,//24

"La Pomodorina","Trenza Cafe",<55,157,22>,//25
"La Pomodorina","Trenza Cafe",<55,157,22>,//26
"CASSL(Cafe Andromeda School of SL)","Trenza Cafe",<74,164,22>,//27
"CASSL(Cafe Andromeda School of SL)","Trenza Cafe",<74,164,22>,//28

"Cafe Andromeda","Trenza Cafe",<228,192,21>,//29
"Cafe Andromeda","Trenza Cafe",<228,192,21>,//30
"Cafe Andromeda","Trenza Cafe",<228,192,21>,//31
"Cafe Andromeda","Trenza Cafe",<228,192,21>,//32


"Moooooo!","Trenza Cafe",<62,96,22>,//33
"Moooooo!","Trenza Cafe",<62,96,22>,//34
"Cafe Andromeda","Trenza Cafe",<228,192,21>,//35
"Cafe Andromeda","Trenza Cafe",<228,192,21>,//36

"Cafe Andromeda","Trenza Cafe",<228,192,21>,//37
"Cafe Andromeda","Trenza Cafe",<228,192,21>,//38
"Cafe Andromeda","Trenza Cafe",<228,192,21>,//39
"Cafe Andromeda","Trenza Cafe",<228,192,21>,//40

"Cafe Andromeda","Trenza Cafe",<228,192,21>,//41
"Cafe Andromeda","Trenza Cafe",<228,192,21>,//42
"A&M","Trenza Cafe",<133,69,22>,//43
"A&M","Trenza Cafe",<133,69,22>,//44

"Cafe Pleiades","Trenza Cafe",<212,39,24>,//45
"Cafe Pleiades","Trenza Cafe",<212,39,24>,//46
"Cafe Pleiades","Trenza Cafe",<212,39,24>,//47
"Cafe Pleiades","Trenza Cafe",<212,39,24>,//48


"Cafe Andromeda","Trenza Cafe",<228,192,21>,//49
"Cafe Andromeda","Trenza Cafe",<228,192,21>,//50
"A&M","Trenza Cafe",<133,69,22>,//51
"A&M","Trenza Cafe",<133,69,22>,//52

"Cafe Pleiades","Trenza Cafe",<212,39,24>,//53
"Cafe Pleiades","Trenza Cafe",<212,39,24>,//54
"Cafe Pleiades","Trenza Cafe",<212,39,24>,//55
"Cafe Pleiades","Trenza Cafe",<212,39,24>,//56

"Cafe Andromeda","Trenza Cafe",<228,192,21>,//57
"Cafe Andromeda","Trenza Cafe",<228,192,21>,//58
"Cafe Pleiades","Trenza Cafe",<212,39,24>,//59
"Cafe Pleiades","Trenza Cafe",<212,39,24>,//60

"Cafe Pleiades","Trenza Cafe",<212,39,24>,//61
"Cafe Pleiades","Trenza Cafe",<212,39,24>,//62
"Cafe Pleiades","Trenza Cafe",<212,39,24>,//63
"Cafe Pleiades","Trenza Cafe",<212,39,24>,//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:04:08

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

認証パスワード