HandG SIM(Shopping Mall)

LMmapHandG02.jpg

LSL script

// Multi TP-board

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

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

"H&G Info","HandG",<145,128,20>,//1
"G3","HandG",<75,241,24>,//2
"G3","HandG",<75,241,24>,//3
"G3","HandG",<75,241,24>,//4

"Batata","HandG",<178,239,24>,//5
"Batata","HandG",<178,239,24>,//6
"Batata","HandG",<178,239,24>,//7
"H&G Info","HandG",<145,128,20>,//8

"H&G Info","HandG",<145,128,20>,//9
"H&G Info","HandG",<145,128,20>,//10
"H&G Info","HandG",<145,128,20>,//11
"H&G Info","HandG",<145,128,20>,//12

"H&G Info","HandG",<145,128,20>,//13
"H&G Info","HandG",<145,128,20>,//14
"H&G Info","HandG",<145,128,20>,//15
"H&G Info","HandG",<145,128,20>,//16


"H&G Info","HandG",<145,128,20>,//17
"H&G Info","HandG",<145,128,20>,//18
"H&G Info","HandG",<145,128,20>,//19
"H&G Info","HandG",<145,128,20>,//20

"H&G Info","HandG",<145,128,20>,//21
"Wa","HandG",<189,194,21>,//22
"Haturatu Honpo","HandG",<202,163,21>,//23
"H&G Info","HandG",<145,128,20>,//24

"H&G Info","HandG",<145,128,20>,//25
"H&G Info","HandG",<145,128,20>,//26
"H&G Info","HandG",<145,128,20>,//27
"H&G Info","HandG",<145,128,20>,//28

"H&G Info","HandG",<145,128,20>,//29
"H&G Info","HandG",<145,128,20>,//30
"H&G Info","HandG",<145,128,20>,//31
"H&G Info","HandG",<145,128,20>,//32

"H&G Info","HandG",<145,128,20>,//33
"H&G Info","HandG",<145,128,20>,//34
"H&G Info","HandG",<145,128,20>,//35
"H&G Info","HandG",<145,128,20>,//36

"H&G Info","HandG",<145,128,20>,//37
"H&G Info","HandG",<145,128,20>,//38
"H&G Info","HandG",<145,128,20>,//39
"H&G Info","HandG",<145,128,20>,//40

"H&G Info","HandG",<145,128,20>,//41
"H&G Info","HandG",<145,128,20>,//42
"H&G Info","HandG",<145,128,20>,//43
"H&G Info","HandG",<145,128,20>,//44

"H&G Info","HandG",<145,128,20>,//45
"H&G Info","HandG",<145,128,20>,//46
"H&G Info","HandG",<145,128,20>,//47
"H&G Info","HandG",<145,128,20>,//48


"H&G Info","HandG",<145,128,20>,//49
"CACTUS","HandG",<52,60,21>,//50
"H&G Info","HandG",<145,128,20>,//51
"H&G Info","HandG",<145,128,20>,//52

"H&G Info","HandG",<145,128,20>,//53
"X dimension","HandG",<188,52,21>,//54
"Mikan","HandG",<202,52,21>,//55
"H&G Info","HandG",<145,128,20>,//56

"H&G Info","HandG",<145,128,20>,//57
"H&G Info","HandG",<145,128,20>,//58
"H&G Info","HandG",<145,128,20>,//59
"H&G Info","HandG",<145,128,20>,//60

"H&G Info","HandG",<145,128,20>,//61
"H&G Info","HandG",<145,128,20>,//62
"H&G Info","HandG",<145,128,20>,//63
"H&G Info","HandG",<145,128,20>,//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:51

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

認証パスワード