////////////////////////////TOUCHMENU///////////////////////////////////////////////////
list list_one = ["Tug","Squeeze","Lick","Play","Stroke","Tease","Rub","Nibble","Fondle","Bite","Flick"];
string owner;
integer lock = FALSE;
integer chan;
////////////////////////////TOUCHMENU///////////////////////////////////////////////////
////////////////////////////TAIL////////////////////////////////////////////////////////
// holds the tail position before starting the script
vector originalPosition;
// do the actual wagging
doWag()
{
integer amplitude=25;Â Â // maximum wagging width in degrees
integer numOfWags=2;Â Â Â // how many times to be wagged
float steps=12;Â Â Â Â Â Â Â Â // how many steps per wag, higher is slower
float moveBy=0;Â Â Â Â Â Â Â Â // current wagging position
// start wagging, count the steps
integer num=0;
while(num<(steps*numOfWags))
{
// calculate new tail position
moveBy=llSin(num/(steps/2)*PI)*amplitude;
// rotate tail
llSetRot(llEuler2Rot(DEG_TO_RAD*(originalPosition+<moveBy,0,0>)));
// next step
num++;
}
// set back to original position
llSetRot(llEuler2Rot(DEG_TO_RAD*(originalPosition)));
}
////////////////////////////TAIL////////////////////////////////////////////////////////
default
{
////////////////////////////TAIL////////////////////////////////////////////////////////
state_entry()
{
// remember tail position when not wagging
originalPosition=(RAD_TO_DEG*llRot2Euler(llGetLocalRot()));
// start first wagging almost immediately
llSetTimerEvent(1);
}
// every ten seconds
timer()
{
// wag the tail
doWag();
// restart timer, next ten seconds
llSetTimerEvent(10+llFrand(10));
state menu;
}
}
////////////////////////////TAIL////////////////////////////////////////////////////////
////////////////////////////TOUCHMENU///////////////////////////////////////////////////
state menu
{
on_rez(integer n)
{
llResetScript();
}
attach(key a)
{
llResetScript();
}
state_entry()
{
chan = 8000 + (integer)llFrand(8000);
owner = llKey2Name(llGetOwner());
llListen(chan,"","","");
llListen(1,"",llGetOwner(),"");
}
touch_start(integer total_number)
{
if(lock == FALSE){
llDialog(llDetectedKey(0),"What do you want to do with "+owner+"'s tail",list_one,chan);
} else {
llInstantMessage(llDetectedKey(0),"These tail are locked >.>");
}
}
listen(integer c, string n, key i, string m)
{
if(m == "lock" && c != chan)
{
lock = TRUE;
llOwnerSay("Locked");
}
if(m == "unlock" && c != chan)
{
lock = FALSE;
llOwnerSay("Unlocked");
}
if(m == "Flick")
{
llSay(0, " "+n + " flicks " + owner + "'s tail sharply with their finger!");
}
if(m == "Nibble")
{
llSay(0, " "+n + " takes a hold of " + owner + "'s tail and nibbles them softly between their lips...");
}
if(m == "Fondle")
{
llSay(0, " "+n + " grabs " + owner + "'s tail and fondles them playfully in their fingers...");
}
if(m == "Rub")
{
llSay(0," "+n + " holds " + owner + "'s tail between their thumb and finger and rubs them up and down... ");
}
if(m == "Bite")
{
llSay(0," "+n + " grabs " + owner + "'s tail and bites down firmly.");
}
if(m == "Tug")
{
llSay(0," "+n + " tugs on " + owner + "'s tail to the side a few times!");
}
if(m == "Squeeze")
{
llSay(0," "+n + " grabs " + owner + "'s tail and squeezes em in their hand!");
}
if(m == "Lick")
{
llSay(0," "+n + " leans over and licks " + owner + "'s tail!");
}
if(m == "Play")
{
llSay(0," "+n + " plays around with " + owner + "'s tail, just being silly. xP");
}
if(m == "Stroke")
{
llSay(0," "+n + " reaches over and strokes " + owner + "'s tail.");
}
if(m == "Tease")
{
llSay(0," "+n + " teases " + owner + " by running their finger lightly over their tail back and forth...");
}
}
}
////////////////////////////TOUCHMENU///////////////////////////////////////////////////