Jump to content

Neko Tail Script


Shymus Roffo
 Share

You are about to reply to a thread that has been inactive for 3193 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

A script for a neko tail can also be used for the ears needs to be edited.

list list_one = ["Tuggies","Nibble","Play","Stroke","Tease","Love"];
string owner;
integer lock = FALSE;
integer listn;
integer rand;
integer chan;
default
{
    attach(key n)
    {
        llResetScript();
    }
    
    on_rez(integer n)
    {
        llResetScript();
    }
    state_entry()
    {
        chan = 100 + (integer)llFrand(20000);
        owner = llKey2Name(llGetOwner());
        llListen(chan,"","","");
    }

    touch_start(integer total_number)
    {
        key dk = llDetectedKey(0);
        if(dk == llGetOwner())
        {
            llDialog(dk,"Change tail option,",["lock","unlock","Edit","Edit","Edit","Edit"],chan);
        } else if(lock == FALSE){
            llDialog(dk,"What u want to do with "+owner+"'s tail",list_one,chan);
        } else {
            llInstantMessage(dk,"This tail is locked >.>");
        }
    }
    
    listen(integer c, string n, key i, string m)
    {
        //Owner Tail Commands
        if(m == "lock")
        {
            lock = TRUE;
            llOwnerSay("Locked");
        }
        if(m == "unlock")
        {
            lock = FALSE;
            llOwnerSay("Unlocked");
        }
        //Owner Events
        
        if(m == "Edit")//<-----Edit------
        {
            llSay(0, "  " + owner + " ");
        }
         
        if(m == "Edit")//<----Edit-------
        {
            llSay(0, "  " +owner+ " ");
        }
        if(m == "Edit")//<----Edit-------
        {
            llSay(0, "  " +owner+ " ");
        }
         
        if(m == "Edit")//<----Edit-------
        {
            llSay(0, "  " +owner+ " ");
        }
        // Non-Owner Events
        if(m == "Tuggies")
        {
            llSay(0, " "+n + " gently tugs " + owner + "'s tail, wanting their attention.");
        }
        if(m == "Nibble")
        {
            llSay(0, " "+n + " softly nibbles on " + owner + "'s tail. Listen to their toes crack!");
        }
        if(m == "Love")//<------Edit------
        {
            llSay(0," "+n + " loves " + owner + "'s tail, softly suckling on it much to " + owner + "'s delight!");
        }
        if(m == "Play")
        {
            llSay(0," "+n + " plays with " + owner + "'s tail, gently massaging it to " + owner + "'s delight.");
        }
        if(m == "Stroke")
        {
            llSay(0," "+n + " strokes " + owner + "'s tail, making them murr.");
        }
        if(m == "Tease")
        {
            llSay(0," "+n + " teases " + owner + "'s tail, just barely rubbing the very edge to make them squeal!");
        }
        if(m == "")//<-----Edit-------
        {
            llSay(0," "+n + "  " + owner + "'s  ");
        }
        if(m == "")//<-----Edit-------
        {
            llSay(0," "+n + "  " + owner + "'s ");
        }
        if(m == "")//<-----Edit-------
        {
            llSay(0," "+n + "  " + owner + "'s ");
        }
    }
}

 

  • Like 1
Link to comment
Share on other sites

Nice start.  :smileywink:

Here are a couple of things to think about as you add bells and whistles:

(1) If a user prompts a dialog box but never clicks a button, it will stay open forever, potentially blocking other script actions.  The common way to beat that problem is to start a timer when the touch_start event begins and then use the timer to close the listen handler if there's no response from the user in a reasonable time.  That also keeps you from having a listen handler open unnecessarily when nobody is activating your device.

(2) You can use more sophisticated methods to handle the dialog responses, potentially making them easy to expand in the future too.  One way might be to define a new strided global list:

list list_two = [" gently tugs ","'s tail, wanting their attention."]+
[ " softly nibbles on ","'s tail. Listen to their toes crack!"]+
[" loves ","'s tail, softly suckling on it!"]+
[" plays with ","'s tail, gently massaging it."]+
[" strokes ","'s tail, making them murr."]+
[" teases ","'s tail, just barely rubbing the very edge to make them squeal!"];

 I separated the individual responses for clarity here, but that can be written as a single long list.  Then, in the listen event, you can write something like this

 

if (~(channel = llListFindList( list_one,[m]))){    llSay(0,  n + llList2String(list_two,2*channel)  + owner + llList2String(list_two,(2*channel)+1) );}

 

Link to comment
Share on other sites

Check for typos. They're insidious.  :=p

Here's a version of what could be done .....

list list_one = ["Tuggies","Nibble","Play","Stroke","Tease","Love"];list list_two = [" gently tugs ","'s tail, wanting their attention."]+[ " softly nibbles on ","'s tail. Listen to their toes crack!"]+[" plays with ","'s tail, gently massaging it."]+[" strokes ","'s tail, making them murr."]+[" teases ","'s tail, just barely rubbing the very edge to make them squeal!"]+[" loves ","'s tail, softly suckling on it!"];string owner;integer lock = FALSE;integer chan;integer Lisn;default{    attach(key n)    {        llResetScript();    }        on_rez(integer n)    {        llResetScript();    }    state_entry()    {        chan = 100 + (integer)llFrand(20000);        owner = llKey2Name(llGetOwner());    }    touch_start(integer total_number)    {        llSetTimerEvent(15.0);        Lisn = llListen(chan,"","","");        key dk = llDetectedKey(0);        if(dk == llGetOwner())        {            llDialog(dk,"Change tail option,",["lock","unlock","Edit",],chan);        } else if(lock == FALSE){            llDialog(dk,"What u want to do with "+owner+"'s tail",list_one,chan);        } else {            llInstantMessage(dk,"This tail is locked >.>");        }    }        listen(integer c, string n, key i, string m)    {        //Owner Tail Commands        if(m == "lock")        {            lock = TRUE;	    llOwnerSay("Locked");        }        else if(m == "unlock")        {            lock = FALSE;	    llOwnerSay("Unlocked");        }        //Owner Events                else if(m == "Edit")//<-----Edit------        {            llSay(0, "This option is not being used for anything, but you could put something here");        }        // Non-Owner Events	else if (~(c = llListFindList( list_one,[m])))	{	    llSay(0,  n + llList2String(list_two,2*c)  + owner + llList2String(list_two,(2*c)+1) );	}    }    timer()    {        llSetTimerEvent(0.0);        llListenRemove(Lisn);    }}

 Edit: Just noticed that the responses in list_two were in a different order than the button labels in  list_one.  Fixed.

 

 

Link to comment
Share on other sites

  • 7 months later...
  • 2 years later...

//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);
}
}

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3193 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...