[COLOR=#008000]vector[/COLOR] V_home = <220,55,1029>;
[COLOR=#008000]vector[/COLOR] V_destination_01 = <250,250,1029>; [COLOR=#ffa07a]//left 1[/COLOR]
[COLOR=#008000]vector[/COLOR] V_destination_02 = <240,240,1029>; [COLOR=#ffa07a]//left 2[/COLOR]
[COLOR=#008000]vector[/COLOR] V_destination_03 = <230,230,1029>; [COLOR=#ffa07a]//left 3[/COLOR]
[COLOR=#008000]vector[/COLOR] V_destination_04 = <220,220,1029>; [COLOR=#ffa07a]//left 4[/COLOR]
[COLOR=#008000]vector [/COLOR]V_destination_05 = <210,210,1029>; [COLOR=#ffa07a]//left 5[/COLOR]
[COLOR=#008000]vector[/COLOR] V_destination_06 = <200,200,1029>; [COLOR=#ffa07a]//left 6[/COLOR]
[COLOR=#008000]vector [/COLOR] V_destination_07 = <190,190,1029>; [COLOR=#ffa07a]//left 7[/COLOR]
[COLOR=#008000]vector [/COLOR]V_destination_08 = <180,180,1029>; [COLOR=#ffa07a]//right 1[/COLOR]
[COLOR=#008000]vector[/COLOR] V_destination_09 = <170,170,1029>; [COLOR=#ffa07a]// right 2[/COLOR]
[COLOR=#008000]vector [/COLOR]V_destination_10 = <160,160,1029>; [COLOR=#ffa07a]//right 3[/COLOR]
[COLOR=#008000]vector [/COLOR] V_destination_11 = <150,150,1029>; [COLOR=#ffa07a]//right 4[/COLOR]
[COLOR=#008000]vector [/COLOR]V_destination_12 = <140,140,1029>; [COLOR=#ffa07a]//right 5[/COLOR]
[COLOR=#008000]vector [/COLOR]V_destination_13 = <130,130,1029>; [COLOR=#ffa07a]//right 6[/COLOR]
[COLOR=#008000]vector[/COLOR] V_destination_14 = <120,120,1029>; [COLOR=#ffa07a]//right 7[/COLOR]
[COLOR=#add8e6]
[/COLOR][COLOR=#008000]vector [/COLOR]loc;
default
{
state_entry()
{
llSitTarget(<0,0,0.1>,<0,0,0,1>);
loc=V_home;
}
touch_start(integer total_number)
{
vector st = llDetectedTouchST(0);
//llOwnerSay("X = "+(string)st.x);
//llOwnerSay("Y = "+(string)st.y);
//llOwnerSay("Face = "+(string)llDetectedTouchFace(0));
if(llDetectedTouchFace(0)==4)
{
if(st.x > 0.75) //home
{
loc=V_home;
}
else if(st.y > 0.5) //left
{
if (st.x < 0.750 && st.x > 0.656) loc=V_destination_01;//left 1
else if (st.x < 0.656 && st.x > 0.552) loc=V_destination_02;//left 2
else if (st.x < 0.552 && st.x > 0.446) loc=V_destination_03;//left 3
else if (st.x < 0.446 && st.x > 0.340) loc=V_destination_04;//left 4
else if (st.x < 0.340 && st.x > 0.237) loc=V_destination_05;//left 5
else if (st.x < 0.237 && st.x > 0.132) loc=V_destination_06;//left 6
else if (st.x < 0.132) loc=V_destination_07;//left 7
}
else if(st.y < 0.5) //right
{
if (st.x < 0.750 && st.x > 0.656) loc=V_destination_08;//right 1
else if (st.x < 0.656 && st.x > 0.552) loc=V_destination_09;//right 2
else if (st.x < 0.552 && st.x > 0.446) loc=V_destination_10;//right 3
else if (st.x < 0.446 && st.x > 0.340) loc=V_destination_11;//right 4
else if (st.x < 0.340 && st.x > 0.237) loc=V_destination_12;//right 5
else if (st.x < 0.237 && st.x > 0.132) loc=V_destination_13;//right 6
else if (st.x < 0.132) loc=V_destination_14;//right 7
}
}
else if(llDetectedTouchFace(0)==2)
{
if(st.x < 1-0.75) //home
{
loc=V_home;
}
else if(st.y < 0.5) //left
{
if (st.x > 1-0.750 && st.x < 1-0.656) loc=V_destination_01;//left 1
else if (st.x > 1-0.656 && st.x < 1-0.552) loc=V_destination_02;//left 2
else if (st.x > 1-0.552 && st.x < 1-0.446) loc=V_destination_03;//left 3
else if (st.x > 1-0.446 && st.x < 1-0.340) loc=V_destination_04;//left 4
else if (st.x > 1-0.340 && st.x < 1-0.237) loc=V_destination_05;//left 5
else if (st.x > 1-0.237 && st.x < 1-0.132) loc=V_destination_06;//left 6
else if (st.x > 1-0.132) loc=V_destination_07;//left 7
}
else if(st.y > 0.5) //right
{
if (st.x > 1-0.750 && st.x < 1-0.656) loc=V_destination_08;//right 1
else if (st.x > 1-0.656 && st.x < 1-0.552) loc=V_destination_09;//right 2
else if (st.x > 1-0.552 && st.x < 1-0.446) loc=V_destination_10;//right 3
else if (st.x > 1-0.446 && st.x < 1-0.340) loc=V_destination_11;//right 4
else if (st.x > 1-0.340 && st.x < 1-0.237) loc=V_destination_12;//right 5
else if (st.x > 1-0.237 && st.x < 1-0.132) loc=V_destination_13;//right 6
else if (st.x > 1-0.132) loc=V_destination_14;//right 7
}
}
llOwnerSay("X = "+(string)loc);
}
changed(integer C)
{
key ID = llAvatarOnSitTarget();
if(ID)
{
vector Return = llGetPos();
llSetRegionPos(loc);
llUnSit(ID);
llSetRegionPos(Return);
loc=V_home;
}
}
}