[Script]Group Join Script( Not Auto)



新作ができたときファンの人に知らせるため、グループを作っておくと便利です。そのグループへのお誘いお助けツールです。自動でグループに招待するのではなく、オーナーが相手を確認後、手作業で登録するタイプです。登録希望者はタッチするだけでオーナーに知らせることができるので、手軽です。グループ加入が必要なレンタルブース運営等にも使えそうです。グループ招待だけでなく、呼び鈴など、いろいろアレンジできそうです。



integer sendIM = TRUE;


list names;
integer total;

integer menu_handler;
integer menu_channel;
menu(key user,string title,list buttons)
{
menu_channel = (integer)(llFrand(99999.0) * -1);
menu_handler = llListen(menu_channel,"","","");
llDialog(user,title,buttons,menu_channel);
llSetTimerEvent(15.0);
}

default
{
on_rez(integer r)
{
llResetScript();
}

state_entry()
{
names = [""];
total = 0;
llSetText("Touch to join our Group", <0.90196, 0.72549, 0.35294>, 1.0); //Floating Text, edit or remove
llOwnerSay("Ready... list is reset to 0.");
}

touch_start(integer num_detected)
{
integer x;
for(x;x <= num_detected- 1;x++)
{
if ( llDetectedKey(x) != llGetOwner() )
{
integer find = llListFindList(names,[llDetectedName(x)]);
if(find < 1)
{
llInstantMessage(llDetectedKey(x), "Your request has been sent. Please be patient and you will be added to the group as soon as possible."); //Message to Toucher
names = names+ [llDetectedName(x)];
total = total + 1;
if (sendIM)
{
llInstantMessage(llGetOwner(), " " + llDetectedName(x) + " has requested to be added."); //Message to Owner
}
}
else
{
llInstantMessage(llDetectedKey(x), "You've already requested to be added."); //Message to repeat Toucher
}
}
else if ( llDetectedKey(x) == llGetOwner() )
{
llOwnerSay((string)total + " people have Touched me so far!");
menu(llGetOwner(),"Please Select One",["Show List","Reset", "Turn Off"]);
}
}
}

timer()
{
llSetTimerEvent(0.0);
llListenRemove(menu_handler);
}

listen(integer channel,string name,key id,string message)
{
if (channel == menu_channel)
{
if(message == "Show List")
{
integer len = llGetListLength( names );
integer i;
for( i = 0; i < len; i++ )
{
integer a = i;
llOwnerSay((string)a + " : " + llList2String(names, i));
}
}
else if(message == "Reset")
{
llOwnerSay("Clearing List & Reseting Script now.");
llResetScript();
}
else if(message == "Turn Off")
{
llOwnerSay("Turning Off Now. Touch again to turn back On.");
state off;
}
}
}
}

state off
{
on_rez(integer r)
{
llResetScript();
}

state_entry()
{
llSetText("", <0, 0, 0>, 1.0);
}

touch_start(integer total_number)
{
if (llGetOwner())
{
llOwnerSay("Turning back On now.");
llResetScript();
}
}
}


スクリプトを写すのが面倒な人は、こちらでも配布しています。ムービーに出てくるのと同じ箱をBuyしてね。0L$です。

人魚神殿 きょうた書房
http://maps.secondlife.com/secondlife/Mermaid%20temple/92/37/22

0 コメント:

コメントを投稿