//start_unprocessed_text
/*/|/|/|/|/|/|/|/|/|/|/|/|/|/|/|/|/|/|/|/|/|/|/|/|/|/|/|/|/|/|/|/|/
/|/ New Age Tail Click Script
/|/ By Asia Snowfall
/|/ Version 1.0
/|/|/|/|/|/|/|/|/|/|/|/|/|/|/|/|/|/|/|/|/|/|/|/|/|/|/|/|/|/|/|/|/
string announce_type = "say";
/|/ Replace say with either;
/|/ "shout" = to shout out messages
/|/ "whisper" = to whisper the messages
float seconds_till_menu_timeout = 30;
list buttons = [
"Hug",
"Stroke",
"Tug",
"Play",
"Stroke"
];
list messages = [
"<users_first_name> picks up <owners_first_name>'s tail and hugs it gently",
"<users_first_name> gently strokes their fingers through <owners_first_name>'s tail",
"<users_first_name> gently tugs <owners_first_name>'s tail to get her attention.",
"<users_first_name> bats around playfuly at <owners_first_name>'s tail.",
"<users_first_name> gently strokes <owners_first_name>'s tail."
];
string menu_text = "<owners_first_name>'s Tail Menu\nWhat do you want to do with my tail <users_first_name>?";
/|/ Message Tags;
/|/ <users_first_name> = Person clicking the button's first name will appear there
/|/ <users_last_name> = Person clicking the button's last name will appear there
/|/ <owners_first_name> = Tail owners first name will appear there
/|/ <owners_last_name> = Tail owners last name will appear there
integer chan;
integer hand;
asMenuSetup(key id)
{
llListenRemove(hand);
chan = llRound(llFrand(99999)+10);
hand = llListen(chan, "", id, "");
if(llGetListLength(buttons) > 12)
{
llOwnerSay("Error: There is more than 12 options, please reduce the ammount");
}
else
{
llDialog(id, asTagScan(menu_text, id), buttons, chan);
}
}
asCheckSelected(string message, key id)
{
llListenRemove(hand);
integer index = llListFindList(buttons, [message]);
if(index != -1)
{
if(llToLower(announce_type) == "say")
{
llSay(0, asTagScan(llList2String(messages, index), id));
}
else if(llToLower(announce_type) == "shout")
{
llShout(0, asTagScan(llList2String(messages, index), id));
}
else
{
llWhisper(0, asTagScan(llList2String(messages, index), id));
}
}
}
string asTagScan(string message, key user)
{
integer ufn = llStringLength("<users_first_name>")-1;
integer uln = llStringLength("<users_last_name>")-1;
integer ofn = llStringLength("<owners_first_name>")-1;
integer oln = llStringLength("<owners_last_name>")-1;
list parse = llParseString2List(llGetDisplayName(user), [" "], []);
string user_first_name = llList2String(parse, 0);
string user_last_name = llList2String(parse, 1);
parse = llParseString2List(llGetDisplayName(llGetOwner()), [" "], []);
string owner_first_name = llList2String(parse, 0);string owner_last_name = llList2String(parse, 1);integer ind;integer ind2;integer own;integer own2;integer done = FALSE;
do
{
@recheck;
ind = llSubStringIndex(message, "<users_first_name>");
ind2 = llSubStringIndex(message, "<users_last_name>");
own = llSubStringIndex(message, "<owners_first_name>");
own2 = llSubStringIndex(message, "<owners_last_name>");
if(ind != -1)
{
message = llDeleteSubString(message, ind, (ind+ufn));
message = llInsertString(message, ind, user_first_name);
jump recheck;
}
else if(ind2 != -1)
{
message = llDeleteSubString(message, ind2, (ind2+uln));
message = llInsertString(message, ind2, user_last_name);
jump recheck;
}
else if(own != -1)
{
message = llDeleteSubString(message, own, (own+ofn));
message = llInsertString(message, own, owner_first_name);
jump recheck;
}
else if(own2 != -1)
{
message = llDeleteSubString(message, own2, (own2+oln));
message = llInsertString(message, own2, owner_last_name);
jump recheck;
}
else if(ind == -1 && ind2 == -1 && own == -1 && own2 == -1)
{
done = TRUE;
}
}while(done < FALSE);
return message;
}
default
{
touch_start(integer x)
{
asMenuSetup(llDetectedKey(0));
llSetTimerEvent(seconds_till_menu_timeout);
}
listen(integer channel, string name, key id, string str)
{
asCheckSelected(str, id);
}
timer()
{
llListenRemove(hand);
llSetTimerEvent(0);
}
}*/
//end_unprocessed_text
//nfo_preprocessor_version 0
//program_version Firestorm-Betax64 4.7.1.45325 - Loufgar Frostbite
//mono
string announce_type = "say";
float seconds_till_menu_timeout = 30;
list buttons = [
"Hug",
"Stroke",
"Tug",
"Play",
"Stroke"
];
list messages = [
"<users_first_name> picks up <owners_first_name>'s tail and hugs it gently",
"<users_first_name> gently strokes their fingers through <owners_first_name>'s tail",
"<users_first_name> gently tugs <owners_first_name>'s tail to get her attention.",
"<users_first_name> bats around playfuly at <owners_first_name>'s tail.",
"<users_first_name> gently strokes <owners_first_name>'s tail."
];
string menu_text = "<owners_first_name>'s Tail Menu\nWhat do you want to do with my tail <users_first_name>?";
integer chan;
integer hand;
string asTagScan(string message, key user)
{
integer ufn = llStringLength("<users_first_name>")-1;
integer uln = llStringLength("<users_last_name>")-1;
integer ofn = llStringLength("<owners_first_name>")-1;
integer oln = llStringLength("<owners_last_name>")-1;
list parse = llParseString2List(llGetDisplayName(user), [" "], []);
string user_first_name = llList2String(parse, 0);
string user_last_name = llList2String(parse, 1);
parse = llParseString2List(llGetDisplayName(llGetOwner()), [" "], []);
string owner_first_name = llList2String(parse, 0);string owner_last_name = llList2String(parse, 1);integer ind;integer ind2;integer own;integer own2;integer done = FALSE;
do
{
@recheck;
ind = llSubStringIndex(message, "<users_first_name>");
ind2 = llSubStringIndex(message, "<users_last_name>");
own = llSubStringIndex(message, "<owners_first_name>");
own2 = llSubStringIndex(message, "<owners_last_name>");
if(ind != -1)
{
message = llDeleteSubString(message, ind, (ind+ufn));
message = llInsertString(message, ind, user_first_name);
jump recheck;
}
else if(ind2 != -1)
{
message = llDeleteSubString(message, ind2, (ind2+uln));
message = llInsertString(message, ind2, user_last_name);
jump recheck;
}
else if(own != -1)
{
message = llDeleteSubString(message, own, (own+ofn));
message = llInsertString(message, own, owner_first_name);
jump recheck;
}
else if(own2 != -1)
{
message = llDeleteSubString(message, own2, (own2+oln));
message = llInsertString(message, own2, owner_last_name);
jump recheck;
}
else if(ind == -1 && ind2 == -1 && own == -1 && own2 == -1)
{
done = TRUE;
}
}while(done < FALSE);
return message;
}
asMenuSetup(key id)
{
llListenRemove(hand);
chan = llRound(llFrand(99999)+10);
hand = llListen(chan, "", id, "");
if(llGetListLength(buttons) > 12)
{
llOwnerSay("Error: There is more than 12 options, please reduce the ammount");
}
else
{
llDialog(id, asTagScan(menu_text, id), buttons, chan);
}
}
asCheckSelected(string message, key id)
{
llListenRemove(hand);
integer index = llListFindList(buttons, [message]);
if(index != -1)
{
if(llToLower(announce_type) == "say")
{
llSay(0, asTagScan(llList2String(messages, index), id));
}
else if(llToLower(announce_type) == "shout")
{
llShout(0, asTagScan(llList2String(messages, index), id));
}
else
{
llWhisper(0, asTagScan(llList2String(messages, index), id));
}
}
}
default
{
touch_start(integer x)
{
asMenuSetup(llDetectedKey(0));
llSetTimerEvent(seconds_till_menu_timeout);
}
listen(integer channel, string name, key id, string str)
{
asCheckSelected(str, id);
}
timer()
{
llListenRemove(hand);
llSetTimerEvent(0);
}
}