02-18-2013, 02:28 AM
list givenList;
list GroupKey;
//you can config this
string LM = "Service";
string NOTECARDS = "Note";
float sensorRange = 5;
//list MENU_MAIN = ["Note","Landmark"];
list MENU_MAIN = ["Group","Note","Landmark"];
//---end config
integer CHANNEL = 106;
default
{
state_entry()
{
llSensorRepeat("", NULL_KEY, AGENT, sensorRange, TWO_PI, 10);
llListen(CHANNEL, "", NULL_KEY, "");
GroupKey = llGetObjectDetails(llGetKey(), [OBJECT_GROUP]);
}
on_rez(integer param)
{
llResetScript();
}
sensor(integer num_detected)
{
integer x;
key detectedKey;
for (x=0; x < num_detected; x += 1)
{
detectedKey = llDetectedKey(x);
if (llListFindList(givenList, [detectedKey]) < 0)
{
givenList += llDetectedKey(x);
llSay(0, "Welcome " + llDetectedName(0));
llDialog(llDetectedKey(0), "Which info would you like?", MENU_MAIN, CHANNEL);
// you can config it's the number of ppl it remember before it will send you again a blue box if you wish it give to you all time a blue box put the valur 10 to 1
if (llGetListLength(givenList) >= 10)
{
givenList = llDeleteSubList(givenList, 0, 59);
}
}
}
}
listen(integer channel, string name, key id, string message)
{
if (llListFindList(MENU_MAIN, [message]) != -1)
{
if (message == "Landmark")
{
llGiveInventory(id, LM);
llSleep(5);
llDialog(id, "Which info would you like?", MENU_MAIN, CHANNEL);
}
else if (message == "Note")
{
llGiveInventory(id, NOTECARDS);
llSleep(5);
llDialog(id, "Which info would you like?", MENU_MAIN, CHANNEL);
}
else if (message == "Group")
{
llSay(0, "Open history (Ctrl-H), then click the following link to join the group: secondlife:///app/group/" + (string)GroupKey + "/about");
llSleep(5);
llDialog(id, "Which info would you like?", MENU_MAIN, CHANNEL);
}
}
else
llSay(0, name + " picked invalid option '" + llToLower(message) + "'.");
}
}
list GroupKey;
//you can config this
string LM = "Service";
string NOTECARDS = "Note";
float sensorRange = 5;
//list MENU_MAIN = ["Note","Landmark"];
list MENU_MAIN = ["Group","Note","Landmark"];
//---end config
integer CHANNEL = 106;
default
{
state_entry()
{
llSensorRepeat("", NULL_KEY, AGENT, sensorRange, TWO_PI, 10);
llListen(CHANNEL, "", NULL_KEY, "");
GroupKey = llGetObjectDetails(llGetKey(), [OBJECT_GROUP]);
}
on_rez(integer param)
{
llResetScript();
}
sensor(integer num_detected)
{
integer x;
key detectedKey;
for (x=0; x < num_detected; x += 1)
{
detectedKey = llDetectedKey(x);
if (llListFindList(givenList, [detectedKey]) < 0)
{
givenList += llDetectedKey(x);
llSay(0, "Welcome " + llDetectedName(0));
llDialog(llDetectedKey(0), "Which info would you like?", MENU_MAIN, CHANNEL);
// you can config it's the number of ppl it remember before it will send you again a blue box if you wish it give to you all time a blue box put the valur 10 to 1
if (llGetListLength(givenList) >= 10)
{
givenList = llDeleteSubList(givenList, 0, 59);
}
}
}
}
listen(integer channel, string name, key id, string message)
{
if (llListFindList(MENU_MAIN, [message]) != -1)
{
if (message == "Landmark")
{
llGiveInventory(id, LM);
llSleep(5);
llDialog(id, "Which info would you like?", MENU_MAIN, CHANNEL);
}
else if (message == "Note")
{
llGiveInventory(id, NOTECARDS);
llSleep(5);
llDialog(id, "Which info would you like?", MENU_MAIN, CHANNEL);
}
else if (message == "Group")
{
llSay(0, "Open history (Ctrl-H), then click the following link to join the group: secondlife:///app/group/" + (string)GroupKey + "/about");
llSleep(5);
llDialog(id, "Which info would you like?", MENU_MAIN, CHANNEL);
}
}
else
llSay(0, name + " picked invalid option '" + llToLower(message) + "'.");
}
}