Hand optimizations to some scripts.
Gains in bytes: - [AV]sitA: 3584 - [AV]sitB: 2048 - [AV]adjuster: 1024 - [AV]faces: 1024 - [AV]Xcite!: 0 - [AV]root-security: 0
This commit is contained in:
parent
d36b812760
commit
f599fb8f85
6 changed files with 353 additions and 222 deletions
|
@ -178,17 +178,17 @@ default
|
|||
list parts = llParseStringKeepNulls(llGetSubString(data, llSubStringIndex(data, " ") + 1, -1), [" | ", " |", "| ", "|"], []);
|
||||
if (command == "TIMER")
|
||||
{
|
||||
TIMER_DEFAULT = (integer)llList2String(parts, 0);
|
||||
TIMER_DEFAULT = llList2Integer(parts, 0);
|
||||
}
|
||||
else if (command == "DEBUG")
|
||||
if (command == "DEBUG")
|
||||
{
|
||||
DEBUG = (integer)llList2String(parts, 0);
|
||||
DEBUG = llList2Integer(parts, 0);
|
||||
}
|
||||
else if (command == "XCITE")
|
||||
if (command == "XCITE")
|
||||
{
|
||||
POSE_AND_SITTER += [llStringTrim(llList2String(parts, 0), STRING_TRIM) + "|" + llList2String(parts, 1)];
|
||||
XCITE_COMMANDS += [llList2String(parts, 2) + "|" + llList2String(parts, 3) + "|" + llList2String(parts, 4) + "|" + llList2String(parts, 5)];
|
||||
XCITE_TILT += (integer)llList2String(parts, 6);
|
||||
XCITE_TILT += llList2Integer(parts, 6);
|
||||
}
|
||||
notecard_query = llGetNotecardLine(notecard_name, ++notecard_line);
|
||||
}
|
||||
|
|
|
@ -227,7 +227,8 @@ default
|
|||
notecard_key = llGetInventoryKey(notecard_name);
|
||||
if (llGetInventoryType(notecard_name) == INVENTORY_NOTECARD)
|
||||
{
|
||||
Out(0, "Loading...");
|
||||
// Out() inlined here:
|
||||
llOwnerSay(llGetScriptName() + "[" + version + "] " + "Loading...");
|
||||
notecard_query = llGetNotecardLine(notecard_name, 0);
|
||||
}
|
||||
}
|
||||
|
@ -248,9 +249,13 @@ default
|
|||
|
||||
link_message(integer sender, integer num, string msg, key id)
|
||||
{
|
||||
list data;
|
||||
integer i;
|
||||
integer sitter;
|
||||
integer x;
|
||||
if (num == 90100)
|
||||
{
|
||||
list data = llParseString2List(msg, ["|"], []);
|
||||
data = llParseString2List(msg, ["|"], []);
|
||||
if (llList2String(data, 1) == "[FACES]")
|
||||
{
|
||||
llMessageLinked(sender, 90101, llDumpList2String([llList2String(data, 0), "[ADJUST]", id], "|"), llList2String(data, 2));
|
||||
|
@ -267,59 +272,63 @@ default
|
|||
llRegionSayTo(id, 0, "Sorry, only the owner can change this.");
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
else if (sender == llGetLinkNumber())
|
||||
if (sender == llGetLinkNumber())
|
||||
{
|
||||
if (num == 90045)
|
||||
{
|
||||
list data = llParseStringKeepNulls(msg, ["|"], []);
|
||||
integer sitter = (integer)llList2String(data, 0);
|
||||
data = llParseStringKeepNulls(msg, ["|"], []);
|
||||
sitter = (integer)llList2String(data, 0);
|
||||
if (id == llList2Key(SITTERS, sitter))
|
||||
{
|
||||
string given_posename = llList2String(data, 1);
|
||||
SITTER_POSES = llListReplaceList(SITTER_POSES, [given_posename], sitter, sitter);
|
||||
given_posename = (string)sitter + "|" + given_posename;
|
||||
remove_sequences(id);
|
||||
integer i;
|
||||
while (i < llGetListLength(anim_triggers))
|
||||
{
|
||||
if (llList2String(anim_triggers, i) == given_posename)
|
||||
{
|
||||
integer reference = llListFindList(anim_triggers, [(string)sitter + "|" + llList2String(anim_animsequences, i)]);
|
||||
if (reference == -1)
|
||||
x = llListFindList(anim_triggers, [(string)sitter + "|" + llList2String(anim_animsequences, i)]);
|
||||
if (x == -1)
|
||||
{
|
||||
reference = i;
|
||||
x = i;
|
||||
}
|
||||
start_sequence(reference, id);
|
||||
start_sequence(x, id);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
else if (num == 90065)
|
||||
if (num == 90065)
|
||||
{
|
||||
remove_sequences(id);
|
||||
integer index = llListFindList(SITTERS, [id]);
|
||||
if (index != -1)
|
||||
i = llListFindList(SITTERS, [id]);
|
||||
if (i != -1)
|
||||
{
|
||||
SITTERS = llListReplaceList(SITTERS, [NULL_KEY], index, index);
|
||||
SITTERS = llListReplaceList(SITTERS, [NULL_KEY], i, i);
|
||||
}
|
||||
return;
|
||||
}
|
||||
else if (num == 90030)
|
||||
if (num == 90030)
|
||||
{
|
||||
SITTERS = llListReplaceList(SITTERS, [NULL_KEY], (integer)msg, (integer)msg);
|
||||
SITTERS = llListReplaceList(SITTERS, [NULL_KEY], (integer)((string)id), (integer)((string)id));
|
||||
return;
|
||||
}
|
||||
else if (num == 90070)
|
||||
if (num == 90070)
|
||||
{
|
||||
SITTERS = llListReplaceList(SITTERS, [id], (integer)msg, (integer)msg);
|
||||
return;
|
||||
}
|
||||
else if (num == 90172)
|
||||
if (num == 90172)
|
||||
{
|
||||
is_running = TRUE;
|
||||
integer sitter = (integer)msg;
|
||||
sitter = (integer)msg;
|
||||
remove_sequences(llList2Key(SITTERS, sitter));
|
||||
integer i = llGetListLength(anim_triggers);
|
||||
i = llGetListLength(anim_triggers);
|
||||
while (i > 0)
|
||||
{
|
||||
i--;
|
||||
|
@ -332,32 +341,39 @@ default
|
|||
if (id != "none")
|
||||
{
|
||||
anim_triggers += [msg + "|" + llList2String(SITTER_POSES, sitter)];
|
||||
anim_animsequences += (string)id + "|1";
|
||||
|
||||
msg = (string)id + "|1";
|
||||
// Reuse existing entries to save data memory when possible
|
||||
i = llListFindList(anim_animsequences, [msg]);
|
||||
if (~i)
|
||||
msg = llList2String(anim_animsequences, i);
|
||||
anim_animsequences += msg;
|
||||
|
||||
start_sequence(llGetListLength(anim_animsequences) - 1, llList2Key(SITTERS, sitter));
|
||||
llSay(0, "FACE added: '" + (string)id + "' to '" + llList2String(SITTER_POSES, sitter) + "' for SITTER " + (string)sitter + ".");
|
||||
}
|
||||
return;
|
||||
}
|
||||
else if (num == 90020 && (string)id == llGetScriptName())
|
||||
if (num == 90020 && (string)id == llGetScriptName())
|
||||
{
|
||||
integer i;
|
||||
for (i = 0; i < llGetListLength(anim_triggers); i++)
|
||||
{
|
||||
if (llSubStringIndex(llList2String(anim_triggers, i), msg + "|") == 0)
|
||||
{
|
||||
list trigger = llParseString2List(llList2String(anim_triggers, i), ["|"], []);
|
||||
data = llParseString2List(llList2String(anim_triggers, i), ["|"], []);
|
||||
list sequence = llParseString2List(llList2String(anim_animsequences, i), ["|"], []);
|
||||
integer x;
|
||||
for (x = 0; x < llGetListLength(sequence); x += 2)
|
||||
{
|
||||
if (IsInteger(llList2String(sequence, x)))
|
||||
{
|
||||
sequence = llListReplaceList(sequence, [llList2String(facial_anim_list, (integer)llList2String(sequence, x))], x, x);
|
||||
sequence = llListReplaceList(sequence, [llList2String(facial_anim_list, llList2Integer(sequence, x))], x, x);
|
||||
}
|
||||
}
|
||||
Readout_Say("ANIM " + llList2String(trigger, 1) + "|" + llDumpList2String(sequence, "|"), msg);
|
||||
Readout_Say("ANIM " + llList2String(data, 1) + "|" + llDumpList2String(sequence, "|"), msg);
|
||||
}
|
||||
}
|
||||
llMessageLinked(LINK_THIS, 90021, msg, llGetScriptName());
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -393,7 +409,8 @@ default
|
|||
{
|
||||
if (data == EOF)
|
||||
{
|
||||
Out(0, (string)llGetListLength(anim_triggers) + " Expressions Ready, Mem=" + (string)llGetFreeMemory());
|
||||
// Out() inlined here:
|
||||
llOwnerSay(llGetScriptName() + "[" + version + "] " + (string)llGetListLength(anim_triggers) + " Expressions Ready, Mem=" + (string)llGetFreeMemory());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -401,17 +418,16 @@ default
|
|||
data = llStringTrim(data, STRING_TRIM);
|
||||
string command = llGetSubString(data, 0, llSubStringIndex(data, " ") - 1);
|
||||
list parts = llParseStringKeepNulls(llGetSubString(data, llSubStringIndex(data, " ") + 1, -1), [" | ", " |", "| ", "|"], []);
|
||||
string part0 = llStringTrim(llList2String(parts, 0), STRING_TRIM);
|
||||
if (command == "SITTER")
|
||||
{
|
||||
notecard_section = (integer)part0;
|
||||
notecard_section = llList2Integer(parts, 0);
|
||||
}
|
||||
else if (command == "ANIM")
|
||||
if (command == "ANIM")
|
||||
{
|
||||
string part1 = llStringTrim(llDumpList2String(llList2List(parts, 1, -1), "|"), STRING_TRIM);
|
||||
string part1 = llStringTrim(llDumpList2String(llDeleteSubList(parts, 0, 0), "|"), STRING_TRIM);
|
||||
list sequence = llParseString2List(part1, ["|"], []);
|
||||
integer x;
|
||||
for (x = 0; x < llGetListLength(sequence); x += 2)
|
||||
for (; x < llGetListLength(sequence); x += 2)
|
||||
{
|
||||
integer index = llListFindList(facial_anim_list, [llList2String(sequence, x)]);
|
||||
if (~index)
|
||||
|
@ -422,8 +438,13 @@ default
|
|||
x, x);
|
||||
}
|
||||
}
|
||||
anim_triggers += [(string)notecard_section + "|" + part0];
|
||||
anim_animsequences += llDumpList2String(sequence, "|");
|
||||
anim_triggers += [(string)notecard_section + "|" + llStringTrim(llList2String(parts, 0), STRING_TRIM)];
|
||||
part1 = llDumpList2String(sequence, "|");
|
||||
// Reuse existing entries to save data memory when possible
|
||||
x = llListFindList(anim_animsequences, [part1]);
|
||||
if (~x)
|
||||
part1 = llList2String(anim_animsequences, x);
|
||||
anim_animsequences += part1;
|
||||
}
|
||||
notecard_query = llGetNotecardLine(notecard_name, notecard_line += 1);
|
||||
}
|
||||
|
|
|
@ -50,22 +50,21 @@ string SEP = "<22>"; // OSS::string SEP = "\u007F";
|
|||
|
||||
string FormatFloat(float f, integer num_decimals)
|
||||
{
|
||||
float rounding = (float)(".5e-" + (string)num_decimals) - .5e-6;
|
||||
if (f < 0.)
|
||||
f -= rounding;
|
||||
else
|
||||
f += rounding;
|
||||
f += ((integer)(f > 0) - (integer)(f < 0)) * ((float)(".5e-" + (string)num_decimals) - .5e-6);
|
||||
string ret = llGetSubString((string)f, 0, num_decimals - (!num_decimals) - 7);
|
||||
if (llSubStringIndex(ret, ".") != -1)
|
||||
if (num_decimals)
|
||||
{
|
||||
while (llGetSubString(ret, -1, -1) == "0")
|
||||
num_decimals = -1;
|
||||
while (llGetSubString(ret, num_decimals, num_decimals) == "0")
|
||||
{
|
||||
ret = llGetSubString(ret, 0, -2);
|
||||
--num_decimals;
|
||||
}
|
||||
}
|
||||
if (llGetSubString(ret, -1, -1) == ".")
|
||||
{
|
||||
ret = llGetSubString(ret, 0, -2);
|
||||
if (llGetSubString(ret, num_decimals, num_decimals) == ".")
|
||||
{
|
||||
--num_decimals;
|
||||
}
|
||||
|
||||
return llGetSubString(ret, 0, num_decimals);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
@ -78,9 +77,8 @@ web(integer force)
|
|||
{
|
||||
cache += "\n\nend";
|
||||
}
|
||||
cache = llEscapeURL(cache);
|
||||
webcount++;
|
||||
llHTTPRequest(url, [HTTP_METHOD, "POST", HTTP_MIMETYPE, "application/x-www-form-urlencoded", HTTP_VERIFY_CERT, FALSE], "w=" + webkey + "&c=" + (string)webcount + "&t=" + cache);
|
||||
llHTTPRequest(url, [HTTP_METHOD, "POST", HTTP_MIMETYPE, "application/x-www-form-urlencoded", HTTP_VERIFY_CERT, FALSE], "w=" + webkey + "&c=" + (string)webcount + "&t=" + llEscapeURL(cache));
|
||||
cache = "";
|
||||
}
|
||||
}
|
||||
|
@ -226,7 +224,14 @@ choice_menu(list options, string menu_text)
|
|||
}
|
||||
menu_items += ["[BACK]", "[<<]", "[>>]"];
|
||||
}
|
||||
llDialog(controller, menu_text, order_buttons(menu_items), comm_channel);
|
||||
llDialog(controller
|
||||
, menu_text
|
||||
, llList2List(menu_items, -3, -1)
|
||||
+ llList2List(menu_items, -6, -4)
|
||||
+ llList2List(menu_items, -9, -7)
|
||||
+ llList2List(menu_items, -12, -10)
|
||||
, comm_channel
|
||||
);
|
||||
}
|
||||
|
||||
new_menu()
|
||||
|
@ -239,7 +244,14 @@ new_menu()
|
|||
}
|
||||
menu_items += "[CAMERA]";
|
||||
string menu_text = "\nWhat would you like to create?\n";
|
||||
llDialog(controller, menu_text, order_buttons(menu_items), comm_channel);
|
||||
llDialog(controller
|
||||
, menu_text
|
||||
, llList2List(menu_items, -3, -1)
|
||||
+ llList2List(menu_items, -6, -4)
|
||||
+ llList2List(menu_items, -9, -7)
|
||||
+ llList2List(menu_items, -12, -10)
|
||||
, comm_channel
|
||||
);
|
||||
}
|
||||
|
||||
end_helper_mode()
|
||||
|
@ -380,49 +392,53 @@ default
|
|||
{
|
||||
integer one = (integer)msg;
|
||||
integer two = (integer)((string)id);
|
||||
integer i;
|
||||
if (sender == llGetLinkNumber())
|
||||
{
|
||||
list data = llParseStringKeepNulls(msg, ["|"], []);
|
||||
if (num == 90065)
|
||||
{
|
||||
integer index = llListFindList(SITTERS, [id]);
|
||||
if (index != -1)
|
||||
i = llListFindList(SITTERS, [id]);
|
||||
if (i != -1)
|
||||
{
|
||||
SITTERS = llListReplaceList(SITTERS, [NULL_KEY], index, index);
|
||||
SITTERS = llListReplaceList(SITTERS, [NULL_KEY], i, i);
|
||||
}
|
||||
return;
|
||||
}
|
||||
else if (num == 90030)
|
||||
if (num == 90030)
|
||||
{
|
||||
SITTERS = llListReplaceList(SITTERS, [NULL_KEY], (integer)msg, (integer)msg);
|
||||
SITTERS = llListReplaceList(SITTERS, [NULL_KEY], (integer)((string)id), (integer)((string)id));
|
||||
if (OLD_HELPER_METHOD && helper_mode)
|
||||
{
|
||||
integer i = llList2Integer(HELPER_KEY_LIST, (integer)msg);
|
||||
i = llList2Integer(HELPER_KEY_LIST, (integer)msg);
|
||||
HELPER_KEY_LIST = llListReplaceList(HELPER_KEY_LIST, [llList2Integer(HELPER_KEY_LIST, (integer)((string)id))], (integer)msg, (integer)msg);
|
||||
HELPER_KEY_LIST = llListReplaceList(HELPER_KEY_LIST, [i], (integer)((string)id), (integer)((string)id));
|
||||
llRegionSay(comm_channel, "SWAP|" + (string)msg + "|" + (string)id);
|
||||
}
|
||||
return;
|
||||
}
|
||||
else if (num == 90070)
|
||||
if (num == 90070)
|
||||
{
|
||||
SITTERS = llListReplaceList(SITTERS, [id], (integer)msg, (integer)msg);
|
||||
return;
|
||||
}
|
||||
else if (num == 90021)
|
||||
if (num == 90021)
|
||||
{
|
||||
integer script_channel = (integer)msg;
|
||||
list scripts = [prop_script, expression_script, camera_script];
|
||||
integer index = llListFindList(scripts, [(string)id]);
|
||||
while (index < llGetListLength(scripts))
|
||||
i = llListFindList(scripts, [(string)id]);
|
||||
while (i < llGetListLength(scripts))
|
||||
{
|
||||
index++;
|
||||
string lookfor = llList2String(scripts, index);
|
||||
i++;
|
||||
string lookfor = llList2String(scripts, i);
|
||||
if (lookfor == camera_script && script_channel > 0)
|
||||
{
|
||||
lookfor = lookfor + " " + (string)script_channel;
|
||||
}
|
||||
if (llGetInventoryType(lookfor) == INVENTORY_SCRIPT)
|
||||
{
|
||||
llMessageLinked(LINK_THIS, 90020, (string)script_channel, llList2String(scripts, index));
|
||||
llMessageLinked(LINK_THIS, 90020, (string)script_channel, llList2String(scripts, i));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -438,8 +454,9 @@ default
|
|||
web(TRUE);
|
||||
llRegionSayTo(llGetOwner(), 0, "Settings copy: " + url + "?q=" + webkey);
|
||||
}
|
||||
return;
|
||||
}
|
||||
else if (num == 90022)
|
||||
if (num == 90022)
|
||||
{
|
||||
if (llGetSubString(msg, 0, 3) == "S:M:" || llGetSubString(msg, 0, 3) == "S:T:")
|
||||
{
|
||||
|
@ -455,19 +472,19 @@ default
|
|||
Readout_Say("--✄--COPY BELOW INTO \"AVpos\" NOTECARD--✄--");
|
||||
Readout_Say("");
|
||||
Readout_Say("\"" + llToUpper(llGetObjectName()) + "\" " + strReplace(llList2String(data, 0), "V:", "AVsitter "));
|
||||
if ((integer)llList2String(data, 1))
|
||||
if (llList2Integer(data, 1))
|
||||
{
|
||||
Readout_Say("MTYPE " + llList2String(data, 1));
|
||||
}
|
||||
if ((integer)llList2String(data, 2) != 1)
|
||||
if (llList2Integer(data, 2) != 1)
|
||||
{
|
||||
Readout_Say("ETYPE " + llList2String(data, 2));
|
||||
}
|
||||
if ((integer)llList2String(data, 3) > -1)
|
||||
if (llList2Integer(data, 3) > -1)
|
||||
{
|
||||
Readout_Say("SET " + llList2String(data, 3));
|
||||
}
|
||||
if ((integer)llList2String(data, 4) != 2)
|
||||
if (llList2Integer(data, 4) != 2)
|
||||
{
|
||||
Readout_Say("SWAP " + llList2String(data, 4));
|
||||
}
|
||||
|
@ -479,15 +496,15 @@ default
|
|||
{
|
||||
Readout_Say("ADJUST " + strReplace(llList2String(data, 7), SEP, "|"));
|
||||
}
|
||||
if ((integer)llList2String(data, 8))
|
||||
if (llList2Integer(data, 8))
|
||||
{
|
||||
Readout_Say("SELECT " + llList2String(data, 8));
|
||||
}
|
||||
if ((integer)llList2String(data, 9) != 2)
|
||||
if (llList2Integer(data, 9) != 2)
|
||||
{
|
||||
Readout_Say("AMENU " + llList2String(data, 9));
|
||||
}
|
||||
if ((integer)llList2String(data, 10))
|
||||
if (llList2Integer(data, 10))
|
||||
{
|
||||
Readout_Say("HELPER " + llList2String(data, 10));
|
||||
}
|
||||
|
@ -509,10 +526,8 @@ default
|
|||
{
|
||||
msg = strReplace(msg, "{P:", "{");
|
||||
list parts = llParseStringKeepNulls(llDumpList2String(llParseString2List(llGetSubString(msg, llSubStringIndex(msg, "}") + 1, -1), [" "], [""]), ""), ["<"], []);
|
||||
string pos = "<" + llList2String(parts, 1);
|
||||
string rot = "<" + llList2String(parts, 2);
|
||||
vector pos2 = (vector)pos;
|
||||
vector rot2 = (vector)rot;
|
||||
vector pos2 = (vector)("<" + llList2String(parts, 1));
|
||||
vector rot2 = (vector)("<" + llList2String(parts, 2));
|
||||
string result = "<" + FormatFloat(pos2.x, 3) + "," + FormatFloat(pos2.y, 3) + "," + FormatFloat(pos2.z, 3) + ">";
|
||||
result += "<" + FormatFloat(rot2.x, 1) + "," + FormatFloat(rot2.y, 1) + "," + FormatFloat(rot2.z, 1) + ">";
|
||||
msg = llGetSubString(msg, 0, llSubStringIndex(msg, "}")) + result;
|
||||
|
@ -552,9 +567,9 @@ default
|
|||
}
|
||||
Readout_Say(msg);
|
||||
}
|
||||
else if (num == 90100 || num == 90101)
|
||||
if (num == 90100 || num == 90101)
|
||||
{
|
||||
if (llList2String(data, 1) == "[DUMP]")
|
||||
if ((msg = llList2String(data, 1)) == "[DUMP]")
|
||||
{
|
||||
if (id != llGetOwner())
|
||||
{
|
||||
|
@ -562,16 +577,15 @@ default
|
|||
}
|
||||
llMessageLinked(LINK_THIS, 90020, "0", "");
|
||||
}
|
||||
else if (llList2String(data, 1) == "[NEW]")
|
||||
if (msg == "[NEW]")
|
||||
{
|
||||
controller = (key)llList2String(data, 2);
|
||||
active_sitter = (integer)llList2String(data, 0);
|
||||
controller = llList2Key(data, 2);
|
||||
active_sitter = llList2Integer(data, 0);
|
||||
adding = "";
|
||||
new_menu();
|
||||
}
|
||||
else if (llList2String(data, 1) == "[SAVE]")
|
||||
if (msg == "[SAVE]")
|
||||
{
|
||||
integer i;
|
||||
for (i = 0; i < llGetListLength(SITTERS); i++)
|
||||
{
|
||||
if (llList2String(SITTER_POSES, i) != "")
|
||||
|
@ -591,18 +605,19 @@ default
|
|||
}
|
||||
llMessageLinked(LINK_THIS, 90005, "", llDumpList2String([llList2String(data, 2), id], "|"));
|
||||
}
|
||||
else if (llList2String(data, 1) == "[HELPER]")
|
||||
if (msg == "[HELPER]")
|
||||
{
|
||||
controller = id;
|
||||
OLD_HELPER_METHOD = (integer)llList2String(data, 3);
|
||||
toggle_helper_mode();
|
||||
}
|
||||
else if (llList2String(data, 1) == "[ADJUST]")
|
||||
if (msg == "[ADJUST]")
|
||||
{
|
||||
end_helper_mode();
|
||||
}
|
||||
return;
|
||||
}
|
||||
else if (num == 90055 || num == 90056)
|
||||
if (num == 90055 || num == 90056)
|
||||
{
|
||||
data = llParseStringKeepNulls(id, ["|"], []);
|
||||
SITTER_POSES = llListReplaceList(SITTER_POSES, [llList2String(data, 0)], one, one);
|
||||
|
|
|
@ -66,7 +66,7 @@ check_sitters()
|
|||
|
||||
back_to_adjust(integer SCRIPT_CHANNEL, key sitter)
|
||||
{
|
||||
llMessageLinked(LINK_SET, 90101, (string)SCRIPT_CHANNEL + "|[ADJUST]", sitter);
|
||||
llMessageLinked(LINK_SET, 90101, (string)SCRIPT_CHANNEL + "|[ADJUST]|", sitter);
|
||||
}
|
||||
|
||||
list order_buttons(list menu_items)
|
||||
|
@ -162,14 +162,14 @@ default
|
|||
if (id == llGetOwner())
|
||||
{
|
||||
active_prim = sender;
|
||||
active_script_channel = (integer)llList2String(data, 0);
|
||||
active_sitter = (key)llList2String(data, 2);
|
||||
active_script_channel = llList2Integer(data, 0);
|
||||
active_sitter = llList2Key(data, 2);
|
||||
main_menu();
|
||||
}
|
||||
else
|
||||
{
|
||||
llRegionSayTo(id, 0, "Sorry, only the owner can change security settings.");
|
||||
llMessageLinked(sender, 90101, llDumpList2String([llList2String(data, 0), "[ADJUST]", id], "|"), llList2String(data, 2));
|
||||
llMessageLinked(sender, 90101, llList2String(data, 0) + "|[ADJUST]|" + (string)id, llList2Key(data, 2));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -197,7 +197,7 @@ default
|
|||
{
|
||||
if (msg == "[BACK]")
|
||||
{
|
||||
llMessageLinked(LINK_SET, 90101, llDumpList2String([active_script_channel, "[ADJUST]", id], "|"), active_sitter);
|
||||
llMessageLinked(LINK_SET, 90101, (string)active_script_channel + "|[ADJUST]|" + (string)id, active_sitter);
|
||||
}
|
||||
else if (lastmenu == "Sit")
|
||||
{
|
||||
|
|
|
@ -109,7 +109,13 @@ dialog(string text, list menu_items)
|
|||
{
|
||||
llListenRemove(menu_handle);
|
||||
menu_handle = llListen((menu_channel = ((integer)llFrand(0x7FFFFF80) + 1) * -1), "", CONTROLLER, ""); // 7FFFFF80 = max float < 2^31
|
||||
llDialog(CONTROLLER, product + " " + version + "\n\n" + text, order_buttons(menu_items), menu_channel);
|
||||
llDialog(CONTROLLER
|
||||
, product + " " + version + "\n\n" + text
|
||||
, llList2List(menu_items, -3, -1)
|
||||
+ llList2List(menu_items, -6, -4)
|
||||
+ llList2List(menu_items, -9, -7)
|
||||
+ llList2List(menu_items, -12, -10)
|
||||
, menu_channel);
|
||||
}
|
||||
|
||||
options_menu()
|
||||
|
@ -160,14 +166,14 @@ adjust_pose_menu()
|
|||
|
||||
integer IsInteger(string data)
|
||||
{
|
||||
// This should allow for leading zeros, thus the "1"
|
||||
// This should allow for leading zeros, hence the "1"
|
||||
return data != "" && (string)((integer)("1" + data)) == "1" + data;
|
||||
}
|
||||
|
||||
wipe_sit_targets()
|
||||
{
|
||||
integer i;
|
||||
for (i = 0; i <= llGetNumberOfPrims(); i++)
|
||||
for (; i <= llGetNumberOfPrims(); i++)
|
||||
{
|
||||
if ((string)llGetLinkPrimitiveParams(i, [PRIM_DESC]) != "-1")
|
||||
{
|
||||
|
@ -189,7 +195,8 @@ sittargets()
|
|||
{
|
||||
if (!SCRIPT_CHANNEL)
|
||||
{
|
||||
primcount_error();
|
||||
// primcount_error() inlined here:
|
||||
llDialog(llGetOwner(), "\nThere aren't enough prims for required SitTargets.\nYou must have one prim for each avatar to sit!", ["OK"], 23658);
|
||||
}
|
||||
wrong_primcount = TRUE;
|
||||
}
|
||||
|
@ -239,7 +246,13 @@ sittargets()
|
|||
}
|
||||
original_my_sittarget = my_sittarget;
|
||||
ORIGINAL_SITTERS_SITTARGETS = SITTERS_SITTARGETS;
|
||||
prep();
|
||||
// inline prep() here
|
||||
has_security = has_texture = FALSE;
|
||||
if (!SCRIPT_CHANNEL)
|
||||
{
|
||||
llMessageLinked(LINK_SET, 90201, "", ""); // 90201=Ask for info about plugins
|
||||
}
|
||||
|
||||
set_sittarget();
|
||||
}
|
||||
|
||||
|
@ -442,9 +455,14 @@ default
|
|||
SCRIPT_CHANNEL = (integer)llGetSubString(llGetScriptName(), llSubStringIndex(llGetScriptName(), " "), -1);
|
||||
while (llGetInventoryType(memoryscript) != INVENTORY_SCRIPT)
|
||||
{
|
||||
llSleep(0.1);
|
||||
}
|
||||
integer i;
|
||||
while (i++ < get_number_of_scripts())
|
||||
// get_number_of_scripts() inlined here:
|
||||
while (llGetInventoryType(main_script + " " + (string)(++i)) == INVENTORY_SCRIPT)
|
||||
;
|
||||
|
||||
while (i--)
|
||||
{
|
||||
SITTERS += "";
|
||||
}
|
||||
|
@ -454,7 +472,14 @@ default
|
|||
}
|
||||
else
|
||||
{
|
||||
wipe_sit_targets();
|
||||
// wipe_sit_targets() inlined here:
|
||||
for (i = 0; i <= llGetNumberOfPrims(); i++)
|
||||
{
|
||||
if ((string)llGetLinkPrimitiveParams(i, [PRIM_DESC]) != "-1")
|
||||
{
|
||||
llLinkSitTarget(i, ZERO_VECTOR, ZERO_ROTATION);
|
||||
}
|
||||
}
|
||||
reused_key = llGetNumberOfNotecardLines(notecard_name);
|
||||
reading_notecard_section = TRUE;
|
||||
}
|
||||
|
@ -464,7 +489,8 @@ default
|
|||
{
|
||||
if (!SCRIPT_CHANNEL)
|
||||
{
|
||||
Out(0, "Loading " + notecard_name + "...");
|
||||
// Out() inlined here:
|
||||
llOwnerSay(llGetScriptName() + "[" + version + "] " + "Loading " + notecard_name + "...");
|
||||
}
|
||||
notecard_query = llGetNotecardLine(notecard_name, reused_variable);
|
||||
}
|
||||
|
@ -512,16 +538,16 @@ default
|
|||
{
|
||||
if (id != MY_SITTER)
|
||||
{
|
||||
id = llDumpList2String([id, MY_SITTER], "|");
|
||||
id = (string)id + "|" + (string)MY_SITTER;
|
||||
}
|
||||
llMessageLinked(LINK_SET, (integer)llList2String(ADJUST_MENU, index + 1), msg, id);
|
||||
llMessageLinked(LINK_SET, llList2Integer(ADJUST_MENU, index + 1), msg, id);
|
||||
}
|
||||
else
|
||||
{
|
||||
index = llListFindList(["Position", "Rotation", "X+", "Y+", "Z+", "X-", "Y-", "Z-", "0.05m", "0.25m", "0.01m", "5°", "25°", "1°"], [msg]);
|
||||
if (msg == "[BACK]")
|
||||
{
|
||||
llMessageLinked(LINK_SET, 90005, "", llDumpList2String([CONTROLLER, MY_SITTER], "|")); // 90005=send menu to user
|
||||
llMessageLinked(LINK_SET, 90005, "", (string)CONTROLLER + "|" + (string)MY_SITTER); // 90005=send menu to user
|
||||
}
|
||||
else if (msg == "[POSE]")
|
||||
{
|
||||
|
@ -633,6 +659,8 @@ default
|
|||
{
|
||||
integer one = (integer)msg;
|
||||
integer two = (integer)((string)id);
|
||||
integer target;
|
||||
list data;
|
||||
if (num == 90075) // 90075=old-style helper ask to animate
|
||||
{
|
||||
if (one == SCRIPT_CHANNEL)
|
||||
|
@ -695,7 +723,7 @@ default
|
|||
}
|
||||
if (num == 90298) // 90298=show SitTargets (/5 targets)
|
||||
{
|
||||
integer target = my_sittarget;
|
||||
target = my_sittarget;
|
||||
if (llGetNumberOfPrims() == 1 && target == 1)
|
||||
{
|
||||
target = 0;
|
||||
|
@ -717,7 +745,7 @@ default
|
|||
}
|
||||
if (id == MY_SITTER)
|
||||
{
|
||||
list data = llParseStringKeepNulls(msg, ["|"], []);
|
||||
data = llParseStringKeepNulls(msg, ["|"], data);
|
||||
if (num == 90001) // 90001=start an overlay animation
|
||||
{
|
||||
llStartAnimation(msg);
|
||||
|
@ -730,39 +758,72 @@ default
|
|||
}
|
||||
if (num == 90101) // 90101=menu option chosen
|
||||
{
|
||||
CONTROLLER = (key)llList2String(data, 2);
|
||||
if (llList2String(data, 1) == "[ADJUST]")
|
||||
CONTROLLER = llList2Key(data, 2);
|
||||
if ((msg = llList2String(data, 1)) == "[ADJUST]") // WARNING: reusing msg
|
||||
{
|
||||
options_menu();
|
||||
// options_menu() inlined here:
|
||||
data = [];
|
||||
if (has_texture)
|
||||
{
|
||||
data += "[TEXTURE]";
|
||||
}
|
||||
if (llGetInventoryType(expression_script) == INVENTORY_SCRIPT)
|
||||
{
|
||||
data += "[FACES]";
|
||||
}
|
||||
if (has_security)
|
||||
{
|
||||
data += "[SECURITY]";
|
||||
}
|
||||
integer i;
|
||||
while (i < llGetListLength(ADJUST_MENU))
|
||||
{
|
||||
data += llList2String(ADJUST_MENU, i);
|
||||
i = i + 2;
|
||||
}
|
||||
if (llGetInventoryType(helper_object) == INVENTORY_OBJECT && llGetInventoryType(adjust_script) == INVENTORY_SCRIPT)
|
||||
{
|
||||
data += "[HELPER]";
|
||||
}
|
||||
if (!llGetListLength(data))
|
||||
{
|
||||
adjust_pose_menu();
|
||||
return;
|
||||
}
|
||||
data += "[POSE]";
|
||||
dialog("Adjust:", ["[BACK]"] + data);
|
||||
return;
|
||||
}
|
||||
else if (llList2String(data, 1) == "Harder >>" || llList2String(data, 1) == "<< Softer")
|
||||
if (msg == "Harder >>" || msg == "<< Softer")
|
||||
{
|
||||
llMessageLinked(LINK_SET, 90005, "", llDumpList2String([CONTROLLER, MY_SITTER], "|"));
|
||||
return;
|
||||
}
|
||||
else if (llList2String(data, 1) == "[SWAP]")
|
||||
if (msg == "[SWAP]")
|
||||
{
|
||||
integer target_script = SCRIPT_CHANNEL + 1;
|
||||
// target here means target script
|
||||
target = SCRIPT_CHANNEL + 1;
|
||||
list X = SITTERS + SITTERS;
|
||||
if (llSubStringIndex(CURRENT_POSE_NAME, "P:"))
|
||||
{
|
||||
while (llList2Key(X, target_script) == "" && target_script + 1 < llGetListLength(X))
|
||||
while (llList2Key(X, target) == "" && target + 1 < llGetListLength(X))
|
||||
{
|
||||
target_script++;
|
||||
target++;
|
||||
}
|
||||
if (llList2Key(X, target_script) == MY_SITTER)
|
||||
if (llList2Key(X, target) == MY_SITTER)
|
||||
{
|
||||
target_script++;
|
||||
target++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
while (llList2Key(X, target_script) != "" && target_script < llGetListLength(SITTERS) + SCRIPT_CHANNEL + 1)
|
||||
while (llList2String(X, target) != "" && target < llGetListLength(SITTERS) + SCRIPT_CHANNEL + 1)
|
||||
{
|
||||
target_script++;
|
||||
target++;
|
||||
}
|
||||
}
|
||||
target_script = target_script % llGetListLength(SITTERS);
|
||||
llMessageLinked(LINK_THIS, 90030, (string)SCRIPT_CHANNEL, (string)target_script);
|
||||
target %= llGetListLength(SITTERS);
|
||||
llMessageLinked(LINK_THIS, 90030, (string)SCRIPT_CHANNEL, (string)target);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -771,7 +832,7 @@ default
|
|||
{
|
||||
if (num == 90055) // 90055=anim info from AVsitB
|
||||
{
|
||||
list data = llParseStringKeepNulls(id, ["|"], []);
|
||||
data = llParseStringKeepNulls(id, ["|"], data);
|
||||
OLD_POSE_NAME = CURRENT_POSE_NAME;
|
||||
CURRENT_POSE_NAME = llList2String(data, 0);
|
||||
OLD_ANIMATION_FILENAME = CURRENT_ANIMATION_FILENAME;
|
||||
|
@ -785,14 +846,14 @@ default
|
|||
FIRST_ROTATION = DEFAULT_ROTATION;
|
||||
FIRST_ANIMATION_SEQUENCE = CURRENT_ANIMATION_SEQUENCE;
|
||||
}
|
||||
speed_index = (integer)llList2String(data, 5);
|
||||
apply_current_anim((integer)llList2String(data, 4));
|
||||
speed_index = llList2Integer(data, 5);
|
||||
apply_current_anim(llList2Integer(data, 4));
|
||||
set_sittarget();
|
||||
return;
|
||||
}
|
||||
if (num == 90057) // 90057=helper moved, update position
|
||||
{
|
||||
list data = llParseStringKeepNulls(id, ["|"], []);
|
||||
data = llParseStringKeepNulls(id, ["|"], data);
|
||||
CURRENT_POSITION = (vector)llList2String(data, 0);
|
||||
CURRENT_ROTATION = (vector)llList2String(data, 1);
|
||||
sit_using_prim_params();
|
||||
|
@ -803,10 +864,10 @@ default
|
|||
|
||||
changed(integer change)
|
||||
{
|
||||
integer i;
|
||||
if (change & CHANGED_LINK)
|
||||
{
|
||||
SWAPPED = FALSE;
|
||||
integer i;
|
||||
integer stood;
|
||||
if (SET == -1 && llGetListLength(SITTERS) > 1)
|
||||
{
|
||||
|
@ -878,7 +939,7 @@ default
|
|||
}
|
||||
for (i = 0; i < llGetListLength(SITTERS); i++)
|
||||
{
|
||||
if (llList2Key(SITTERS, i) != "" && llListFindList(AVPRIMS, [llList2Key(SITTERS, i)]) == -1)
|
||||
if (llList2String(SITTERS, i) != "" && llListFindList(AVPRIMS, [llList2Key(SITTERS, i)]) == -1)
|
||||
{
|
||||
llSetTimerEvent(0);
|
||||
stood = TRUE;
|
||||
|
@ -969,21 +1030,42 @@ default
|
|||
SITTERS_SITTARGETS = ORIGINAL_SITTERS_SITTARGETS;
|
||||
set_sittarget();
|
||||
}
|
||||
prep();
|
||||
// inline prep() here
|
||||
has_security = has_texture = FALSE;
|
||||
if (!SCRIPT_CHANNEL)
|
||||
{
|
||||
llMessageLinked(LINK_SET, 90201, "", ""); // 90201=Ask for info about plugins
|
||||
}
|
||||
}
|
||||
if (prims != llGetObjectPrimCount(llGetKey()))
|
||||
{
|
||||
if (!SCRIPT_CHANNEL)
|
||||
{
|
||||
wipe_sit_targets();
|
||||
// wipe_sit_targets() inlined here:
|
||||
for (i = 0; i <= llGetNumberOfPrims(); i++)
|
||||
{
|
||||
if ((string)llGetLinkPrimitiveParams(i, [PRIM_DESC]) != "-1")
|
||||
{
|
||||
llLinkSitTarget(i, ZERO_VECTOR, ZERO_ROTATION);
|
||||
}
|
||||
}
|
||||
|
||||
llMessageLinked(LINK_SET, 90150, "", ""); // 90150=ask other AVsitA scripts to place their sittargets again
|
||||
}
|
||||
prep();
|
||||
// inline prep() here
|
||||
has_security = has_texture = FALSE;
|
||||
if (!SCRIPT_CHANNEL)
|
||||
{
|
||||
llMessageLinked(LINK_SET, 90201, "", ""); // 90201=Ask for info about plugins
|
||||
}
|
||||
}
|
||||
}
|
||||
if (change & CHANGED_INVENTORY)
|
||||
{
|
||||
if (llGetInventoryKey(notecard_name) != notecard_key || get_number_of_scripts() != llGetListLength(SITTERS) || llGetInventoryType(memoryscript) != INVENTORY_SCRIPT)
|
||||
// get_number_of_scripts() inlined here:
|
||||
while (llGetInventoryType(main_script + " " + (string)(++i)) == INVENTORY_SCRIPT)
|
||||
;
|
||||
if (llGetInventoryKey(notecard_name) != notecard_key || i != llGetListLength(SITTERS) || llGetInventoryType(memoryscript) != INVENTORY_SCRIPT)
|
||||
{
|
||||
end_sitter();
|
||||
llResetScript();
|
||||
|
@ -1027,7 +1109,8 @@ default
|
|||
llMessageLinked(LINK_THIS, lnk, posename, channel_or_swap);
|
||||
if (wrong_primcount && WARN)
|
||||
{
|
||||
primcount_error();
|
||||
// primcount_error() inlined here:
|
||||
llDialog(llGetOwner(), "\nThere aren't enough prims for required SitTargets.\nYou must have one prim for each avatar to sit!", ["OK"], 23658);
|
||||
}
|
||||
else if (!MTYPE)
|
||||
{
|
||||
|
|
|
@ -63,18 +63,6 @@ send_anim_info(integer broadcast)
|
|||
llMessageLinked(LINK_THIS, 90055, (string)SCRIPT_CHANNEL, llDumpList2String([llList2String(MENU_LIST, ANIM_INDEX), llList2String(DATA_LIST, ANIM_INDEX), llList2String(POS_ROT_LIST, ANIM_INDEX * 2), llList2String(POS_ROT_LIST, ANIM_INDEX * 2 + 1), broadcast, speed_index], "|"));
|
||||
}
|
||||
|
||||
// LSL::
|
||||
Readout_Say(string say)
|
||||
{
|
||||
llMessageLinked(LINK_THIS, 90022, say, (string)SCRIPT_CHANNEL);
|
||||
}
|
||||
// ::LSL
|
||||
|
||||
list order_buttons(list buttons)
|
||||
{
|
||||
return llList2List(buttons, -3, -1) + llList2List(buttons, -6, -4) + llList2List(buttons, -9, -7) + llList2List(buttons, -12, -10);
|
||||
}
|
||||
|
||||
memory()
|
||||
{
|
||||
llOwnerSay(llGetScriptName() + "[" + version + "] " + (string)llGetListLength(MENU_LIST) + " Items Ready, Mem=" + (string)(65536 - llGetUsedMemory()));
|
||||
|
@ -102,24 +90,20 @@ integer animation_menu(integer animation_menu_function)
|
|||
}
|
||||
if (SITTER_INFO != "")
|
||||
{
|
||||
menu += "[" + llList2String(llParseStringKeepNulls(SITTER_INFO, [SEP], []), 0) + "]";
|
||||
menu += "[" + llList2String(llParseStringKeepNulls(SITTER_INFO, [SEP], []), 0);
|
||||
menu += "]";
|
||||
}
|
||||
else if (number_of_sitters > 1)
|
||||
{
|
||||
menu += "[Sitter " + (string)SCRIPT_CHANNEL + "]";
|
||||
}
|
||||
integer anim_has_speeds;
|
||||
string animation_file = llList2String(llParseStringKeepNulls(llList2String(DATA_LIST, ANIM_INDEX), [SEP], []), 0);
|
||||
if (llGetInventoryType(animation_file + "+") == INVENTORY_ANIMATION)
|
||||
{
|
||||
anim_has_speeds = TRUE;
|
||||
}
|
||||
string CURRENT_POSE_NAME;
|
||||
if (FIRST_INDEX != -1)
|
||||
{
|
||||
CURRENT_POSE_NAME = llList2String(MENU_LIST, ANIM_INDEX);
|
||||
menu += " [" + llList2String(llParseString2List(CURRENT_POSE_NAME, ["P:"], []), 0);
|
||||
if (anim_has_speeds)
|
||||
if (llGetInventoryType(animation_file + "+") == INVENTORY_ANIMATION)
|
||||
{
|
||||
if (speed_index < 0)
|
||||
{
|
||||
|
@ -134,9 +118,10 @@ integer animation_menu(integer animation_menu_function)
|
|||
}
|
||||
integer total_items;
|
||||
integer i = current_menu + 1;
|
||||
while (i++ < llGetListLength(MENU_LIST) && llSubStringIndex(llList2String(MENU_LIST, i), "M:"))
|
||||
while (i < llGetListLength(MENU_LIST) && llSubStringIndex(llList2String(MENU_LIST, i), "M:"))
|
||||
{
|
||||
++total_items;
|
||||
++i;
|
||||
}
|
||||
list menu_items0;
|
||||
list menu_items2;
|
||||
|
@ -154,14 +139,12 @@ integer animation_menu(integer animation_menu_function)
|
|||
menu_items2 += "[NEW]";
|
||||
if (CURRENT_POSE_NAME != "")
|
||||
{
|
||||
menu_items2 += "[DUMP]";
|
||||
menu_items2 += "[SAVE]";
|
||||
menu_items2 = menu_items2 + "[DUMP]" + "[SAVE]";
|
||||
}
|
||||
}
|
||||
else if (llSubStringIndex(submenu_info, "V") != -1)
|
||||
{
|
||||
menu_items0 += "<< Softer";
|
||||
menu_items0 += "Harder >>";
|
||||
menu_items0 = menu_items0 + "<< Softer" + "Harder >>";
|
||||
}
|
||||
if (AMENU == 2 || (AMENU == 1 && current_menu == -1) || llSubStringIndex(submenu_info, "A") != -1)
|
||||
{
|
||||
|
@ -181,14 +164,14 @@ integer animation_menu(integer animation_menu_function)
|
|||
menu_items2 += "[STOP]";
|
||||
if (!helper_mode)
|
||||
{
|
||||
menu_items2 += ["Control..."];
|
||||
menu_items2 += "Control...";
|
||||
}
|
||||
}
|
||||
}
|
||||
integer items_per_page = 12 - llGetListLength(menu_items2) - llGetListLength(menu_items0);
|
||||
if (items_per_page < total_items)
|
||||
{
|
||||
menu_items2 += ["[<<]", "[>>]"];
|
||||
menu_items2 = menu_items2 + "[<<]" + "[>>]";
|
||||
items_per_page -= 2;
|
||||
}
|
||||
list menu_items1;
|
||||
|
@ -216,12 +199,7 @@ integer animation_menu(integer animation_menu_function)
|
|||
@end;
|
||||
if (animation_menu_function == 1)
|
||||
{
|
||||
integer pages = total_items / (12 - llGetListLength(menu_items2) - llGetListLength(menu_items0));
|
||||
if ((total_items % (12 - llGetListLength(menu_items2) - llGetListLength(menu_items0))) == 0)
|
||||
{
|
||||
pages--;
|
||||
}
|
||||
return pages;
|
||||
return (total_items + items_per_page - 1) / items_per_page - 1;
|
||||
}
|
||||
if (submenu_info == "V")
|
||||
{
|
||||
|
@ -232,7 +210,12 @@ integer animation_menu(integer animation_menu_function)
|
|||
}
|
||||
llListenRemove(menu_handle);
|
||||
menu_handle = llListen(menu_channel, "", CONTROLLER, "");
|
||||
llDialog(CONTROLLER, menu, order_buttons(menu_items0 + menu_items1 + menu_items2), menu_channel);
|
||||
menu_items0 = menu_items0 + menu_items1 + menu_items2;
|
||||
menu_items1 = llList2List(menu_items0, -3, -1);
|
||||
menu_items1 += llList2List(menu_items0, -6 ,-4);
|
||||
menu_items1 += llList2List(menu_items0, -9 ,-7);
|
||||
menu_items1 += llList2List(menu_items0, -12 ,-10);
|
||||
llDialog(CONTROLLER, menu, menu_items1, menu_channel);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -389,30 +372,25 @@ default
|
|||
{
|
||||
integer one = (integer)msg;
|
||||
integer two = (integer)((string)id);
|
||||
integer index;
|
||||
list data;
|
||||
if (num == 90000 || num == 90010 || num == 90003)
|
||||
{
|
||||
integer index = llListFindList(MENU_LIST, [msg]);
|
||||
index = llListFindList(MENU_LIST, [msg]);
|
||||
if (index == -1)
|
||||
{
|
||||
index = llListFindList(MENU_LIST, ["P:" + msg]);
|
||||
}
|
||||
integer doit;
|
||||
if (id == "")
|
||||
if (id) // OSS::if (osIsUUID(id) && id != NULL_KEY)
|
||||
{
|
||||
doit = TRUE;
|
||||
// do nothing
|
||||
}
|
||||
else if (id) // OSS::else if (osIsUUID(id) && id != NULL_KEY)
|
||||
else if (id != "")
|
||||
{
|
||||
if (id == MY_SITTER)
|
||||
{
|
||||
doit = TRUE;
|
||||
}
|
||||
// assumed numeric - replace it with a "*" so we can test for it
|
||||
id = "*";
|
||||
}
|
||||
else if (two == SCRIPT_CHANNEL)
|
||||
{
|
||||
doit = TRUE;
|
||||
}
|
||||
if (doit && (index != -1 || msg == ""))
|
||||
if ((id == "" || id == MY_SITTER || (id == "*" && two == SCRIPT_CHANNEL)) && (index != -1 || msg == ""))
|
||||
{
|
||||
ANIM_INDEX = index;
|
||||
integer broadcast = TRUE;
|
||||
|
@ -429,29 +407,31 @@ default
|
|||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
else if (num == 90045 && sender == llGetLinkNumber() && (ETYPE == 1 || ETYPE == 2))
|
||||
if (num == 90045 && sender == llGetLinkNumber() && (ETYPE == 1 || ETYPE == 2))
|
||||
{
|
||||
list data = llParseStringKeepNulls(msg, ["|"], []);
|
||||
string OLD_SYNC = llList2String(data, 5);
|
||||
string OLD_SYNC = llList2String(llParseStringKeepNulls(msg, ["|"], data), 5);
|
||||
if (OLD_SYNC != "" && llList2String(MENU_LIST, ANIM_INDEX) == OLD_SYNC)
|
||||
{
|
||||
ANIM_INDEX = FIRST_INDEX;
|
||||
send_anim_info(TRUE);
|
||||
}
|
||||
return;
|
||||
}
|
||||
else if (num == 90033)
|
||||
if (num == 90033)
|
||||
{
|
||||
llListenRemove(menu_handle);
|
||||
return;
|
||||
}
|
||||
else if (num == 90004 || num == 90005)
|
||||
if (num == 90004 || num == 90005)
|
||||
{
|
||||
list data = llParseStringKeepNulls(id, ["|"], []);
|
||||
if ((key)llList2String(data, -1) == MY_SITTER)
|
||||
data = llParseStringKeepNulls(id, ["|"], data);
|
||||
if (llList2Key(data, -1) == MY_SITTER)
|
||||
{
|
||||
key lastController = CONTROLLER;
|
||||
CONTROLLER = (key)llList2String(data, 0);
|
||||
integer index = llListFindList(MENU_LIST, ["M:" + msg + "*"]);
|
||||
CONTROLLER = llList2Key(data, 0);
|
||||
index = llListFindList(MENU_LIST, ["M:" + msg + "*"]);
|
||||
if (num == 90004)
|
||||
{
|
||||
current_menu = -1;
|
||||
|
@ -465,55 +445,61 @@ default
|
|||
}
|
||||
animation_menu((integer)msg);
|
||||
}
|
||||
return;
|
||||
}
|
||||
else if (num == 90030 && (one == SCRIPT_CHANNEL || two == SCRIPT_CHANNEL))
|
||||
if (num == 90030 && (one == SCRIPT_CHANNEL || two == SCRIPT_CHANNEL))
|
||||
{
|
||||
CONTROLLER = MY_SITTER = "";
|
||||
return;
|
||||
}
|
||||
else if (num == 90100 || num == 90101)
|
||||
if (num == 90100 || num == 90101)
|
||||
{
|
||||
list data = llParseStringKeepNulls(msg, ["|"], []);
|
||||
if (llList2String(data, 1) == "[HELPER]")
|
||||
// reuse msg to save a local
|
||||
msg = llList2String((data = llParseStringKeepNulls(msg, ["|"], data)), 1);
|
||||
if (msg == "[HELPER]")
|
||||
{
|
||||
menu_page = 0;
|
||||
helper_mode = !helper_mode;
|
||||
if ((key)llList2String(data, 2) == MY_SITTER && !OLD_HELPER_METHOD)
|
||||
if (llList2Key(data, 2) == MY_SITTER && !OLD_HELPER_METHOD)
|
||||
{
|
||||
animation_menu(0);
|
||||
}
|
||||
}
|
||||
else if (llList2String(data, 1) == "[ADJUST]")
|
||||
if (msg == "[ADJUST]")
|
||||
{
|
||||
helper_mode = FALSE;
|
||||
menu_page = 0;
|
||||
}
|
||||
else if (llList2String(data, 1) == "Harder >>")
|
||||
if (msg == "Harder >>")
|
||||
{
|
||||
++speed_index;
|
||||
if (speed_index > 1)
|
||||
speed_index = 1;
|
||||
send_anim_info(FALSE);
|
||||
}
|
||||
else if (llList2String(data, 1) == "<< Softer")
|
||||
if (msg == "<< Softer")
|
||||
{
|
||||
--speed_index;
|
||||
if (speed_index < -1)
|
||||
speed_index = -1;
|
||||
send_anim_info(FALSE);
|
||||
}
|
||||
return;
|
||||
}
|
||||
else if (num == 90201)
|
||||
if (num == 90201)
|
||||
{
|
||||
has_RLV = FALSE;
|
||||
return;
|
||||
}
|
||||
else if (num == 90202)
|
||||
if (num == 90202)
|
||||
{
|
||||
has_RLV = (integer)msg;
|
||||
return;
|
||||
}
|
||||
else if (one == SCRIPT_CHANNEL)
|
||||
if (one == SCRIPT_CHANNEL)
|
||||
{
|
||||
list data = llParseStringKeepNulls(id, ["|"], []);
|
||||
integer index = llListFindList(MENU_LIST, [llList2String(data, 0)]);
|
||||
data = llParseStringKeepNulls(id, ["|"], data);
|
||||
index = llListFindList(MENU_LIST, [llList2String(data, 0)]);
|
||||
if (index == -1)
|
||||
{
|
||||
index = llListFindList(MENU_LIST, ["P:" + llList2String(data, 0)]);
|
||||
|
@ -521,21 +507,24 @@ default
|
|||
if (num == 90299)
|
||||
{
|
||||
MENU_LIST = DATA_LIST = POS_ROT_LIST = [];
|
||||
return;
|
||||
}
|
||||
else if (num == 90070)
|
||||
if (num == 90070)
|
||||
{
|
||||
CONTROLLER = MY_SITTER = id;
|
||||
menu_page = 0;
|
||||
current_menu = -1;
|
||||
menu_channel = ((integer)llFrand(0x7FFFFF80) + 1) * -1; // 7FFFFF80 = max float < 2^31
|
||||
llListenRemove(menu_handle);
|
||||
return;
|
||||
}
|
||||
else if (num == 90065 && sender == llGetLinkNumber())
|
||||
if (num == 90065 && sender == llGetLinkNumber())
|
||||
{
|
||||
CONTROLLER = MY_SITTER = "";
|
||||
llListenRemove(menu_handle);
|
||||
return;
|
||||
}
|
||||
else if (num == 90300)
|
||||
if (num == 90300)
|
||||
{
|
||||
integer place_to_add = llGetListLength(MENU_LIST);
|
||||
if (llGetListLength(data) > 2)
|
||||
|
@ -568,8 +557,9 @@ default
|
|||
send_anim_info(TRUE);
|
||||
memory();
|
||||
}
|
||||
return;
|
||||
}
|
||||
else if (num == 90301)
|
||||
if (num == 90301)
|
||||
{
|
||||
if (index != -1)
|
||||
{
|
||||
|
@ -579,35 +569,47 @@ default
|
|||
send_anim_info(FALSE);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
else if (num == 90302)
|
||||
if (num == 90302)
|
||||
{
|
||||
number_of_sitters = (integer)llList2String(data, 0);
|
||||
number_of_sitters = llList2Integer(data, 0);
|
||||
SITTER_INFO = llList2String(data, 1);
|
||||
SET = (integer)llList2String(data, 2);
|
||||
MTYPE = (integer)llList2String(data, 3);
|
||||
ETYPE = (integer)llList2String(data, 4);
|
||||
SWAP = (integer)llList2String(data, 5);
|
||||
SET = llList2Integer(data, 2);
|
||||
MTYPE = llList2Integer(data, 3);
|
||||
ETYPE = llList2Integer(data, 4);
|
||||
SWAP = llList2Integer(data, 5);
|
||||
FIRST_INDEX = ANIM_INDEX = llListFindList(MENU_LIST, [llList2String(data, 6)]);
|
||||
BRAND = llList2String(data, 7);
|
||||
CUSTOM_TEXT = llList2String(data, 8);
|
||||
ADJUST_MENU = llList2String(data, 9);
|
||||
SELECT = (integer)llList2String(data, 10);
|
||||
AMENU = (integer)llList2String(data, 11);
|
||||
OLD_HELPER_METHOD = (integer)llList2String(data, 12);
|
||||
SELECT = llList2Integer(data, 10);
|
||||
AMENU = llList2Integer(data, 11);
|
||||
OLD_HELPER_METHOD = llList2Integer(data, 12);
|
||||
RLVDesignations = llList2String(data, 13);
|
||||
onSit = llList2String(data, 14);
|
||||
memory();
|
||||
return;
|
||||
}
|
||||
// LSL::
|
||||
else if (num == 90020 && llList2String(data, 0) == "")
|
||||
if (num == 90020 && llList2String(data, 0) == "")
|
||||
{
|
||||
Readout_Say("V:" + llDumpList2String([version, MTYPE, ETYPE, SET, SWAP, SITTER_INFO, CUSTOM_TEXT, ADJUST_MENU, SELECT, AMENU, OLD_HELPER_METHOD], "|"));
|
||||
llMessageLinked(LINK_THIS, 90022
|
||||
, "V:" + llDumpList2String(
|
||||
[version, MTYPE, ETYPE, SET, SWAP, SITTER_INFO,
|
||||
CUSTOM_TEXT, ADJUST_MENU, SELECT, AMENU,
|
||||
OLD_HELPER_METHOD], "|")
|
||||
, (string)SCRIPT_CHANNEL
|
||||
);
|
||||
integer i = -1;
|
||||
while (++i < llGetListLength(MENU_LIST))
|
||||
{
|
||||
llSleep(0.5);
|
||||
Readout_Say("S:" + llList2String(MENU_LIST, i) + "|" + llList2String(DATA_LIST, i));
|
||||
llMessageLinked(LINK_THIS, 90022
|
||||
, "S:" + llList2String(MENU_LIST, i)
|
||||
+ "|" + llList2String(DATA_LIST, i)
|
||||
, (string)SCRIPT_CHANNEL
|
||||
);
|
||||
}
|
||||
i = -1;
|
||||
while (++i < llGetListLength(MENU_LIST))
|
||||
|
@ -615,19 +617,29 @@ default
|
|||
if (llList2Vector(POS_ROT_LIST, i * 2) != ZERO_VECTOR)
|
||||
{
|
||||
llSleep(0.2);
|
||||
Readout_Say("{" + llList2String(MENU_LIST, i) + "}" + llList2String(POS_ROT_LIST, i * 2) + llList2String(POS_ROT_LIST, i * 2 + 1));
|
||||
llMessageLinked(LINK_THIS, 90022
|
||||
, "{" + llList2String(MENU_LIST, i) + "}"
|
||||
+ llList2String(POS_ROT_LIST, i * 2)
|
||||
+ llList2String(POS_ROT_LIST, i * 2 + 1)
|
||||
, (string)SCRIPT_CHANNEL
|
||||
);
|
||||
}
|
||||
}
|
||||
llMessageLinked(LINK_THIS, 90021, (string)SCRIPT_CHANNEL, "");
|
||||
return;
|
||||
}
|
||||
// ::LSL
|
||||
/* OSS::
|
||||
else if (num == 90020 && llList2String(data, 0) == "")
|
||||
if (num == 90020)
|
||||
{
|
||||
llMessageLinked(LINK_THIS, 90022, "V:" + llDumpList2String([version, MTYPE, ETYPE, SET, SWAP, SITTER_INFO, CUSTOM_TEXT, ADJUST_MENU, SELECT, AMENU, OLD_HELPER_METHOD], "|"), (string)SCRIPT_CHANNEL);
|
||||
llMessageLinked(LINK_THIS, 90024, (string)SCRIPT_CHANNEL, "-1|D");
|
||||
if (llList2String(data, 0) == "")
|
||||
{
|
||||
llMessageLinked(LINK_THIS, 90022, "V:" + llDumpList2String([version, MTYPE, ETYPE, SET, SWAP, SITTER_INFO, CUSTOM_TEXT, ADJUST_MENU, SELECT, AMENU, OLD_HELPER_METHOD], "|"), (string)SCRIPT_CHANNEL);
|
||||
llMessageLinked(LINK_THIS, 90024, (string)SCRIPT_CHANNEL, "-1|D");
|
||||
}
|
||||
return;
|
||||
}
|
||||
else if (num == 90024) // self-sent message to dump the next line
|
||||
if (num == 90024) // self-sent message to dump the next line
|
||||
{
|
||||
if (llList2String(data, 1) == "D")
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue