first commit
This commit is contained in:
parent
e7d01132b3
commit
34f30ac80a
48 changed files with 13160 additions and 534 deletions
236
AVsitter2/Plugins/AVcamera/[AV]camera.lsl
Normal file
236
AVsitter2/Plugins/AVcamera/[AV]camera.lsl
Normal file
|
@ -0,0 +1,236 @@
|
|||
/*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* Copyright (c) the AVsitter Contributors (http://avsitter.github.io)
|
||||
* AVsitter™ is a trademark. For trademark use policy see:
|
||||
* https://avsitter.github.io/TRADEMARK.mediawiki
|
||||
*
|
||||
* Please consider supporting continued development of AVsitter and
|
||||
* receive automatic updates and other benefits! All details and user
|
||||
* instructions can be found at http://avsitter.github.io
|
||||
*/
|
||||
|
||||
string version = "2.2";
|
||||
string notecard_name = "AVpos";
|
||||
string main_script = "[AV]sitA";
|
||||
key notecard_key;
|
||||
key notecard_query;
|
||||
integer notecard_line;
|
||||
integer notecard_section;
|
||||
integer SCRIPT_CHANNEL;
|
||||
string myPose;
|
||||
key mySitter;
|
||||
list camera_triggers;
|
||||
list camera_settings;
|
||||
integer lastByButton = -1;
|
||||
string lastPose;
|
||||
integer get_number_of_scripts()
|
||||
{
|
||||
integer i = 1;
|
||||
while (llGetInventoryType(main_script + " " + (string)i) == INVENTORY_SCRIPT)
|
||||
{
|
||||
i++;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
integer verbose = 0;
|
||||
Out(integer level, string out)
|
||||
{
|
||||
if (verbose >= level)
|
||||
{
|
||||
llOwnerSay(llGetScriptName() + "[" + version + "] " + out);
|
||||
}
|
||||
}
|
||||
Readout_Say(string say, string SCRIPT_CHANNEL)
|
||||
{
|
||||
llSleep(0.2);
|
||||
llMessageLinked(LINK_THIS, 90022, say, SCRIPT_CHANNEL);
|
||||
}
|
||||
set_camera(integer byButton)
|
||||
{
|
||||
if (mySitter)
|
||||
{
|
||||
if (llGetPermissions() & PERMISSION_CONTROL_CAMERA)
|
||||
{
|
||||
if (llGetPermissionsKey() == mySitter)
|
||||
{
|
||||
integer index = llListFindList(camera_triggers, [myPose]);
|
||||
if (!~index)
|
||||
{
|
||||
if (~lastByButton)
|
||||
{
|
||||
index = lastByButton;
|
||||
}
|
||||
else
|
||||
{
|
||||
index = llListFindList(camera_triggers, ["DEFAULT"]);
|
||||
}
|
||||
}
|
||||
if (~index)
|
||||
{
|
||||
if (byButton)
|
||||
{
|
||||
lastByButton = index;
|
||||
}
|
||||
list settings = llParseStringKeepNulls(llList2String(camera_settings, index), ["|"], []);
|
||||
vector pos = (vector)llList2String(settings, 0) * llGetRot() + llGetPos();
|
||||
vector focus = (vector)llList2String(settings, 1) * llGetRot() + llGetPos();
|
||||
llSetCameraParams([CAMERA_ACTIVE, 1, CAMERA_FOCUS, focus, CAMERA_FOCUS_LOCKED, TRUE, CAMERA_POSITION, pos, CAMERA_POSITION_LOCKED, TRUE, CAMERA_FOCUS_OFFSET, <0,0,0>]);
|
||||
}
|
||||
else
|
||||
{
|
||||
llSetCameraParams([CAMERA_ACTIVE, 0]);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
llRequestPermissions(mySitter, PERMISSION_CONTROL_CAMERA);
|
||||
}
|
||||
}
|
||||
default
|
||||
{
|
||||
run_time_permissions(integer perm)
|
||||
{
|
||||
if (perm & PERMISSION_CONTROL_CAMERA)
|
||||
{
|
||||
set_camera(FALSE);
|
||||
}
|
||||
}
|
||||
state_entry()
|
||||
{
|
||||
SCRIPT_CHANNEL = (integer)llGetSubString(llGetScriptName(), llSubStringIndex(llGetScriptName(), " "), -1);
|
||||
notecard_key = llGetInventoryKey(notecard_name);
|
||||
if (llGetInventoryType(notecard_name) == INVENTORY_NOTECARD)
|
||||
{
|
||||
Out(0, "Loading...");
|
||||
notecard_query = llGetNotecardLine(notecard_name, 0);
|
||||
}
|
||||
}
|
||||
link_message(integer sender, integer num, string msg, key id)
|
||||
{
|
||||
if (sender == llGetLinkNumber())
|
||||
{
|
||||
if (num == 90230 | num == 90231)
|
||||
{
|
||||
list data = llParseStringKeepNulls(id, ["|"], []);
|
||||
key this_controller = (key)llList2String(data, 0);
|
||||
key this_sitter = (key)llList2String(data, -1);
|
||||
if (this_sitter == mySitter)
|
||||
{
|
||||
myPose = msg;
|
||||
if (myPose == "RESET")
|
||||
{
|
||||
lastByButton = -1;
|
||||
myPose = lastPose;
|
||||
}
|
||||
set_camera(TRUE);
|
||||
if (num == 90230)
|
||||
{
|
||||
llMessageLinked(LINK_THIS, 90005, "", this_controller);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (num == 90045)
|
||||
{
|
||||
list data = llParseStringKeepNulls(msg, ["|"], []);
|
||||
integer sitter = (integer)llList2String(data, 0);
|
||||
if (sitter == SCRIPT_CHANNEL)
|
||||
{
|
||||
mySitter = id;
|
||||
myPose = llList2String(data, 1);
|
||||
lastPose = myPose;
|
||||
set_camera(FALSE);
|
||||
}
|
||||
}
|
||||
else if (num == 90065)
|
||||
{
|
||||
if (id == mySitter)
|
||||
{
|
||||
lastByButton = -1;
|
||||
mySitter = NULL_KEY;
|
||||
}
|
||||
else
|
||||
{
|
||||
llSleep(0.1);
|
||||
set_camera(FALSE);
|
||||
}
|
||||
}
|
||||
else if (num == 90174 && (integer)msg == SCRIPT_CHANNEL)
|
||||
{
|
||||
integer i = llGetListLength(camera_triggers);
|
||||
integer index;
|
||||
while (~(index = llListFindList(camera_triggers, [myPose])))
|
||||
{
|
||||
camera_triggers = llDeleteSubList(camera_triggers, index, index);
|
||||
camera_settings = llDeleteSubList(camera_settings, index, index);
|
||||
}
|
||||
if (id != "none")
|
||||
{
|
||||
camera_triggers += myPose;
|
||||
camera_settings += (string)id;
|
||||
llSay(0, "CAMERA saved to '" + myPose + "' for SITTER " + (string)SCRIPT_CHANNEL + ".");
|
||||
llSay(0, "CAMERA " + myPose + "|" + (string)id);
|
||||
}
|
||||
else
|
||||
{
|
||||
llSay(0, "CAMERA cleared from '" + myPose + "' for SITTER " + (string)SCRIPT_CHANNEL + ".");
|
||||
}
|
||||
set_camera(FALSE);
|
||||
}
|
||||
else if (num == 90020 && ((string)id == llGetScriptName() || (string)id + " " + msg == llGetScriptName()))
|
||||
{
|
||||
if ((integer)msg == SCRIPT_CHANNEL)
|
||||
{
|
||||
integer i;
|
||||
for (i = 0; i < llGetListLength(camera_triggers); i++)
|
||||
{
|
||||
Readout_Say("CAMERA " + llList2String(camera_triggers, i) + "|" + llList2String(camera_settings, i), msg);
|
||||
}
|
||||
llMessageLinked(LINK_THIS, 90021, msg, (string)id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
changed(integer change)
|
||||
{
|
||||
if (change & CHANGED_INVENTORY)
|
||||
{
|
||||
if (llGetInventoryKey(notecard_name) != notecard_key)
|
||||
{
|
||||
llResetScript();
|
||||
}
|
||||
}
|
||||
}
|
||||
dataserver(key query_id, string data)
|
||||
{
|
||||
if (query_id == notecard_query)
|
||||
{
|
||||
if (data == EOF)
|
||||
{
|
||||
Out(0, (string)llGetListLength(camera_triggers) + " Cameras Ready, Mem=" + (string)llGetFreeMemory());
|
||||
}
|
||||
else
|
||||
{
|
||||
data = llGetSubString(data, llSubStringIndex(data, "◆") + 1, -1);
|
||||
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;
|
||||
}
|
||||
else if (notecard_section == SCRIPT_CHANNEL && command == "CAMERA")
|
||||
{
|
||||
string part1 = llStringTrim(llDumpList2String(llList2List(parts, 1, -1), "|"), STRING_TRIM);
|
||||
list sequence = llParseString2List(part1, ["|"], []);
|
||||
camera_triggers += part0;
|
||||
camera_settings += part1;
|
||||
}
|
||||
notecard_query = llGetNotecardLine(notecard_name, notecard_line += 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,3 +1,17 @@
|
|||
/*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* Copyright (c) the AVsitter Contributors (http://avsitter.github.io)
|
||||
* AVsitter™ is a trademark. For trademark use policy see:
|
||||
* https://avsitter.github.io/TRADEMARK.mediawiki
|
||||
*
|
||||
* Please consider supporting continued development of AVsitter and
|
||||
* receive automatic updates and other benefits! All details and user
|
||||
* instructions can be found at http://avsitter.github.io
|
||||
*/
|
||||
|
||||
// Placed in prop objects, this script sends the uuid of any Lockguard rings to the script in furniture.
|
||||
// Ring prims in the prop should be named with "ring" in their prim name. e.g. "ring1", "ring2"
|
||||
|
||||
|
|
|
@ -1,12 +1,21 @@
|
|||
// LSL-AVSITTER-LockGuard-PLUGIN
|
||||
// Copyright (c) 2016
|
||||
// Permission given to modify and adapt this script
|
||||
//
|
||||
/*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* Copyright (c) the AVsitter Contributors (http://avsitter.github.io)
|
||||
* AVsitter™ is a trademark. For trademark use policy see:
|
||||
* https://avsitter.github.io/TRADEMARK.mediawiki
|
||||
*
|
||||
* Please consider supporting continued development of AVsitter and
|
||||
* receive automatic updates and other benefits! All details and user
|
||||
* instructions can be found at http://avsitter.github.io
|
||||
*/
|
||||
|
||||
// For use attaching particle chains to LockGuard V2 compatible cuffs such as Open Collar
|
||||
// This script should be placed inside the prim that contains your poses and props.
|
||||
// Inspiration and function (not code) from the Bright CISS system by Shan Bright & Innula Zenovka.
|
||||
|
||||
|
||||
// SITTER:
|
||||
// The AVsitter SITTER # the cuff settings are for.
|
||||
|
||||
|
|
188
AVsitter2/Plugins/AVcontrol/Xcite!-Sensations/[AV]Xcite!.lsl
Normal file
188
AVsitter2/Plugins/AVcontrol/Xcite!-Sensations/[AV]Xcite!.lsl
Normal file
|
@ -0,0 +1,188 @@
|
|||
/*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* Copyright (c) the AVsitter Contributors (http://avsitter.github.io)
|
||||
* AVsitter™ is a trademark. For trademark use policy see:
|
||||
* https://avsitter.github.io/TRADEMARK.mediawiki
|
||||
*
|
||||
* Please consider supporting continued development of AVsitter and
|
||||
* receive automatic updates and other benefits! All details and user
|
||||
* instructions can be found at http://avsitter.github.io
|
||||
*/
|
||||
|
||||
string product = "AVsitter™ Xcite!";
|
||||
string version = "1.02";
|
||||
string notecard_name = "[AV]Xcite_settings";
|
||||
key notecard_key;
|
||||
key notecard_query;
|
||||
integer notecard_line;
|
||||
integer verbose = 0;
|
||||
list POSE_AND_SITTER;
|
||||
list XCITE_COMMANDS;
|
||||
list XCITE_TILT;
|
||||
integer TIMER_DEFAULT = 30;
|
||||
string CURRENT_POSE;
|
||||
list TIMERS;
|
||||
list SITTERS;
|
||||
integer DEBUG;
|
||||
Out(integer level, string out)
|
||||
{
|
||||
if (verbose >= level)
|
||||
{
|
||||
llOwnerSay(llGetScriptName() + "[" + version + "]:" + out);
|
||||
}
|
||||
}
|
||||
key key_request;
|
||||
string parse_text(string say)
|
||||
{
|
||||
integer i;
|
||||
for (i = 0; i < llGetListLength(SITTERS); i++)
|
||||
{
|
||||
string sitter_name = llList2String(llParseString2List(llKey2Name(llList2String(SITTERS, i)), [" "], []), 0);
|
||||
if (sitter_name == "")
|
||||
{
|
||||
sitter_name = "(nobody)";
|
||||
}
|
||||
say = strReplace(say, "/" + (string)i, sitter_name);
|
||||
}
|
||||
return say;
|
||||
}
|
||||
string strReplace(string str, string search, string replace)
|
||||
{
|
||||
return llDumpList2String(llParseStringKeepNulls(str, [search], []), replace);
|
||||
}
|
||||
default
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
notecard_key = llGetInventoryKey(notecard_name);
|
||||
Out(0, "Loading...");
|
||||
notecard_query = llGetNotecardLine(notecard_name, 0);
|
||||
}
|
||||
changed(integer change)
|
||||
{
|
||||
if (change & CHANGED_INVENTORY)
|
||||
{
|
||||
if (llGetInventoryKey(notecard_name) != notecard_key)
|
||||
{
|
||||
llResetScript();
|
||||
}
|
||||
}
|
||||
if (change & CHANGED_LINK)
|
||||
{
|
||||
if (llGetAgentSize(llGetLinkKey(llGetNumberOfPrims())) == ZERO_VECTOR)
|
||||
{
|
||||
TIMERS = [];
|
||||
}
|
||||
}
|
||||
}
|
||||
link_message(integer sender, integer num, string msg, key id)
|
||||
{
|
||||
if (sender == llGetLinkNumber())
|
||||
{
|
||||
if (num == 90045)
|
||||
{
|
||||
string name = llKey2Name(id);
|
||||
if (name != "")
|
||||
{
|
||||
integer i = llGetListLength(TIMERS);
|
||||
while (i > 0)
|
||||
{
|
||||
i--;
|
||||
if (!llSubStringIndex(llList2String(TIMERS, i), name + "|"))
|
||||
{
|
||||
TIMERS = llDeleteSubList(TIMERS, i, i);
|
||||
}
|
||||
}
|
||||
llSetTimerEvent(TIMER_DEFAULT);
|
||||
list data = llParseStringKeepNulls(msg, ["|"], []);
|
||||
integer script_channel = (integer)llList2String(data, 0);
|
||||
CURRENT_POSE = llList2String(data, 1);
|
||||
SITTERS = llParseStringKeepNulls(llList2String(data, 4), ["@"], []);
|
||||
integer index = llListFindList(POSE_AND_SITTER, [CURRENT_POSE + "|" + (string)script_channel]);
|
||||
if (!~index)
|
||||
{
|
||||
index = llListFindList(POSE_AND_SITTER, [CURRENT_POSE + "|*"]);
|
||||
if (!~index)
|
||||
{
|
||||
index = llListFindList(POSE_AND_SITTER, ["*|*"]);
|
||||
if (!~index)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (llList2Integer(XCITE_TILT, index) != 0)
|
||||
{
|
||||
if (DEBUG)
|
||||
{
|
||||
Out(0, "Setting " + name + "'s tilt to " + (string)llList2Integer(XCITE_TILT, index));
|
||||
}
|
||||
llMessageLinked(LINK_SET, 20020, name + "|" + (string)llList2Integer(XCITE_TILT, index), "");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (DEBUG)
|
||||
{
|
||||
Out(0, "Restoring " + name + "'s tilt.");
|
||||
}
|
||||
llMessageLinked(LINK_SET, 20014, name, "");
|
||||
}
|
||||
data = llParseStringKeepNulls(llList2String(XCITE_COMMANDS, index), ["|"], []);
|
||||
TIMERS += [name + "|" + llList2String(data, 0) + "|" + llList2String(data, 1) + "||" + llList2String(data, 3)];
|
||||
string commands = parse_text(llList2String(XCITE_COMMANDS, index));
|
||||
llMessageLinked(LINK_SET, 20001, name + "|" + commands, NULL_KEY);
|
||||
if (DEBUG)
|
||||
{
|
||||
Out(0, "Sending xcite commands: " + name + "|" + commands);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
timer()
|
||||
{
|
||||
integer i;
|
||||
for (; i < llGetListLength(TIMERS); i++)
|
||||
{
|
||||
llMessageLinked(LINK_SET, 20001, llList2String(TIMERS, i), NULL_KEY);
|
||||
if (DEBUG)
|
||||
{
|
||||
Out(0, "Sending xcite commands: " + llList2String(TIMERS, i));
|
||||
}
|
||||
}
|
||||
}
|
||||
dataserver(key query_id, string data)
|
||||
{
|
||||
if (query_id == notecard_query)
|
||||
{
|
||||
if (data == EOF || llStringTrim(llToLower(data), STRING_TRIM) == "end")
|
||||
{
|
||||
Out(0, (string)llGetListLength(POSE_AND_SITTER) + " items Ready, Mem=" + (string)llGetFreeMemory());
|
||||
}
|
||||
else
|
||||
{
|
||||
data = llStringTrim(data, STRING_TRIM);
|
||||
string command = llGetSubString(data, 0, llSubStringIndex(data, " ") - 1);
|
||||
list parts = llParseStringKeepNulls(llGetSubString(data, llSubStringIndex(data, " ") + 1, -1), [" | ", " |", "| ", "|"], []);
|
||||
if (command == "TIMER")
|
||||
{
|
||||
TIMER_DEFAULT = (integer)llList2String(parts, 0);
|
||||
}
|
||||
else if (command == "DEBUG")
|
||||
{
|
||||
DEBUG = (integer)llList2String(parts, 0);
|
||||
}
|
||||
else 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);
|
||||
}
|
||||
notecard_query = llGetNotecardLine(notecard_name, ++notecard_line);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,72 @@
|
|||
#############################################################
|
||||
Example Xcite! notecard for use with AVsitter™ Xcite! plugin.
|
||||
#############################################################
|
||||
//
|
||||
// Your object MUST contain your Xcite! partner script (provided by Xcite!) and/or your Sensations partner script (provided by Sensations).
|
||||
//
|
||||
// Please refer to your Xcite! and/or Sensations partner information for details.
|
||||
//
|
||||
// This notecard must be called "[AV]Xcite_settings"
|
||||
//
|
||||
// Format of each line is as follows:
|
||||
//
|
||||
// XCITE pose_name|sitter_number|arousal|arousal_max|text|kink|tilt
|
||||
//
|
||||
// For pose_name you can use * to apply to all poses, otherwise use the menu name of one pose.
|
||||
//
|
||||
// For sitter_number you can use * to apply to all sitters otherwise it should be 0,1, etc
|
||||
//
|
||||
// arousal and arousal_max are described in your Xcite! and Sensations partner information.
|
||||
//
|
||||
// For text you may include any text messages that you want to be said out when this arousal occurs.
|
||||
// If you want the message to take the form of an emote simply start the text message with '/me'.
|
||||
// You may also use any of the following special codes for appropriate pronouns in the text:
|
||||
//
|
||||
// %o - Replaced by the owner's first name
|
||||
// %f - Replaced by the owner's full name
|
||||
// %p - Replaced by the possessive pronoun according to sex (his, her)
|
||||
// %r - Replaced by the objective pronoun (him, her)
|
||||
// %s - Replaced by the subjective pronoun (he, she)
|
||||
// %w - Replaced by the possessive form appropriate to the target rather than the owner
|
||||
//
|
||||
// Refer to your Xcite! partner information for full details on text.
|
||||
//
|
||||
// You can also refer to the sitters by first name with /0 /1 etc.
|
||||
//
|
||||
// Adding text is optional and isn't required for the arousal to occur.
|
||||
//
|
||||
// Note each notecard line can only be 255 characters maximum.
|
||||
//
|
||||
// You may also include a custom timer as follows:
|
||||
// TIMER 30
|
||||
//
|
||||
// Arousal will be re-applied at this interval (default is 30 seconds)
|
||||
//
|
||||
// If you wish to debug Xcite commands sent, include:
|
||||
// DEBUG 1
|
||||
//
|
||||
// Switching off Xcite! or Sensations features should be done via your Xcite or Sensations product's menu.
|
||||
//
|
||||
#############################################################
|
||||
Example data follows....
|
||||
#############################################################
|
||||
|
||||
DEBUG 0
|
||||
TIMER 30
|
||||
|
||||
// Typical settings for poses
|
||||
XCITE Couples1|0|15|95|/0 takes /1 by the hand...|kink|0
|
||||
XCITE Couples1|1|5|95|example text for male...|kink|50
|
||||
XCITE Couples_Climax|*|10|100||kink|50
|
||||
|
||||
// Pose with slowly diminishing arousal
|
||||
XCITE Waiting|*|-15|95
|
||||
|
||||
// Pose that sets arousal to 0
|
||||
XCITE Rest|*|0|0
|
||||
|
||||
// Default arousal for all poses
|
||||
XCITE *|*|5|90
|
||||
|
||||
// Default arousal for sitter1's poses
|
||||
XCITE *|1|5|90
|
432
AVsitter2/Plugins/AVcontrol/[AV]root-RLV-extra.lsl
Normal file
432
AVsitter2/Plugins/AVcontrol/[AV]root-RLV-extra.lsl
Normal file
|
@ -0,0 +1,432 @@
|
|||
/*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* Copyright (c) the AVsitter Contributors (http://avsitter.github.io)
|
||||
* AVsitter™ is a trademark. For trademark use policy see:
|
||||
* https://avsitter.github.io/TRADEMARK.mediawiki
|
||||
*
|
||||
* Please consider supporting continued development of AVsitter and
|
||||
* receive automatic updates and other benefits! All details and user
|
||||
* instructions can be found at http://avsitter.github.io
|
||||
*/
|
||||
|
||||
string product;
|
||||
string version = "2.2";
|
||||
integer RELAY_CHANNEL = -1812221819;
|
||||
integer RELAY_GETSTATUS_CHANNEL;
|
||||
integer GETSTATUShandle;
|
||||
integer menu_channel;
|
||||
integer menu_handle;
|
||||
key CONTROLLER = "";
|
||||
string controllerName;
|
||||
key SLAVE;
|
||||
string menu;
|
||||
integer menuPage;
|
||||
list folderPath;
|
||||
list folderOptions;
|
||||
list folderNamesFullLength;
|
||||
list CLOTHING_LAYERS = ["gloves", "jacket", "pants", "shirt", "shoes", "skirt", "socks", "underpants", "undershirt", "", "", "", "", "alpha", "tattoo"];
|
||||
list ATTACHMENT_POINTS = ["", "chest", "skull", "left shoulder", "right shoulder", "left hand", "right hand", "left foot", "right foot", "spine", "pelvis", "mouth", "chin", "left ear", "right ear", "left eyeball", "right eyeball", "nose", "r upper arm", "r forearm", "l upper arm", "l forearm", "right hip", "r upper leg", "r lower leg", "left hip", "l upper leg", "l lower leg", "stomach", "left pec", "right pec", "", "", "", "", "", "", "", "", "neck", "root"];
|
||||
list RLV_RESTRICTIONS = ["Chat", "sendchat", "sending chat", "IM", "sendim", "sending IM", "Touch", "touchall", "touching", "Names", "shownames", "seeing names", "Rez/Edit", "edit,rez", "editing and rezzing objects", "Inventory", "showinv", "accessing their inventory", "Map", "showworldmap,showminimap", "seeing their map", "Location", "showloc", "seeing their location"];
|
||||
string iconActive = "✘ ";
|
||||
string iconInactive = "✔ ";
|
||||
string iconEmpty = "○";
|
||||
string iconHalf = "◑";
|
||||
string iconFull = "●";
|
||||
string iconAdd = "[➕]";
|
||||
string iconSubtract = "[➖]";
|
||||
string pagedMenuText;
|
||||
list pagedMenuButtons;
|
||||
integer verbose = 0;
|
||||
Out(integer level, string out)
|
||||
{
|
||||
if (verbose >= level)
|
||||
{
|
||||
llOwnerSay(llGetScriptName() + "[" + version + "]:" + out);
|
||||
}
|
||||
}
|
||||
string strReplace(string str, string search, string replace)
|
||||
{
|
||||
return llDumpList2String(llParseStringKeepNulls(str, [search], []), replace);
|
||||
}
|
||||
list order_buttons(list buttons)
|
||||
{
|
||||
return llList2List(buttons, -3, -1) + llList2List(buttons, -6, -4) + llList2List(buttons, -9, -7) + llList2List(buttons, -12, -10);
|
||||
}
|
||||
relay(key av, string msg)
|
||||
{
|
||||
msg = "RLV," + (string)av + "," + msg;
|
||||
Out(1, "Sending RLV Command: " + msg);
|
||||
llSay(RELAY_CHANNEL, msg);
|
||||
}
|
||||
remove_menu(string worn, list slots)
|
||||
{
|
||||
list menu_items;
|
||||
Out(1, "remove menu:" + worn + ":" + llDumpList2String(slots, ","));
|
||||
integer i;
|
||||
for (i = 0; i < llGetListLength(slots); i++)
|
||||
{
|
||||
if (llList2String(slots, i) != "" && llGetSubString(worn, i, i) == "1")
|
||||
{
|
||||
menu_items += llList2String(slots, i);
|
||||
}
|
||||
}
|
||||
Out(1, "remove menu2:" + llDumpList2String(menu_items, ","));
|
||||
string text = "'s RLV setup may prevent some items from being removed.\n\nSelect an item to remove:";
|
||||
if (!llGetListLength(menu_items))
|
||||
{
|
||||
text = " is not wearing any items to " + llToLower(menu) + ".";
|
||||
}
|
||||
new_paged_menu(menu + " menu for " + llKey2Name(SLAVE) + "\n\nThe captive" + text, menu_items);
|
||||
}
|
||||
new_paged_menu(string text, list menu_items)
|
||||
{
|
||||
pagedMenuText = text;
|
||||
pagedMenuButtons = menu_items;
|
||||
menuPage = 0;
|
||||
paged_menu();
|
||||
}
|
||||
paged_menu()
|
||||
{
|
||||
list MypagedMenuButtons = pagedMenuButtons;
|
||||
if (llGetListLength(pagedMenuButtons) > 11)
|
||||
{
|
||||
integer numberPages = llGetListLength(pagedMenuButtons) / 9;
|
||||
if (llGetListLength(pagedMenuButtons) % 9)
|
||||
{
|
||||
numberPages++;
|
||||
}
|
||||
if (menuPage >= numberPages)
|
||||
{
|
||||
menuPage = 0;
|
||||
}
|
||||
else if (menuPage < 0)
|
||||
{
|
||||
menuPage = numberPages - 1;
|
||||
}
|
||||
MypagedMenuButtons = llList2List(pagedMenuButtons, menuPage * 9, menuPage * 9 + 8);
|
||||
while (llGetListLength(MypagedMenuButtons) < 9)
|
||||
{
|
||||
MypagedMenuButtons += " ";
|
||||
}
|
||||
MypagedMenuButtons += ["[<<]", "[>>]"];
|
||||
}
|
||||
Out(1, "paged menu:" + llDumpList2String(MypagedMenuButtons, ","));
|
||||
dialog(pagedMenuText, ["[BACK]"] + MypagedMenuButtons);
|
||||
}
|
||||
dialog(string text, list buttons)
|
||||
{
|
||||
while (llGetListLength(buttons) % 3)
|
||||
buttons += " ";
|
||||
llDialog(CONTROLLER, "AVsitter™ RLV " + product + " " + version + "\n\n" + text, order_buttons(buttons), menu_channel);
|
||||
}
|
||||
remove_script(string reason)
|
||||
{
|
||||
string message = "\n" + llGetScriptName() + " ==Script Removed==\n\n" + reason;
|
||||
llDialog(llGetOwner(), message, ["OK"], -3675);
|
||||
llInstantMessage(llGetOwner(), message);
|
||||
llRemoveInventory(llGetScriptName());
|
||||
}
|
||||
main_menu()
|
||||
{
|
||||
menu = "";
|
||||
dialog("Un/Dress menu for " + llKey2Name(SLAVE), ["[BACK]", "Browse #RLV", "Fast Strip", "Undress", "Detach"]);
|
||||
}
|
||||
default
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
if (llSubStringIndex(llGetScriptName(), " ") != -1)
|
||||
{
|
||||
remove_script("Use only one copy of this script!");
|
||||
}
|
||||
else
|
||||
{
|
||||
state running;
|
||||
}
|
||||
}
|
||||
}
|
||||
state running
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
}
|
||||
link_message(integer sender, integer num, string msg, key id)
|
||||
{
|
||||
if (num == 90208 || num == 90209)
|
||||
{
|
||||
list data = llParseStringKeepNulls(id, ["|"], []);
|
||||
SLAVE = (key)llList2String(data, 0);
|
||||
CONTROLLER = (key)llList2String(data, 1);
|
||||
product = llList2String(data, 2);
|
||||
llListenRemove(menu_handle);
|
||||
llListenRemove(GETSTATUShandle);
|
||||
menu_handle = llListen(menu_channel = ((integer)llFrand(2147483646) + 1) * -1, "", CONTROLLER, "");
|
||||
GETSTATUShandle = llListen(RELAY_GETSTATUS_CHANNEL = (integer)llFrand(999999999), "", "", "");
|
||||
if (num == 90208)
|
||||
{
|
||||
main_menu();
|
||||
}
|
||||
else
|
||||
{
|
||||
menu = "Restrict";
|
||||
relay(SLAVE, "@getstatus=" + (string)RELAY_GETSTATUS_CHANNEL);
|
||||
}
|
||||
}
|
||||
else if (num == 90065)
|
||||
{
|
||||
if (id == SLAVE)
|
||||
{
|
||||
llListenRemove(menu_handle);
|
||||
llListenRemove(GETSTATUShandle);
|
||||
SLAVE = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
listen(integer channel, string name, key id, string msg)
|
||||
{
|
||||
Out(1, "Listen Received: " + msg);
|
||||
string command;
|
||||
if (channel == menu_channel)
|
||||
{
|
||||
if (msg == "[>>]" || msg == "[<<]")
|
||||
{
|
||||
if (msg == "[<<]")
|
||||
{
|
||||
menuPage--;
|
||||
}
|
||||
else
|
||||
{
|
||||
menuPage++;
|
||||
}
|
||||
paged_menu();
|
||||
}
|
||||
else if (menu == "Browse #RLV")
|
||||
{
|
||||
integer index = llListFindList(folderOptions, [msg]);
|
||||
if (~index)
|
||||
{
|
||||
msg = llList2String(folderNamesFullLength, index);
|
||||
folderPath += msg;
|
||||
relay(SLAVE, "@getinvworn:" + llDumpList2String(folderPath, "/") + "=" + (string)RELAY_GETSTATUS_CHANNEL);
|
||||
}
|
||||
else if (msg == "[BACK]")
|
||||
{
|
||||
if (!llGetListLength(folderPath))
|
||||
{
|
||||
main_menu();
|
||||
}
|
||||
else
|
||||
{
|
||||
folderPath = llDeleteSubList(folderPath, -1, -1);
|
||||
relay(SLAVE, "@getinvworn:" + llDumpList2String(folderPath, "/") + "=" + (string)RELAY_GETSTATUS_CHANNEL);
|
||||
}
|
||||
}
|
||||
else if (msg == iconAdd || msg == iconSubtract)
|
||||
{
|
||||
command = "attach";
|
||||
if (msg == iconSubtract)
|
||||
{
|
||||
command = "detach";
|
||||
}
|
||||
relay(SLAVE, "@" + command + ":" + llDumpList2String(folderPath, "/") + "=force");
|
||||
llSleep(4);
|
||||
relay(SLAVE, "@getinvworn:" + llDumpList2String(folderPath, "/") + "=" + (string)RELAY_GETSTATUS_CHANNEL);
|
||||
}
|
||||
}
|
||||
else if (msg == "[BACK]")
|
||||
{
|
||||
if (menu == "Restrict" || menu == "")
|
||||
{
|
||||
llMessageLinked(LINK_THIS, 90100, "0|Control...|" + (string)SLAVE, CONTROLLER);
|
||||
}
|
||||
else
|
||||
{
|
||||
main_menu();
|
||||
}
|
||||
}
|
||||
else if (menu == "Detach" || menu == "Undress")
|
||||
{
|
||||
integer index = llListFindList(CLOTHING_LAYERS, [msg]);
|
||||
command = "outfit";
|
||||
if (!~index)
|
||||
{
|
||||
index = llListFindList(ATTACHMENT_POINTS, [msg]);
|
||||
command = "attach";
|
||||
}
|
||||
if (~index)
|
||||
{
|
||||
relay(SLAVE, "@rem" + command + ":" + msg + "=force");
|
||||
llSleep(2);
|
||||
relay(SLAVE, "@get" + command + "=" + (string)RELAY_GETSTATUS_CHANNEL);
|
||||
}
|
||||
}
|
||||
else if (msg == "Detach" || msg == "Undress" || msg == "Browse #RLV")
|
||||
{
|
||||
menu = msg;
|
||||
folderPath = [];
|
||||
command = "getoutfit";
|
||||
if (msg == "Detach")
|
||||
command = "getattach";
|
||||
if (msg == "Browse #RLV")
|
||||
command = "getinvworn";
|
||||
relay(SLAVE, "@" + command + "=" + (string)RELAY_GETSTATUS_CHANNEL);
|
||||
}
|
||||
else if (msg == "Fast Strip")
|
||||
{
|
||||
menu = "fs";
|
||||
dialog("Are you really sure? This will try to remove almost everything the avatar is wearing.", ["[BACK]", "YES!"]);
|
||||
}
|
||||
else if (msg == "YES!")
|
||||
{
|
||||
integer i;
|
||||
for (i = 0; i < llGetListLength(CLOTHING_LAYERS); i++)
|
||||
{
|
||||
if (llList2String(CLOTHING_LAYERS, i))
|
||||
{
|
||||
relay(SLAVE, "@remoutfit:" + llList2String(CLOTHING_LAYERS, i) + "=force");
|
||||
}
|
||||
}
|
||||
for (i = 0; i < llGetListLength(ATTACHMENT_POINTS); i++)
|
||||
{
|
||||
if (llList2String(ATTACHMENT_POINTS, i))
|
||||
{
|
||||
if (i != 2)
|
||||
{
|
||||
relay(SLAVE, "@remattach:" + llList2String(ATTACHMENT_POINTS, i) + "=force");
|
||||
}
|
||||
}
|
||||
}
|
||||
main_menu();
|
||||
}
|
||||
else
|
||||
{
|
||||
integer index = llListFindList(llList2ListStrided(RLV_RESTRICTIONS, 0, -1, 3), [llList2String(llParseString2List(msg, [" "], []), 1)]);
|
||||
if (~index)
|
||||
{
|
||||
list subRestrictions = llParseString2List(llList2String(RLV_RESTRICTIONS, index * 3 + 1), [","], []);
|
||||
string param = "n";
|
||||
string chatText = strReplace(llKey2Name(SLAVE), " Resident", "") + " is ";
|
||||
if (~llSubStringIndex(msg, iconActive))
|
||||
{
|
||||
param = "y";
|
||||
chatText += "no longer ";
|
||||
}
|
||||
integer i;
|
||||
while (i < llGetListLength(subRestrictions))
|
||||
{
|
||||
relay(SLAVE, "@" + llList2String(subRestrictions, i) + "=" + param);
|
||||
i++;
|
||||
}
|
||||
llSay(0, chatText + "restricted from " + llList2String(RLV_RESTRICTIONS, index * 3 + 2) + ".");
|
||||
relay(SLAVE, "@getstatus=" + (string)RELAY_GETSTATUS_CHANNEL);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (channel == RELAY_GETSTATUS_CHANNEL)
|
||||
{
|
||||
if (menu == "Browse #RLV")
|
||||
{
|
||||
folderOptions = [];
|
||||
folderNamesFullLength = [];
|
||||
list BUTTONS;
|
||||
list results = llParseStringKeepNulls(msg, [","], []);
|
||||
string folderInfo;
|
||||
string subInfo;
|
||||
integer i;
|
||||
for (i = 0; i < llGetListLength(results); i++)
|
||||
{
|
||||
list item = llParseStringKeepNulls(llList2String(results, i), ["|"], []);
|
||||
string folder = llList2String(item, 0);
|
||||
integer worn = llList2Integer(item, 1);
|
||||
integer wornThis = worn / 10;
|
||||
integer wornSub = worn % 10;
|
||||
string icon = "no items";
|
||||
if (i)
|
||||
{
|
||||
if (wornThis || wornSub)
|
||||
{
|
||||
icon = iconEmpty;
|
||||
if (wornThis > 1 || wornSub > 1)
|
||||
{
|
||||
icon = iconHalf;
|
||||
}
|
||||
if (wornThis == 3 && wornSub == 0 || (wornThis == 0 && wornSub == 3) || (wornThis == 3 && wornSub == 3))
|
||||
{
|
||||
icon = iconFull;
|
||||
}
|
||||
folderOptions += icon + " " + llGetSubString(folder, 0, 12);
|
||||
folderNamesFullLength += folder;
|
||||
subInfo = "\nSubfolders:\n" + iconEmpty + " = none worn\n" + iconHalf + " = some worn\n" + iconFull + " = all worn";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (wornThis)
|
||||
{
|
||||
icon = "none worn";
|
||||
if (wornThis == 2)
|
||||
{
|
||||
icon = "some worn";
|
||||
}
|
||||
if (wornThis == 3)
|
||||
{
|
||||
icon = "all worn";
|
||||
}
|
||||
BUTTONS += [iconAdd, iconSubtract];
|
||||
folderInfo = "\n" + iconAdd + " = wear\n" + iconSubtract + " = remove\n";
|
||||
}
|
||||
msg = "Folder: /" + llDumpList2String(folderPath, "/") + "\n[" + icon + "]\n" + folderInfo;
|
||||
}
|
||||
}
|
||||
if ((!llGetListLength(folderOptions)) && (!llGetListLength(BUTTONS)))
|
||||
{
|
||||
msg = "#RLV folder empty";
|
||||
}
|
||||
new_paged_menu(msg + subInfo, BUTTONS + folderOptions);
|
||||
}
|
||||
else if (menu == "Detach")
|
||||
{
|
||||
remove_menu(msg, ATTACHMENT_POINTS);
|
||||
}
|
||||
else if (menu == "Undress")
|
||||
{
|
||||
remove_menu(msg, CLOTHING_LAYERS);
|
||||
}
|
||||
else if (menu == "Restrict")
|
||||
{
|
||||
list currentRestrictions = llParseString2List(msg, ["/"], []);
|
||||
list menu_items = ["[BACK]"];
|
||||
integer i;
|
||||
while (i < llGetListLength(RLV_RESTRICTIONS))
|
||||
{
|
||||
list subRestrictions = llParseString2List(llList2String(RLV_RESTRICTIONS, i + 1), [","], []);
|
||||
integer inActive;
|
||||
integer j;
|
||||
while (j < llGetListLength(subRestrictions))
|
||||
{
|
||||
if (!~llListFindList(currentRestrictions, [llList2String(subRestrictions, j)]))
|
||||
{
|
||||
inActive = TRUE;
|
||||
}
|
||||
j++;
|
||||
}
|
||||
string symbol = iconInactive;
|
||||
if (!inActive)
|
||||
{
|
||||
symbol = iconActive;
|
||||
}
|
||||
string btntext = symbol + llList2String(RLV_RESTRICTIONS, i);
|
||||
while (llStringLength(btntext) < 20)
|
||||
btntext += " ";
|
||||
btntext += ".";
|
||||
menu_items += btntext;
|
||||
i += 3;
|
||||
}
|
||||
dialog("RLV for " + llKey2Name(SLAVE) + "\n\n" + iconInactive + "= Allowed\n" + iconActive + "= Restricted", menu_items);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
1247
AVsitter2/Plugins/AVcontrol/[AV]root-RLV.lsl
Normal file
1247
AVsitter2/Plugins/AVcontrol/[AV]root-RLV.lsl
Normal file
File diff suppressed because it is too large
Load diff
195
AVsitter2/Plugins/AVcontrol/[AV]root-control.lsl
Normal file
195
AVsitter2/Plugins/AVcontrol/[AV]root-control.lsl
Normal file
|
@ -0,0 +1,195 @@
|
|||
/*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* Copyright (c) the AVsitter Contributors (http://avsitter.github.io)
|
||||
* AVsitter™ is a trademark. For trademark use policy see:
|
||||
* https://avsitter.github.io/TRADEMARK.mediawiki
|
||||
*
|
||||
* Please consider supporting continued development of AVsitter and
|
||||
* receive automatic updates and other benefits! All details and user
|
||||
* instructions can be found at http://avsitter.github.io
|
||||
*/
|
||||
|
||||
string product = "AVsitter™ Menu Control";
|
||||
string version = "2.2";
|
||||
string security_script = "[AV]root-security";
|
||||
string RLV_script = "[AV]root-RLV";
|
||||
list DESIGNATIONS_NOW;
|
||||
key CONTROLLER = NULL_KEY;
|
||||
integer KEY_TAKEN;
|
||||
string CONTROLLER_NAME;
|
||||
list SITTERS_MENUKEYS;
|
||||
list SITTERS_SHORTNAMES;
|
||||
integer menu_channel;
|
||||
integer menu_handle;
|
||||
key key_request;
|
||||
integer verbose = 1;
|
||||
Out(integer level, string out)
|
||||
{
|
||||
if (verbose >= level)
|
||||
{
|
||||
llOwnerSay(llGetScriptName() + "[" + version + "]:" + out);
|
||||
}
|
||||
}
|
||||
list order_buttons(list buttons)
|
||||
{
|
||||
return llList2List(buttons, -3, -1) + llList2List(buttons, -6, -4) + llList2List(buttons, -9, -7) + llList2List(buttons, -12, -10);
|
||||
}
|
||||
string strReplace(string str, string search, string replace)
|
||||
{
|
||||
return llDumpList2String(llParseStringKeepNulls(str, [search], []), replace);
|
||||
}
|
||||
controller_menu(key id)
|
||||
{
|
||||
CONTROLLER = id;
|
||||
CONTROLLER_NAME = llKey2Name(id);
|
||||
list SITTERS;
|
||||
integer count = llGetNumberOfPrims();
|
||||
while (llGetAgentSize(llGetLinkKey(count)) != ZERO_VECTOR)
|
||||
{
|
||||
SITTERS += llGetLinkKey(count);
|
||||
count--;
|
||||
}
|
||||
if ((~llListFindList(SITTERS, [id])) && check_for_RLV())
|
||||
{
|
||||
llMessageLinked(LINK_SET, 90005, "", id);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (llGetListLength(SITTERS) == 1 && ((!check_for_RLV()) || (!~llListFindList(DESIGNATIONS_NOW, ["S"])) || llGetListLength(DESIGNATIONS_NOW) == 1))
|
||||
{
|
||||
if (check_for_RLV())
|
||||
{
|
||||
llMessageLinked(LINK_THIS, 90100, "x|Control...|" + llList2String(SITTERS, 0), id);
|
||||
}
|
||||
else
|
||||
{
|
||||
llMessageLinked(LINK_SET, 90005, "", llDumpList2String([id, llList2Key(SITTERS, 0)], "|"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
list menu_items;
|
||||
SITTERS_MENUKEYS = [];
|
||||
integer i;
|
||||
for (i = 0; i < llGetListLength(SITTERS); i++)
|
||||
{
|
||||
if (llList2Key(SITTERS, i) != NULL_KEY)
|
||||
{
|
||||
menu_items += llGetSubString(strReplace(llKey2Name(llList2Key(SITTERS, i)), " Resident", ""), 0, 11);
|
||||
SITTERS_MENUKEYS += llList2Key(SITTERS, i);
|
||||
}
|
||||
}
|
||||
SITTERS_SHORTNAMES = menu_items;
|
||||
string text = "Which avatar?";
|
||||
if (check_for_RLV())
|
||||
{
|
||||
if (!llGetListLength(menu_items))
|
||||
{
|
||||
llMessageLinked(LINK_THIS, 90211, "", id);
|
||||
return;
|
||||
}
|
||||
if ((~llListFindList(DESIGNATIONS_NOW, ["S"])) && llGetListLength(SITTERS) < llGetListLength(DESIGNATIONS_NOW))
|
||||
{
|
||||
text += "\n\nCapture = trap a new avatar.";
|
||||
menu_items += "Capture...";
|
||||
}
|
||||
}
|
||||
if (llGetListLength(menu_items))
|
||||
{
|
||||
dialog(text, order_buttons(menu_items), id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
dialog(string text, list menu_items, key id)
|
||||
{
|
||||
llListenRemove(menu_handle);
|
||||
menu_handle = llListen(menu_channel = ((integer)llFrand(2147483646) + 1) * -1, "", id, "");
|
||||
llDialog(id, product + " " + version + "\n\n" + text + "\n", order_buttons(menu_items), menu_channel);
|
||||
llSetTimerEvent(120);
|
||||
}
|
||||
integer check_for_RLV()
|
||||
{
|
||||
if (llGetInventoryType(RLV_script) == INVENTORY_SCRIPT)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
default
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
llSetTimerEvent(0);
|
||||
}
|
||||
on_rez(integer x)
|
||||
{
|
||||
llResetScript();
|
||||
}
|
||||
timer()
|
||||
{
|
||||
llListenRemove(menu_handle);
|
||||
}
|
||||
link_message(integer sender, integer num, string msg, key id)
|
||||
{
|
||||
if (num == 90007)
|
||||
{
|
||||
if (id == CONTROLLER || CONTROLLER == NULL_KEY)
|
||||
{
|
||||
controller_menu(id);
|
||||
}
|
||||
else
|
||||
{
|
||||
string text = "Take control of the menu?";
|
||||
if (llGetAgentSize(CONTROLLER) != ZERO_VECTOR)
|
||||
{
|
||||
text += "\n\nCurrently controlled by: " + CONTROLLER_NAME;
|
||||
}
|
||||
dialog(text, ["Take Control", "[CANCEL]"], id);
|
||||
}
|
||||
}
|
||||
else if (num == 90206)
|
||||
{
|
||||
DESIGNATIONS_NOW = llParseStringKeepNulls(msg, ["|"], []);
|
||||
}
|
||||
}
|
||||
listen(integer channel, string name, key id, string message)
|
||||
{
|
||||
llListenRemove(menu_handle);
|
||||
integer index = llListFindList(SITTERS_SHORTNAMES, [message]);
|
||||
if (~index)
|
||||
{
|
||||
if (check_for_RLV())
|
||||
{
|
||||
llMessageLinked(LINK_THIS, 90100, "x|Control...|" + llList2String(SITTERS_MENUKEYS, index), CONTROLLER);
|
||||
}
|
||||
else
|
||||
{
|
||||
llMessageLinked(LINK_SET, 90005, "", llDumpList2String([CONTROLLER, llList2Key(SITTERS_MENUKEYS, index)], "|"));
|
||||
}
|
||||
}
|
||||
else if (message == "Capture...")
|
||||
{
|
||||
llMessageLinked(LINK_THIS, 90211, "", id);
|
||||
}
|
||||
else if (message == "Take Control")
|
||||
{
|
||||
llMessageLinked(LINK_SET, 90033, "", "");
|
||||
if (id != CONTROLLER)
|
||||
{
|
||||
llRegionSayTo(CONTROLLER, 0, llKey2Name(id) + " has taken control of the menu.");
|
||||
}
|
||||
controller_menu(id);
|
||||
}
|
||||
}
|
||||
changed(integer change)
|
||||
{
|
||||
if (llGetAgentSize(llGetLinkKey(llGetNumberOfPrims())) == ZERO_VECTOR)
|
||||
{
|
||||
CONTROLLER = NULL_KEY;
|
||||
}
|
||||
}
|
||||
}
|
384
AVsitter2/Plugins/AVfaces/[AV]faces.lsl
Normal file
384
AVsitter2/Plugins/AVfaces/[AV]faces.lsl
Normal file
|
@ -0,0 +1,384 @@
|
|||
/*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* Copyright (c) the AVsitter Contributors (http://avsitter.github.io)
|
||||
* AVsitter™ is a trademark. For trademark use policy see:
|
||||
* https://avsitter.github.io/TRADEMARK.mediawiki
|
||||
*
|
||||
* Please consider supporting continued development of AVsitter and
|
||||
* receive automatic updates and other benefits! All details and user
|
||||
* instructions can be found at http://avsitter.github.io
|
||||
*/
|
||||
|
||||
integer is_running = TRUE;
|
||||
list facial_anim_list = ["express_afraid_emote", "express_anger_emote", "express_laugh_emote", "express_bored_emote", "express_cry_emote", "express_embarrassed_emote", "express_sad_emote", "express_toothsmile", "express_smile", "express_surprise_emote", "express_worry_emote", "express_repulsed_emote", "express_shrug_emote", "express_wink_emote", "express_disdain", "express_frown", "express_kiss", "express_open_mouth", "express_tongue_out"];
|
||||
integer IsInteger(string data)
|
||||
{
|
||||
return llParseString2List((string)llParseString2List(data, ["8", "9"], []), ["0", "1", "2", "3", "4", "5", "6", "7"], []) == [] && data != "";
|
||||
}
|
||||
string version = "2.1";
|
||||
string notecard_name = "AVpos";
|
||||
string main_script = "[AV]sitA";
|
||||
key key_request;
|
||||
key notecard_key;
|
||||
key notecard_query;
|
||||
integer notecard_line;
|
||||
integer notecard_section;
|
||||
integer listen_handle;
|
||||
list anim_triggers;
|
||||
list anim_animsequences;
|
||||
list running_uuid;
|
||||
list running_sequence_indexes;
|
||||
list running_pointers;
|
||||
list SITTERS;
|
||||
list SITTER_POSES;
|
||||
integer get_number_of_scripts()
|
||||
{
|
||||
integer i = 1;
|
||||
while (llGetInventoryType(main_script + " " + (string)i) == INVENTORY_SCRIPT)
|
||||
{
|
||||
i++;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
integer verbose = 0;
|
||||
Out(integer level, string out)
|
||||
{
|
||||
if (verbose >= level)
|
||||
{
|
||||
llOwnerSay(llGetScriptName() + "[" + version + "] " + out);
|
||||
}
|
||||
}
|
||||
Readout_Say(string say, string SCRIPT_CHANNEL)
|
||||
{
|
||||
llSleep(0.2);
|
||||
llMessageLinked(LINK_THIS, 90022, say, SCRIPT_CHANNEL);
|
||||
}
|
||||
string Key2Number(key objKey)
|
||||
{
|
||||
return llGetSubString((string)llAbs((integer)("0x" + llGetSubString((string)objKey, -8, -1)) & 1073741823 ^ -1073741825), 6, -1);
|
||||
}
|
||||
init_sitters()
|
||||
{
|
||||
SITTERS = [];
|
||||
SITTER_POSES = [];
|
||||
integer i;
|
||||
for (i = 0; i < get_number_of_scripts(); i++)
|
||||
{
|
||||
SITTERS += NULL_KEY;
|
||||
SITTER_POSES += "";
|
||||
}
|
||||
}
|
||||
string element(string text, integer x)
|
||||
{
|
||||
return llList2String(llParseStringKeepNulls(text, ["|"], []), x);
|
||||
}
|
||||
start_sequence(integer sequence_index, key av)
|
||||
{
|
||||
integer wasRunning = llListFindList(running_sequence_indexes, [sequence_index]);
|
||||
if (~wasRunning)
|
||||
{
|
||||
if (llList2Key(running_uuid, wasRunning) == av)
|
||||
{
|
||||
running_uuid = llListReplaceList(running_uuid, [], wasRunning, wasRunning);
|
||||
running_sequence_indexes = llListReplaceList(running_sequence_indexes, [], wasRunning, wasRunning);
|
||||
running_pointers = llListReplaceList(running_pointers, [], wasRunning, wasRunning);
|
||||
}
|
||||
}
|
||||
running_uuid += av;
|
||||
running_sequence_indexes += sequence_index;
|
||||
running_pointers += 0;
|
||||
llSetTimerEvent(0.01);
|
||||
}
|
||||
sequence()
|
||||
{
|
||||
list anims;
|
||||
list uuids;
|
||||
integer i;
|
||||
while (i < llGetListLength(running_pointers))
|
||||
{
|
||||
integer sequence_pointer = llList2Integer(running_pointers, i);
|
||||
integer sequence_index = llList2Integer(running_sequence_indexes, i);
|
||||
list sequence = llParseStringKeepNulls(llList2String(anim_animsequences, sequence_index), ["|"], []);
|
||||
list sequence_anims = llList2ListStrided(sequence, 0, -1, 2);
|
||||
list sequence_durations = llList2ListStrided(llDeleteSubList(sequence, 0, 0), 0, -1, 2);
|
||||
integer sequence_length;
|
||||
integer j;
|
||||
while (j <= llGetListLength(sequence_durations))
|
||||
{
|
||||
integer lastDuration = (integer)llList2String(sequence_durations, j - 1);
|
||||
integer repeats = FALSE;
|
||||
if (lastDuration < 0)
|
||||
{
|
||||
repeats = TRUE;
|
||||
lastDuration = llAbs(lastDuration);
|
||||
}
|
||||
string anim;
|
||||
if (sequence_pointer == sequence_length)
|
||||
{
|
||||
anim = llStringTrim(llList2String(sequence_anims, j), STRING_TRIM);
|
||||
}
|
||||
else if (repeats && sequence_pointer > sequence_length - lastDuration && sequence_pointer < sequence_length - 1)
|
||||
{
|
||||
anim = llStringTrim(llList2String(sequence_anims, j - 1), STRING_TRIM);
|
||||
}
|
||||
if (anim)
|
||||
{
|
||||
if (IsInteger(anim))
|
||||
{
|
||||
anim = llList2String(facial_anim_list, (integer)anim);
|
||||
}
|
||||
anims += anim;
|
||||
uuids += llList2Key(running_uuid, i);
|
||||
}
|
||||
if (llList2String(sequence_durations, j) == "-")
|
||||
{
|
||||
sequence_pointer++;
|
||||
jump go;
|
||||
}
|
||||
integer duration = llAbs((integer)llList2String(sequence_durations, j));
|
||||
sequence_length += duration;
|
||||
j++;
|
||||
}
|
||||
sequence_pointer++;
|
||||
if (sequence_pointer == sequence_length)
|
||||
{
|
||||
sequence_pointer = 0;
|
||||
}
|
||||
@go;
|
||||
running_pointers = llListReplaceList(running_pointers, [sequence_pointer], i, i);
|
||||
i++;
|
||||
}
|
||||
for (i = 0; i < llGetListLength(anims); i++)
|
||||
{
|
||||
if (llList2String(anims, i) != "none")
|
||||
{
|
||||
if (is_running)
|
||||
{
|
||||
llMessageLinked(LINK_THIS, 90001, llList2String(anims, i), llList2Key(uuids, i));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
remove_sequences(key id)
|
||||
{
|
||||
integer index;
|
||||
while (~llListFindList(running_uuid, [id]))
|
||||
{
|
||||
index = llListFindList(running_uuid, [id]);
|
||||
running_uuid = llDeleteSubList(running_uuid, index, index);
|
||||
list sequence = llParseStringKeepNulls(llList2String(anim_animsequences, llList2Integer(running_sequence_indexes, index)), ["|"], []);
|
||||
running_sequence_indexes = llDeleteSubList(running_sequence_indexes, index, index);
|
||||
running_pointers = llDeleteSubList(running_pointers, index, index);
|
||||
while (sequence)
|
||||
{
|
||||
if ((!IsInteger(llList2String(sequence, 0))) && llList2String(sequence, 0) != "none")
|
||||
{
|
||||
llMessageLinked(LINK_THIS, 90002, llList2String(sequence, 0), id);
|
||||
}
|
||||
sequence = llDeleteSubList(sequence, 0, 1);
|
||||
}
|
||||
}
|
||||
if (llGetListLength(running_uuid) == 0)
|
||||
{
|
||||
llSetTimerEvent(0);
|
||||
}
|
||||
}
|
||||
default
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
init_sitters();
|
||||
notecard_key = llGetInventoryKey(notecard_name);
|
||||
if (llGetInventoryType(notecard_name) == INVENTORY_NOTECARD)
|
||||
{
|
||||
Out(0, "Loading...");
|
||||
notecard_query = llGetNotecardLine(notecard_name, 0);
|
||||
}
|
||||
}
|
||||
timer()
|
||||
{
|
||||
sequence();
|
||||
llSetTimerEvent(1);
|
||||
}
|
||||
on_rez(integer start)
|
||||
{
|
||||
is_running = TRUE;
|
||||
}
|
||||
link_message(integer sender, integer num, string msg, key id)
|
||||
{
|
||||
if (num == 90100)
|
||||
{
|
||||
list data = llParseString2List(msg, ["|"], []);
|
||||
if (llList2String(data, 1) == "[FACES]")
|
||||
{
|
||||
llMessageLinked(sender, 90101, llDumpList2String([llList2String(data, 0), "[ADJUST]", id], "|"), llList2String(data, 2));
|
||||
if (id == llGetOwner())
|
||||
{
|
||||
is_running = (!is_running);
|
||||
if (sender == llGetLinkNumber())
|
||||
{
|
||||
llRegionSayTo(id, 0, "Facial Expressions " + llList2String(["OFF", "ON"], is_running));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
llRegionSayTo(id, 0, "Sorry, only the owner can change this.");
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (sender == llGetLinkNumber())
|
||||
{
|
||||
if (num == 90045)
|
||||
{
|
||||
list data = llParseStringKeepNulls(msg, ["|"], []);
|
||||
integer 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)
|
||||
{
|
||||
reference = i;
|
||||
}
|
||||
start_sequence(reference, id);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (num == 90065)
|
||||
{
|
||||
remove_sequences(id);
|
||||
integer index = llListFindList(SITTERS, [id]);
|
||||
if (index != -1)
|
||||
{
|
||||
SITTERS = llListReplaceList(SITTERS, [NULL_KEY], index, index);
|
||||
}
|
||||
}
|
||||
else if (num == 90030)
|
||||
{
|
||||
SITTERS = llListReplaceList(SITTERS, [NULL_KEY], (integer)msg, (integer)msg);
|
||||
SITTERS = llListReplaceList(SITTERS, [NULL_KEY], (integer)((string)id), (integer)((string)id));
|
||||
}
|
||||
else if (num == 90070)
|
||||
{
|
||||
SITTERS = llListReplaceList(SITTERS, [id], (integer)msg, (integer)msg);
|
||||
}
|
||||
else if (num == 90172)
|
||||
{
|
||||
is_running = TRUE;
|
||||
integer sitter = (integer)msg;
|
||||
remove_sequences(llList2Key(SITTERS, sitter));
|
||||
integer i = llGetListLength(anim_triggers);
|
||||
while (i > 0)
|
||||
{
|
||||
i--;
|
||||
if (llList2String(anim_triggers, i) == msg + "|" + llList2String(SITTER_POSES, sitter))
|
||||
{
|
||||
anim_triggers = llDeleteSubList(anim_triggers, i, i);
|
||||
anim_animsequences = llDeleteSubList(anim_animsequences, i, i);
|
||||
}
|
||||
}
|
||||
if (id != "none")
|
||||
{
|
||||
anim_triggers += [msg + "|" + llList2String(SITTER_POSES, sitter)];
|
||||
anim_animsequences += (string)id + "|1";
|
||||
start_sequence(llGetListLength(anim_animsequences) - 1, llList2Key(SITTERS, sitter));
|
||||
llSay(0, "FACE added: '" + (string)id + "' to '" + llList2String(SITTER_POSES, sitter) + "' for SITTER " + (string)sitter + ".");
|
||||
}
|
||||
}
|
||||
else if (num == 90020 && (string)id == llGetScriptName())
|
||||
{
|
||||
integer i;
|
||||
for (i = 0; i < llGetListLength(anim_triggers); i++)
|
||||
{
|
||||
if (!llSubStringIndex(llList2String(anim_triggers, i), msg + "|"))
|
||||
{
|
||||
list trigger = 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);
|
||||
}
|
||||
}
|
||||
Readout_Say("ANIM " + llList2String(trigger, 1) + "|" + llDumpList2String(sequence, "|"), msg);
|
||||
}
|
||||
}
|
||||
llMessageLinked(LINK_THIS, 90021, msg, llGetScriptName());
|
||||
}
|
||||
}
|
||||
}
|
||||
changed(integer change)
|
||||
{
|
||||
if (change & CHANGED_INVENTORY)
|
||||
{
|
||||
if (llGetInventoryKey(notecard_name) != notecard_key)
|
||||
{
|
||||
llResetScript();
|
||||
}
|
||||
else if (get_number_of_scripts() != llGetListLength(SITTERS))
|
||||
{
|
||||
init_sitters();
|
||||
}
|
||||
}
|
||||
else if (change & CHANGED_LINK)
|
||||
{
|
||||
if (llGetAgentSize(llGetLinkKey(llGetNumberOfPrims())) == ZERO_VECTOR)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
dataserver(key query_id, string data)
|
||||
{
|
||||
if (query_id == notecard_query)
|
||||
{
|
||||
if (data == EOF)
|
||||
{
|
||||
Out(0, (string)llGetListLength(anim_triggers) + " Expressions Ready, Mem=" + (string)llGetFreeMemory());
|
||||
}
|
||||
else
|
||||
{
|
||||
data = llGetSubString(data, llSubStringIndex(data, "◆") + 1, -1);
|
||||
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;
|
||||
}
|
||||
else if (command == "ANIM")
|
||||
{
|
||||
string part1 = llStringTrim(llDumpList2String(llList2List(parts, 1, -1), "|"), STRING_TRIM);
|
||||
list sequence = llParseString2List(part1, ["|"], []);
|
||||
integer x;
|
||||
for (x = 0; x < llGetListLength(sequence); x += 2)
|
||||
{
|
||||
integer index = llListFindList(facial_anim_list, [llList2String(sequence, x)]);
|
||||
if (~index)
|
||||
{
|
||||
sequence = llListReplaceList(sequence, [index], x, x);
|
||||
}
|
||||
}
|
||||
anim_triggers += [(string)notecard_section + "|" + part0];
|
||||
anim_animsequences += llDumpList2String(sequence, "|");
|
||||
}
|
||||
notecard_query = llGetNotecardLine(notecard_name, notecard_line += 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
608
AVsitter2/Plugins/AVprop/[AV]menu.lsl
Normal file
608
AVsitter2/Plugins/AVprop/[AV]menu.lsl
Normal file
|
@ -0,0 +1,608 @@
|
|||
/*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* Copyright (c) the AVsitter Contributors (http://avsitter.github.io)
|
||||
* AVsitter™ is a trademark. For trademark use policy see:
|
||||
* https://avsitter.github.io/TRADEMARK.mediawiki
|
||||
*
|
||||
* Please consider supporting continued development of AVsitter and
|
||||
* receive automatic updates and other benefits! All details and user
|
||||
* instructions can be found at http://avsitter.github.io
|
||||
*/
|
||||
|
||||
string product = "AVmenu™";
|
||||
string version = "2.2";
|
||||
integer verbose = 0;
|
||||
string prop_script = "[AV]prop";
|
||||
string notecard_name = "AVpos";
|
||||
string main_script = "[AV]sitA";
|
||||
string custom_text;
|
||||
list MENUCONTROL_TYPES = ["ALL", "OWNER ONLY", "GROUP ONLY"];
|
||||
integer MENUCONTROL_INDEX;
|
||||
integer owner_only;
|
||||
integer last_menu_unixtime;
|
||||
string last_menu_avatar;
|
||||
integer menu_channel;
|
||||
key notecard_key;
|
||||
key notecard_query;
|
||||
list MENU_LIST;
|
||||
list DATA_LIST;
|
||||
integer MTYPE;
|
||||
integer notecard_line;
|
||||
integer current_menu = -1;
|
||||
integer menu_page;
|
||||
integer choosing;
|
||||
string choice;
|
||||
integer listen_handle;
|
||||
integer number_per_page = 9;
|
||||
integer menu_pages;
|
||||
string last_text;
|
||||
integer pass_security(key id)
|
||||
{
|
||||
integer access_allowed = FALSE;
|
||||
string SECURITY_TYPE = llList2String(MENUCONTROL_TYPES, MENUCONTROL_INDEX);
|
||||
if (SECURITY_TYPE == "ALL")
|
||||
{
|
||||
access_allowed = TRUE;
|
||||
}
|
||||
else if (SECURITY_TYPE == "GROUP ONLY" && llSameGroup(id) == TRUE)
|
||||
{
|
||||
access_allowed = TRUE;
|
||||
}
|
||||
else if (id == llGetOwner())
|
||||
{
|
||||
access_allowed = TRUE;
|
||||
}
|
||||
return access_allowed;
|
||||
}
|
||||
check_avsit()
|
||||
{
|
||||
if (llGetInventoryType(main_script) == INVENTORY_SCRIPT)
|
||||
{
|
||||
remove_script("This script can not be used with the sit script in the same prim. Removing script!");
|
||||
}
|
||||
}
|
||||
list order_buttons(list buttons)
|
||||
{
|
||||
return llList2List(buttons, -3, -1) + llList2List(buttons, -6, -4) + llList2List(buttons, -9, -7) + llList2List(buttons, -12, -10);
|
||||
}
|
||||
Out(integer level, string out)
|
||||
{
|
||||
if (verbose >= level)
|
||||
{
|
||||
llOwnerSay(llGetScriptName() + "[" + version + "] " + out);
|
||||
}
|
||||
}
|
||||
Readout_Say(string say)
|
||||
{
|
||||
llSleep(0.2);
|
||||
string objectname = llGetObjectName();
|
||||
llSetObjectName("");
|
||||
llRegionSayTo(llGetOwner(), 0, "◆" + say);
|
||||
llSetObjectName(objectname);
|
||||
}
|
||||
dialog(key av, string menu_text, list menu_items)
|
||||
{
|
||||
llDialog(av, product + " " + version + "\n\n" + menu_text, order_buttons(menu_items), menu_channel);
|
||||
last_menu_unixtime = llGetUnixTime();
|
||||
llSetTimerEvent(120);
|
||||
}
|
||||
integer avprop_is_copy_transfer(integer owner_mask)
|
||||
{
|
||||
integer perms = llGetInventoryPermMask(prop_script, owner_mask);
|
||||
if (perms & PERM_COPY && perms & PERM_TRANSFER)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
integer prim_is_mod()
|
||||
{
|
||||
integer perms = llGetObjectPermMask(MASK_OWNER);
|
||||
if (perms & PERM_MODIFY)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
menu_check(string name, key id)
|
||||
{
|
||||
if (pass_security(id) == TRUE)
|
||||
{
|
||||
if (name == last_menu_avatar || llGetUnixTime() - last_menu_unixtime > 5)
|
||||
{
|
||||
last_menu_unixtime = llGetUnixTime();
|
||||
last_menu_avatar = name;
|
||||
menu_page = 0;
|
||||
current_menu = -1;
|
||||
prop_menu(FALSE, id);
|
||||
}
|
||||
else
|
||||
{
|
||||
llDialog(id, product + " " + version + "\n\n" + llList2String(llParseString2List(last_menu_avatar, [" "], []), 0) + " is already using the menu.\nPlease wait a moment.", [], -585868);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
llDialog(id, product + " " + version + "\n\n" + "Sorry, the owner has set this menu to: " + llList2String(MENUCONTROL_TYPES, MENUCONTROL_INDEX), [], -585868);
|
||||
}
|
||||
}
|
||||
options_menu()
|
||||
{
|
||||
string text;
|
||||
list menu_items = ["[BACK]"];
|
||||
text = "Prop options:\n";
|
||||
if (avprop_is_copy_transfer(MASK_OWNER) && prim_is_mod())
|
||||
{
|
||||
menu_items += ["[NEW]", "[DUMP]"];
|
||||
text += "\n[NEW] = Add a new prop.";
|
||||
text += "\n[DUMP] = Read settings to chat.";
|
||||
}
|
||||
menu_items += ["[SAVE]", "[CLEAR]", "[SECURITY]", "[RESET]"];
|
||||
text += "\n[SAVE] = Save prop positions.";
|
||||
text += "\n[CLEAR] = Clear props.";
|
||||
text += "\n[SECURITY] = Menu security.";
|
||||
text += "\n[RESET] = Reload notecard.";
|
||||
dialog(llGetOwner(), text, menu_items);
|
||||
}
|
||||
choice_menu(list options, string menu_text)
|
||||
{
|
||||
last_text = menu_text;
|
||||
choosing = TRUE;
|
||||
menu_text = "\n(Page " + (string)(menu_page + 1) + "/" + (string)menu_pages + ")\n" + menu_text + "\n\n";
|
||||
list menu_items;
|
||||
integer i;
|
||||
if (llGetListLength(options) == 0)
|
||||
{
|
||||
menu_text = "\nNo items of required type in the prim inventory.";
|
||||
menu_items = ["[BACK]"];
|
||||
}
|
||||
else
|
||||
{
|
||||
integer cutoff = 65;
|
||||
integer all_options_length = llStringLength(llDumpList2String(options, ""));
|
||||
integer total_need_to_cut = 412 - all_options_length;
|
||||
if (total_need_to_cut < 0)
|
||||
{
|
||||
cutoff = 43;
|
||||
}
|
||||
for (i = 0; i < llGetListLength(options); i++)
|
||||
{
|
||||
menu_items += (string)(i + 1);
|
||||
string item = llList2String(options, i);
|
||||
if (llStringLength(item) > cutoff)
|
||||
{
|
||||
item = llGetSubString(item, 0, cutoff) + "..";
|
||||
}
|
||||
menu_text += (string)(i + 1) + "." + item + "\n";
|
||||
}
|
||||
while (llGetListLength(menu_items) < number_per_page)
|
||||
{
|
||||
menu_items += " ";
|
||||
}
|
||||
menu_items += ["[BACK]", "[<<]", "[>>]"];
|
||||
}
|
||||
dialog(llGetOwner(), menu_text, menu_items);
|
||||
}
|
||||
list get_choices(integer page)
|
||||
{
|
||||
menu_page = page;
|
||||
list options;
|
||||
integer i;
|
||||
integer start = number_per_page * menu_page;
|
||||
integer end = start + number_per_page;
|
||||
integer type = INVENTORY_OBJECT;
|
||||
i = start;
|
||||
while (llGetListLength(options) + start < end && i < llGetInventoryNumber(type))
|
||||
{
|
||||
options += llGetInventoryName(type, i);
|
||||
i++;
|
||||
}
|
||||
i = llGetInventoryNumber(type);
|
||||
menu_pages = llCeil((float)i / number_per_page);
|
||||
return options;
|
||||
}
|
||||
remove_script(string reason)
|
||||
{
|
||||
string message = "\n" + llGetScriptName() + " ==Script Removed==\n\n" + reason;
|
||||
llDialog(llGetOwner(), message, ["OK"], -3675);
|
||||
llInstantMessage(llGetOwner(), message);
|
||||
llRemoveInventory(llGetScriptName());
|
||||
}
|
||||
integer prop_menu(integer return_pages, key av)
|
||||
{
|
||||
choosing = FALSE;
|
||||
choice = "";
|
||||
integer total_items;
|
||||
integer i = current_menu + 1;
|
||||
while (i < llGetListLength(MENU_LIST) && llSubStringIndex(llList2String(MENU_LIST, i), "M:") != 0)
|
||||
{
|
||||
total_items++;
|
||||
i++;
|
||||
}
|
||||
list menu_items2;
|
||||
if (current_menu != -1)
|
||||
{
|
||||
menu_items2 = ["[BACK]"] + menu_items2;
|
||||
}
|
||||
list menu_items1;
|
||||
if (llGetInventoryType(prop_script) == INVENTORY_SCRIPT)
|
||||
{
|
||||
menu_items2 += ["[OWNER]"];
|
||||
}
|
||||
if (total_items + llGetListLength(menu_items2) > 12)
|
||||
{
|
||||
menu_items2 += ["[<<]", "[>>]"];
|
||||
}
|
||||
integer items_per_page = 12 - llGetListLength(menu_items2);
|
||||
integer page_start = current_menu + 1 + menu_page * items_per_page;
|
||||
for (i = page_start; i < page_start + items_per_page; i++)
|
||||
{
|
||||
if (i < llGetListLength(MENU_LIST))
|
||||
{
|
||||
if (llSubStringIndex(llList2String(MENU_LIST, i), "M:") != -1)
|
||||
{
|
||||
jump end;
|
||||
}
|
||||
if (llListFindList(["T:", "S:", "B:"], [llGetSubString(llList2String(MENU_LIST, i), 0, 1)]) == -1)
|
||||
{
|
||||
menu_items1 += llList2String(MENU_LIST, i);
|
||||
}
|
||||
else
|
||||
{
|
||||
menu_items1 += llGetSubString(llList2String(llParseString2List(llList2String(MENU_LIST, i), ["|"], []), 0), 2, -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@end;
|
||||
if (return_pages)
|
||||
{
|
||||
integer pages = llCeil(total_items) / (12 - llGetListLength(menu_items2));
|
||||
if (total_items % (12 - llGetListLength(menu_items2)) == 0)
|
||||
{
|
||||
pages--;
|
||||
}
|
||||
return pages;
|
||||
}
|
||||
if (llList2String(menu_items2, 0) == "[BACK]")
|
||||
{
|
||||
menu_items1 = ["[BACK]"] + menu_items1;
|
||||
menu_items2 = llDeleteSubList(menu_items2, 0, 0);
|
||||
}
|
||||
menu_channel = ((integer)llFrand(2147483646) + 1) * -1;
|
||||
llListenRemove(listen_handle);
|
||||
listen_handle = llListen(menu_channel, "", av, "");
|
||||
dialog(av, custom_text, menu_items1 + menu_items2);
|
||||
return 0;
|
||||
}
|
||||
string strReplace(string str, string search, string replace)
|
||||
{
|
||||
return llDumpList2String(llParseStringKeepNulls((str = "") + str, [search], []), replace);
|
||||
}
|
||||
naming()
|
||||
{
|
||||
llTextBox(llGetOwner(), "\nPlease type a button name for your prop\nProp: " + choice, menu_channel);
|
||||
}
|
||||
default
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
if (llSubStringIndex(llGetScriptName(), " ") != -1)
|
||||
{
|
||||
remove_script("Use only one copy of this script!");
|
||||
}
|
||||
check_avsit();
|
||||
notecard_key = llGetInventoryKey(notecard_name);
|
||||
Out(0, "Loading...");
|
||||
notecard_query = llGetNotecardLine(notecard_name, notecard_line);
|
||||
}
|
||||
timer()
|
||||
{
|
||||
llListenRemove(listen_handle);
|
||||
}
|
||||
listen(integer listen_channel, string name, key id, string msg)
|
||||
{
|
||||
if (choice)
|
||||
{
|
||||
if (msg == "")
|
||||
{
|
||||
naming();
|
||||
}
|
||||
else
|
||||
{
|
||||
integer perms = llGetInventoryPermMask(choice, MASK_NEXT);
|
||||
if (!(perms & PERM_COPY))
|
||||
{
|
||||
llSay(0, "Could not add prop '" + choice + "'. Props and their content must be COPY-OK for NEXT owner.");
|
||||
}
|
||||
else
|
||||
{
|
||||
llMessageLinked(LINK_THIS, 90173, msg, choice);
|
||||
MENU_LIST = ["B:" + msg] + MENU_LIST;
|
||||
DATA_LIST = [90200] + DATA_LIST;
|
||||
}
|
||||
choice = "";
|
||||
options_menu();
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (choosing && llListFindList(["1", "2", "3", "4", "5", "6", "7", "8", "9"], [msg]) != -1)
|
||||
{
|
||||
choosing = FALSE;
|
||||
choice = llList2String(get_choices(menu_page), (integer)msg - 1);
|
||||
naming();
|
||||
return;
|
||||
}
|
||||
if (msg == "[SECURITY]")
|
||||
{
|
||||
if (id == llGetOwner())
|
||||
{
|
||||
dialog(llGetOwner(), "Who is allowed to control this menu?", MENUCONTROL_TYPES);
|
||||
}
|
||||
else
|
||||
{
|
||||
llRegionSayTo(id, 0, "Sorry, only the owner can use this.");
|
||||
}
|
||||
return;
|
||||
}
|
||||
integer mindex_test = llListFindList(MENU_LIST, ["M:" + msg]);
|
||||
if (mindex_test != -1)
|
||||
{
|
||||
menu_page = 0;
|
||||
current_menu = mindex_test;
|
||||
}
|
||||
mindex_test = llListFindList(MENU_LIST, ["B:" + msg]);
|
||||
if (mindex_test != -1)
|
||||
{
|
||||
list button_data = llParseStringKeepNulls(llList2String(DATA_LIST, mindex_test), ["<22>"], []);
|
||||
if (llList2String(button_data, 1))
|
||||
{
|
||||
msg = llList2String(button_data, 1);
|
||||
}
|
||||
if (llList2String(button_data, 2))
|
||||
{
|
||||
id = llList2String(button_data, 2);
|
||||
}
|
||||
llMessageLinked(LINK_SET, (integer)llList2String(button_data, 0), msg, id);
|
||||
return;
|
||||
}
|
||||
else if (msg == "[>>]" || msg == "[<<]")
|
||||
{
|
||||
if (choosing)
|
||||
{
|
||||
if (msg == "[>>]")
|
||||
{
|
||||
menu_page++;
|
||||
if (menu_page >= menu_pages)
|
||||
{
|
||||
menu_page = 0;
|
||||
}
|
||||
}
|
||||
else if (msg == "[<<]")
|
||||
{
|
||||
menu_page--;
|
||||
if (menu_page < 0)
|
||||
{
|
||||
menu_page = menu_pages - 1;
|
||||
}
|
||||
}
|
||||
choice_menu(get_choices(menu_page), last_text);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (msg == "[<<]")
|
||||
{
|
||||
menu_page--;
|
||||
if (menu_page < 0)
|
||||
{
|
||||
menu_page = prop_menu(TRUE, NULL_KEY);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
menu_page++;
|
||||
if (menu_page > prop_menu(TRUE, NULL_KEY))
|
||||
{
|
||||
menu_page = 0;
|
||||
}
|
||||
}
|
||||
prop_menu(FALSE, id);
|
||||
}
|
||||
return;
|
||||
}
|
||||
else if (msg == "[BACK]")
|
||||
{
|
||||
menu_page = 0;
|
||||
current_menu = -1;
|
||||
}
|
||||
else if (msg == "[NEW]")
|
||||
{
|
||||
llMessageLinked(LINK_THIS, 90200, "", "");
|
||||
choice_menu(get_choices(0), "Please choose your prop:\n\n(Props must include the [AV]object script!)");
|
||||
return;
|
||||
}
|
||||
else if (msg == "[DUMP]")
|
||||
{
|
||||
Readout_Say("");
|
||||
Readout_Say("--✄--COPY BELOW INTO \"AVpos\" NOTECARD--✄--");
|
||||
Readout_Say("");
|
||||
if (custom_text)
|
||||
{
|
||||
Readout_Say("TEXT " + strReplace(custom_text, "\n", "\\n"));
|
||||
}
|
||||
integer i;
|
||||
for (i = 0; i < llGetListLength(MENU_LIST); i++)
|
||||
{
|
||||
list change_me = llParseString2List(llList2String(MENU_LIST, i), [":"], []);
|
||||
if (llGetListLength(change_me) == 2)
|
||||
{
|
||||
if (llList2String(change_me, 0) == "M")
|
||||
{
|
||||
Readout_Say("MENU " + llGetSubString(llList2String(change_me, 1), 0, -2));
|
||||
}
|
||||
else if (llList2String(change_me, 0) == "T")
|
||||
{
|
||||
Readout_Say("TOMENU " + llGetSubString(llList2String(change_me, 1), 0, -2));
|
||||
}
|
||||
else if (llList2String(change_me, 0) == "B")
|
||||
{
|
||||
list l = [llList2String(change_me, 1), strReplace(strReplace(llList2String(DATA_LIST, i), "90200", ""), "<22>", "|")];
|
||||
if (llList2String(l, 1) == "")
|
||||
{
|
||||
l = llList2List(l, 0, 0);
|
||||
}
|
||||
string end = llDumpList2String(l, "|");
|
||||
Readout_Say("BUTTON " + end);
|
||||
}
|
||||
}
|
||||
}
|
||||
llMessageLinked(LINK_THIS, 90020, "0", prop_script);
|
||||
return;
|
||||
}
|
||||
else if (msg == "[SAVE]" && id == llGetOwner())
|
||||
{
|
||||
llMessageLinked(LINK_SET, 90101, "0|" + msg, "");
|
||||
options_menu();
|
||||
return;
|
||||
}
|
||||
else if (msg == "[CLEAR]")
|
||||
{
|
||||
Out(0, "Props have been cleared!");
|
||||
llMessageLinked(LINK_THIS, 90200, "", "");
|
||||
}
|
||||
else if (msg == "[RESET]")
|
||||
{
|
||||
llMessageLinked(LINK_THIS, 90200, "", "");
|
||||
llSleep(1);
|
||||
llResetOtherScript(prop_script);
|
||||
llResetScript();
|
||||
return;
|
||||
}
|
||||
else if (msg == "[BACK]")
|
||||
{
|
||||
}
|
||||
else if (msg == "[OWNER]")
|
||||
{
|
||||
if (id == llGetOwner())
|
||||
{
|
||||
options_menu();
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
llRegionSayTo(id, 0, "Sorry, only the owner can use this.");
|
||||
}
|
||||
}
|
||||
else if (id == llGetOwner() && llListFindList(MENUCONTROL_TYPES, [msg]) != -1)
|
||||
{
|
||||
MENUCONTROL_INDEX = llListFindList(MENUCONTROL_TYPES, [msg]);
|
||||
Out(0, "Menu access set to: " + llList2String(MENUCONTROL_TYPES, MENUCONTROL_INDEX));
|
||||
if (llGetInventoryType(prop_script) == INVENTORY_SCRIPT)
|
||||
{
|
||||
options_menu();
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
}
|
||||
prop_menu(FALSE, id);
|
||||
}
|
||||
touch_start(integer touched)
|
||||
{
|
||||
if (MTYPE < 3)
|
||||
{
|
||||
menu_check(llDetectedName(0), llDetectedKey(0));
|
||||
}
|
||||
}
|
||||
changed(integer change)
|
||||
{
|
||||
if (change & CHANGED_INVENTORY)
|
||||
{
|
||||
if (llGetInventoryKey(notecard_name) != notecard_key)
|
||||
{
|
||||
llResetScript();
|
||||
}
|
||||
check_avsit();
|
||||
}
|
||||
}
|
||||
link_message(integer sender, integer num, string msg, key id)
|
||||
{
|
||||
if (sender == llGetLinkNumber())
|
||||
{
|
||||
if (num == 90005)
|
||||
{
|
||||
menu_check(llKey2Name(id), id);
|
||||
}
|
||||
else if (num == 90022)
|
||||
{
|
||||
Readout_Say(msg);
|
||||
}
|
||||
else if (num == 90021)
|
||||
{
|
||||
Readout_Say("");
|
||||
Readout_Say("--✄--COPY ABOVE INTO \"AVpos\" NOTECARD--✄--");
|
||||
Readout_Say("");
|
||||
}
|
||||
}
|
||||
}
|
||||
dataserver(key query_id, string data)
|
||||
{
|
||||
if (query_id == notecard_query)
|
||||
{
|
||||
if (data == EOF)
|
||||
{
|
||||
Out(0, (string)llGetListLength(MENU_LIST) + " menu items Ready, Memory: " + (string)llGetFreeMemory());
|
||||
llPassTouches(FALSE);
|
||||
if (MTYPE == 3)
|
||||
{
|
||||
llPassTouches(TRUE);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
data = llGetSubString(data, llSubStringIndex(data, "◆") + 1, -1);
|
||||
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);
|
||||
string part1 = llList2String(parts, 1);
|
||||
if (llGetListLength(parts) > 1)
|
||||
{
|
||||
part1 = llStringTrim(llDumpList2String(llList2List(parts, 1, -1), "<22>"), STRING_TRIM);
|
||||
}
|
||||
if (command == "TEXT")
|
||||
{
|
||||
custom_text = llDumpList2String(llParseStringKeepNulls(part0, ["\\n"], []), "\n");
|
||||
}
|
||||
part0 = llGetSubString(part0, 0, 22);
|
||||
if (command == "MENU")
|
||||
{
|
||||
MENU_LIST += ["M:" + part0 + "*"];
|
||||
DATA_LIST += "";
|
||||
}
|
||||
else if (command == "TOMENU")
|
||||
{
|
||||
MENU_LIST += ["T:" + part0 + "*"];
|
||||
DATA_LIST += "";
|
||||
}
|
||||
else if (command == "BUTTON")
|
||||
{
|
||||
MENU_LIST += ["B:" + part0];
|
||||
if (part1 == "")
|
||||
{
|
||||
part1 = "90200";
|
||||
}
|
||||
DATA_LIST += part1;
|
||||
}
|
||||
else if (command == "MTYPE")
|
||||
{
|
||||
MTYPE = (integer)part0;
|
||||
}
|
||||
notecard_query = llGetNotecardLine(notecard_name, ++notecard_line);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
241
AVsitter2/Plugins/AVprop/[AV]object.lsl
Normal file
241
AVsitter2/Plugins/AVprop/[AV]object.lsl
Normal file
|
@ -0,0 +1,241 @@
|
|||
/*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* Copyright (c) the AVsitter Contributors (http://avsitter.github.io)
|
||||
* AVsitter™ is a trademark. For trademark use policy see:
|
||||
* https://avsitter.github.io/TRADEMARK.mediawiki
|
||||
*
|
||||
* Please consider supporting continued development of AVsitter and
|
||||
* receive automatic updates and other benefits! All details and user
|
||||
* instructions can be found at http://avsitter.github.io
|
||||
*/
|
||||
|
||||
/*
|
||||
* The release version of the [AV]object Script has the original AVsitter experience
|
||||
* enabled. Scripts with this experience may not be shared in full perms form.
|
||||
* Please support further development of AVsitter by not sharing it!
|
||||
* If you acquired this script from someone else, please support the
|
||||
* developers by purchasing AVsitter (see https://avsitter.github.io)
|
||||
* and also obtain the benefit of automatic updates.
|
||||
*/
|
||||
|
||||
string version = "2.020";
|
||||
integer comm_channel;
|
||||
integer local_attach_channel = -2907539;
|
||||
integer listen_handle;
|
||||
integer prop_type;
|
||||
integer prop_id;
|
||||
integer prop_point;
|
||||
integer experience_denied_reason;
|
||||
key originalowner;
|
||||
key give_prop_warning_request;
|
||||
unsit_all()
|
||||
{
|
||||
integer i = llGetNumberOfPrims();
|
||||
while (llGetAgentSize(llGetLinkKey(i)))
|
||||
{
|
||||
llUnSit(llGetLinkKey(i));
|
||||
i--;
|
||||
}
|
||||
}
|
||||
integer verbose = 5;
|
||||
Out(integer level, string out)
|
||||
{
|
||||
if (verbose >= level)
|
||||
{
|
||||
llOwnerSay(llGetScriptName() + "[" + version + "] " + out);
|
||||
}
|
||||
}
|
||||
default
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
}
|
||||
on_rez(integer start)
|
||||
{
|
||||
if (start)
|
||||
{
|
||||
state prop;
|
||||
}
|
||||
}
|
||||
}
|
||||
state prop
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
if (llGetLinkNumber() < 2)
|
||||
{
|
||||
if (llGetStartParameter() <= -10000000)
|
||||
{
|
||||
string start_param = (string)llGetStartParameter();
|
||||
prop_type = (integer)llGetSubString(start_param, -1, -1);
|
||||
prop_point = (integer)llGetSubString(start_param, -3, -2);
|
||||
prop_id = (integer)llGetSubString(start_param, -5, -4);
|
||||
comm_channel = (integer)llGetSubString(start_param, 0, -6);
|
||||
listen_handle = llListen(comm_channel, "", "", "");
|
||||
llSay(comm_channel, "REZ|" + (string)prop_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
}
|
||||
if (prop_type != 2 && prop_type != 1)
|
||||
{
|
||||
if (llGetInventoryType("[AV]sitA") == INVENTORY_NONE)
|
||||
{
|
||||
llSetClickAction(-1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
llSetClickAction(CLICK_ACTION_TOUCH);
|
||||
}
|
||||
}
|
||||
attach(key id)
|
||||
{
|
||||
if (comm_channel)
|
||||
{
|
||||
if (llGetAttached())
|
||||
{
|
||||
llListen(local_attach_channel, "", "", "");
|
||||
llSay(comm_channel, "ATTACHED|" + (string)prop_id);
|
||||
llSay(local_attach_channel, "LOCAT|" + (string)llGetAttached());
|
||||
if (experience_denied_reason == 17)
|
||||
{
|
||||
if (llGetOwner() == originalowner)
|
||||
{
|
||||
list details = llGetExperienceDetails("");
|
||||
if (llList2String(details, 3) == "17")
|
||||
{
|
||||
llSay(comm_channel, "NAG|" + llList2String(details, 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
llSay(comm_channel, "DETACHED|" + (string)prop_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
touch_start(integer touched)
|
||||
{
|
||||
if ((!llGetAttached()) && (prop_type == 2 || prop_type == 1))
|
||||
{
|
||||
llRequestExperiencePermissions(llDetectedKey(0), "");
|
||||
}
|
||||
}
|
||||
run_time_permissions(integer permissions)
|
||||
{
|
||||
if (permissions & PERMISSION_ATTACH)
|
||||
{
|
||||
if (llGetAttached())
|
||||
{
|
||||
llDetachFromAvatar();
|
||||
}
|
||||
else
|
||||
{
|
||||
llAttachToAvatarTemp(prop_point);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
llSay(comm_channel, "DEREZ|" + (string)prop_id);
|
||||
llDie();
|
||||
}
|
||||
}
|
||||
experience_permissions(key target_id)
|
||||
{
|
||||
if (llGetAttached())
|
||||
{
|
||||
llDetachFromAvatar();
|
||||
}
|
||||
else
|
||||
{
|
||||
llAttachToAvatarTemp(prop_point);
|
||||
}
|
||||
}
|
||||
experience_permissions_denied(key agent_id, integer reason)
|
||||
{
|
||||
originalowner = llGetOwner();
|
||||
experience_denied_reason = reason;
|
||||
llRequestPermissions(agent_id, PERMISSION_ATTACH);
|
||||
}
|
||||
on_rez(integer start)
|
||||
{
|
||||
if (!llGetAttached())
|
||||
{
|
||||
state restart_prop;
|
||||
}
|
||||
}
|
||||
listen(integer channel, string name, key id, string message)
|
||||
{
|
||||
list data = llParseString2List(message, ["|"], []);
|
||||
string command = llList2String(data, 0);
|
||||
if (llList2String(data, 0) == "LOCAT" && llGetOwnerKey(id) == llGetOwner() && llList2String(data, 1) == (string)llGetAttached())
|
||||
{
|
||||
llRequestPermissions(llGetOwner(), PERMISSION_ATTACH);
|
||||
}
|
||||
else if (command == "ATTACHTO" && prop_type == 1 && (key)llList2String(data, 2) == llGetKey())
|
||||
{
|
||||
if (llGetAgentSize((key)llList2String(data, 1)) == ZERO_VECTOR)
|
||||
{
|
||||
llSay(comm_channel, "DEREZ|" + (string)prop_id);
|
||||
llDie();
|
||||
}
|
||||
else
|
||||
{
|
||||
llRequestExperiencePermissions((key)llList2String(data, 1), "");
|
||||
}
|
||||
}
|
||||
else if (llGetSubString(command, 0, 3) == "REM_")
|
||||
{
|
||||
integer remove;
|
||||
if (command == "REM_ALL")
|
||||
{
|
||||
remove = TRUE;
|
||||
}
|
||||
else if (command == "REM_INDEX" || (command == "REM_WORLD" && (!llGetAttached())))
|
||||
{
|
||||
if (~llListFindList(data, [(string)prop_id]))
|
||||
{
|
||||
remove = TRUE;
|
||||
}
|
||||
}
|
||||
else if (llGetAttached() && command == "REM_WORN" && (key)llList2String(data, 1) == llGetOwner())
|
||||
{
|
||||
remove = TRUE;
|
||||
}
|
||||
if (remove)
|
||||
{
|
||||
if (llGetAttached())
|
||||
{
|
||||
llRequestPermissions(llGetOwner(), PERMISSION_ATTACH);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (llGetAgentSize(llGetLinkKey(llGetNumberOfPrims())))
|
||||
{
|
||||
unsit_all();
|
||||
llSleep(1);
|
||||
}
|
||||
llSay(comm_channel, "DEREZ|" + (string)prop_id);
|
||||
llDie();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (message == "PROPSEARCH" && (!llGetAttached()))
|
||||
{
|
||||
llSay(comm_channel, "SAVEPROP|" + (string)prop_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
state restart_prop
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
state prop;
|
||||
}
|
||||
}
|
578
AVsitter2/Plugins/AVprop/[AV]prop.lsl
Normal file
578
AVsitter2/Plugins/AVprop/[AV]prop.lsl
Normal file
|
@ -0,0 +1,578 @@
|
|||
/*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* Copyright (c) the AVsitter Contributors (http://avsitter.github.io)
|
||||
* AVsitter™ is a trademark. For trademark use policy see:
|
||||
* https://avsitter.github.io/TRADEMARK.mediawiki
|
||||
*
|
||||
* Please consider supporting continued development of AVsitter and
|
||||
* receive automatic updates and other benefits! All details and user
|
||||
* instructions can be found at http://avsitter.github.io
|
||||
*/
|
||||
|
||||
string version = "2.2";
|
||||
string notecard_name = "AVpos";
|
||||
string main_script = "[AV]sitA";
|
||||
key key_request;
|
||||
integer comm_channel;
|
||||
integer WARN = 1;
|
||||
key notecard_key;
|
||||
key notecard_query;
|
||||
integer notecard_line;
|
||||
integer notecard_section;
|
||||
integer listen_handle;
|
||||
list prop_triggers;
|
||||
list prop_types;
|
||||
list prop_objects;
|
||||
list prop_positions;
|
||||
list prop_rotations;
|
||||
list prop_groups;
|
||||
list prop_points;
|
||||
list sequential_prop_groups;
|
||||
integer HAVENTNAGGED = TRUE;
|
||||
list SITTERS;
|
||||
list SITTER_POSES;
|
||||
list ATTACH_POINTS = [ATTACH_CHEST, "chest", ATTACH_HEAD, "head", ATTACH_LSHOULDER, "left shoulder", ATTACH_RSHOULDER, "right shoulder", ATTACH_LHAND, "left hand", ATTACH_RHAND, "right hand", ATTACH_LFOOT, "left foot", ATTACH_RFOOT, "right foot", ATTACH_BACK, "back", ATTACH_PELVIS, "pelvis", ATTACH_MOUTH, "mouth", ATTACH_CHIN, "chin", ATTACH_LEAR, "left ear", ATTACH_REAR, "right ear", ATTACH_LEYE, "left eye", ATTACH_REYE, "right eye", ATTACH_NOSE, "nose", ATTACH_RUARM, "right upper arm", ATTACH_RLARM, "right lower arm", ATTACH_LUARM, "left upper arm", ATTACH_LLARM, "left lower arm", ATTACH_RHIP, "right hip", ATTACH_RULEG, "right upper leg", ATTACH_RLLEG, "right lower leg", ATTACH_LHIP, "left hip", ATTACH_LULEG, "left upper leg", ATTACH_LLLEG, "left lower leg", ATTACH_BELLY, "stomach", ATTACH_LEFT_PEC, "left pectoral", ATTACH_RIGHT_PEC, "right pectoral", ATTACH_HUD_CENTER_2, "HUD center 2", ATTACH_HUD_TOP_RIGHT, "HUD top right", ATTACH_HUD_TOP_CENTER, "HUD top", ATTACH_HUD_TOP_LEFT, "HUD top left", ATTACH_HUD_CENTER_1, "HUD center", ATTACH_HUD_BOTTOM_LEFT, "HUD bottom left", ATTACH_HUD_BOTTOM, "HUD bottom", ATTACH_HUD_BOTTOM_RIGHT, "HUD bottom right", 39, "neck", 40, "avatar center"];
|
||||
integer verbose = 5;
|
||||
Out(integer level, string out)
|
||||
{
|
||||
if (verbose >= level)
|
||||
{
|
||||
llOwnerSay(llGetScriptName() + "[" + version + "] " + out);
|
||||
}
|
||||
}
|
||||
integer IsInteger(string data)
|
||||
{
|
||||
return llParseString2List((string)llParseString2List(data, ["8", "9"], []), ["0", "1", "2", "3", "4", "5", "6", "7"], []) == [] && data != "";
|
||||
}
|
||||
integer get_number_of_scripts()
|
||||
{
|
||||
integer i = 1;
|
||||
while (llGetInventoryType(main_script + " " + (string)i) == INVENTORY_SCRIPT)
|
||||
{
|
||||
i++;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
integer get_point(string text)
|
||||
{
|
||||
integer i;
|
||||
for (i = 1; i < llGetListLength(ATTACH_POINTS); i = i + 2)
|
||||
{
|
||||
if (~llSubStringIndex(llToUpper(text), llToUpper(llList2String(ATTACH_POINTS, i))))
|
||||
{
|
||||
return llList2Integer(ATTACH_POINTS, i - 1);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
rez_prop(integer index)
|
||||
{
|
||||
integer type = llList2Integer(prop_types, index);
|
||||
string object = llList2String(prop_objects, index);
|
||||
if (object != "")
|
||||
{
|
||||
vector pos = llList2Vector(prop_positions, index) * llGetRot() + llGetPos();
|
||||
rotation rot = llEuler2Rot(llList2Vector(prop_rotations, index) * DEG_TO_RAD) * llGetRot();
|
||||
integer pt = get_point(llList2String(prop_points, index));
|
||||
string point = (string)pt;
|
||||
if (llStringLength(point) == 1)
|
||||
{
|
||||
point = "0" + point;
|
||||
}
|
||||
string prop_id = (string)index;
|
||||
if (llStringLength(prop_id) == 1)
|
||||
{
|
||||
prop_id = "0" + prop_id;
|
||||
}
|
||||
integer int = (integer)((string)comm_channel + prop_id + point + (string)type);
|
||||
if (llGetInventoryType(object) != INVENTORY_OBJECT)
|
||||
{
|
||||
llSay(0, "Could not find prop '" + object + "'.");
|
||||
return;
|
||||
}
|
||||
integer perms = llGetInventoryPermMask(object, MASK_NEXT);
|
||||
string next = " for NEXT owner";
|
||||
if (WARN == 2)
|
||||
{
|
||||
next = "";
|
||||
perms = llGetInventoryPermMask(object, MASK_OWNER);
|
||||
}
|
||||
if (type == 0 || type == 3)
|
||||
{
|
||||
if (!(perms & PERM_COPY))
|
||||
{
|
||||
llSay(0, "Can't rez '" + object + "'. Props and their content must be COPY-OK" + next);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (type > 0)
|
||||
{
|
||||
if ((!(perms & PERM_COPY)) || (!(perms & PERM_TRANSFER)))
|
||||
{
|
||||
llSay(0, "Can't rez '" + object + "'. Attachment props and their content must be COPY-TRANSFER" + next);
|
||||
return;
|
||||
}
|
||||
}
|
||||
llRezAtRoot(object, pos, ZERO_VECTOR, rot, int);
|
||||
}
|
||||
}
|
||||
send_command(string command)
|
||||
{
|
||||
llRegionSay(comm_channel, command);
|
||||
llSay(comm_channel, command);
|
||||
}
|
||||
remove_all_props()
|
||||
{
|
||||
send_command("REM_ALL");
|
||||
}
|
||||
rez_props_by_trigger(string pose_name)
|
||||
{
|
||||
integer i;
|
||||
for (; i < llGetListLength(prop_triggers); i++)
|
||||
{
|
||||
if (llList2String(prop_triggers, i) == pose_name)
|
||||
{
|
||||
rez_prop(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
list get_props_by_pose(string pose_name)
|
||||
{
|
||||
list props_to_do;
|
||||
integer i;
|
||||
for (; i < llGetListLength(prop_triggers); i++)
|
||||
{
|
||||
if (llList2String(prop_triggers, i) == pose_name)
|
||||
{
|
||||
props_to_do += i;
|
||||
}
|
||||
}
|
||||
return props_to_do;
|
||||
}
|
||||
remove_props_by_sitter(string sitter, integer remove_type3)
|
||||
{
|
||||
list text;
|
||||
integer i;
|
||||
for (; i < llGetListLength(prop_triggers); i++)
|
||||
{
|
||||
if (llSubStringIndex(llList2String(prop_triggers, i), sitter + "|") == 0)
|
||||
{
|
||||
if (llList2Integer(prop_types, i) != 3 || remove_type3)
|
||||
{
|
||||
text += [i];
|
||||
}
|
||||
}
|
||||
}
|
||||
string command = "REM_INDEX";
|
||||
if (llGetInventoryType(main_script) != INVENTORY_SCRIPT)
|
||||
{
|
||||
command = "REM_WORLD";
|
||||
}
|
||||
if (text)
|
||||
{
|
||||
send_command(llDumpList2String([command] + text, "|"));
|
||||
}
|
||||
}
|
||||
remove_worn(key av)
|
||||
{
|
||||
send_command(llDumpList2String(["REM_WORN", av], "|"));
|
||||
}
|
||||
remove_sitter_props_by_pose(string sitter_pose, integer remove_type3)
|
||||
{
|
||||
list text;
|
||||
integer i;
|
||||
for (; i < llGetListLength(prop_triggers); i++)
|
||||
{
|
||||
if (llList2String(prop_triggers, i) == sitter_pose)
|
||||
{
|
||||
if (llList2Integer(prop_types, i) != 3 || remove_type3)
|
||||
{
|
||||
text += [i];
|
||||
}
|
||||
}
|
||||
}
|
||||
if (text)
|
||||
{
|
||||
send_command(llDumpList2String(["REM_INDEX"] + text, "|"));
|
||||
}
|
||||
}
|
||||
remove_sitter_props_by_pose_group(string msg)
|
||||
{
|
||||
list props = get_props_by_pose(msg);
|
||||
list groups;
|
||||
integer i;
|
||||
for (; i < llGetListLength(props); i++)
|
||||
{
|
||||
string prop_group = llList2String(prop_groups, llList2Integer(props, i));
|
||||
if (!~llListFindList(groups, [prop_group]))
|
||||
{
|
||||
groups += prop_group;
|
||||
remove_props_by_group(llListFindList(sequential_prop_groups, [prop_group]));
|
||||
}
|
||||
}
|
||||
}
|
||||
remove_props_by_group(integer gp)
|
||||
{
|
||||
list text;
|
||||
string group = llList2String(sequential_prop_groups, gp);
|
||||
integer i;
|
||||
for (; i < llGetListLength(prop_groups); i++)
|
||||
{
|
||||
if (llList2String(prop_groups, i) == group)
|
||||
{
|
||||
text += [i];
|
||||
}
|
||||
}
|
||||
string command = "REM_INDEX";
|
||||
if (llGetInventoryType(main_script) != INVENTORY_SCRIPT)
|
||||
{
|
||||
command = "REM_WORLD";
|
||||
}
|
||||
if (text)
|
||||
{
|
||||
send_command(llDumpList2String([command] + text, "|"));
|
||||
}
|
||||
}
|
||||
Readout_Say(string say)
|
||||
{
|
||||
llSleep(0.2);
|
||||
llMessageLinked(LINK_THIS, 90022, say, "");
|
||||
}
|
||||
init_sitters()
|
||||
{
|
||||
SITTERS = [];
|
||||
SITTER_POSES = [];
|
||||
integer i;
|
||||
for (i = 0; i < get_number_of_scripts(); i++)
|
||||
{
|
||||
SITTERS += NULL_KEY;
|
||||
SITTER_POSES += "";
|
||||
}
|
||||
}
|
||||
init_channel()
|
||||
{
|
||||
llListenRemove(listen_handle);
|
||||
comm_channel = ((integer)llFrand(8999) + 1000) * -1;
|
||||
listen_handle = llListen(comm_channel, "", "", "");
|
||||
}
|
||||
string element(string text, integer x)
|
||||
{
|
||||
return llList2String(llParseStringKeepNulls(text, ["|"], []), x);
|
||||
}
|
||||
default
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
Out(0, "Mem=" + (string)(65536 - llGetUsedMemory()));
|
||||
init_sitters();
|
||||
init_channel();
|
||||
notecard_key = llGetInventoryKey(notecard_name);
|
||||
if (llGetInventoryType(notecard_name) == INVENTORY_NOTECARD)
|
||||
{
|
||||
Out(0, "Loading...");
|
||||
notecard_query = llGetNotecardLine(notecard_name, 0);
|
||||
}
|
||||
}
|
||||
on_rez(integer start)
|
||||
{
|
||||
init_channel();
|
||||
}
|
||||
link_message(integer sender, integer num, string msg, key id)
|
||||
{
|
||||
if (sender == llGetLinkNumber())
|
||||
{
|
||||
if (num == 90045)
|
||||
{
|
||||
list data = llParseStringKeepNulls(msg, ["|"], []);
|
||||
integer sitter = (integer)llList2String(data, 0);
|
||||
if (id == llList2Key(SITTERS, sitter))
|
||||
{
|
||||
remove_sitter_props_by_pose(llList2String(SITTER_POSES, sitter), FALSE);
|
||||
string given_posename = llList2String(data, 1);
|
||||
given_posename = (string)sitter + "|" + given_posename;
|
||||
SITTER_POSES = llListReplaceList(SITTER_POSES, [given_posename], sitter, sitter);
|
||||
remove_sitter_props_by_pose_group(given_posename);
|
||||
rez_props_by_trigger(given_posename);
|
||||
}
|
||||
}
|
||||
else if (num == 90200 || num == 90220)
|
||||
{
|
||||
list ids = llParseStringKeepNulls(id, ["|"], []);
|
||||
key sitting_av_or_sitter = (key)llList2String(ids, -1);
|
||||
if (llGetInventoryType(main_script) != INVENTORY_SCRIPT)
|
||||
{
|
||||
SITTERS = [sitting_av_or_sitter];
|
||||
}
|
||||
integer i;
|
||||
if (!llSubStringIndex(msg, "remprop_"))
|
||||
{
|
||||
for (; i < llGetListLength(SITTERS); i++)
|
||||
{
|
||||
if (llList2Key(SITTERS, i) == sitting_av_or_sitter || id == "" || (string)sitting_av_or_sitter == (string)i)
|
||||
{
|
||||
remove_sitter_props_by_pose((string)i + "|" + llGetSubString(msg, 8, -1), TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
integer flag;
|
||||
for (; i < llGetListLength(SITTERS); i++)
|
||||
{
|
||||
if (~llListFindList(prop_triggers, [(string)i + "|" + msg]))
|
||||
{
|
||||
flag = TRUE;
|
||||
}
|
||||
}
|
||||
for (i = 0; i < llGetListLength(SITTERS); i++)
|
||||
{
|
||||
if (llList2Key(SITTERS, i) == sitting_av_or_sitter || id == "" || (string)sitting_av_or_sitter == (string)i)
|
||||
{
|
||||
integer index = llListFindList(prop_triggers, [(string)i + "|" + msg]);
|
||||
if (!~index)
|
||||
{
|
||||
if (llGetInventoryType(main_script) != INVENTORY_SCRIPT)
|
||||
{
|
||||
remove_all_props();
|
||||
}
|
||||
else if (!flag)
|
||||
{
|
||||
remove_props_by_sitter((string)i, TRUE);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
remove_sitter_props_by_pose_group((string)i + "|" + msg);
|
||||
rez_props_by_trigger((string)i + "|" + msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (sitting_av_or_sitter)
|
||||
{
|
||||
if (num == 90200)
|
||||
{
|
||||
llMessageLinked(LINK_THIS, 90005, "", id);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (num == 90101)
|
||||
{
|
||||
list data = llParseString2List(msg, ["|"], []);
|
||||
if (llList2String(data, 1) == "[SAVE]")
|
||||
{
|
||||
llRegionSay(comm_channel, "PROPSEARCH");
|
||||
}
|
||||
}
|
||||
else if (num == 90065)
|
||||
{
|
||||
remove_props_by_sitter(msg, FALSE);
|
||||
remove_worn(id);
|
||||
integer index = llListFindList(SITTERS, [id]);
|
||||
if (~index)
|
||||
{
|
||||
SITTERS = llListReplaceList(SITTERS, [NULL_KEY], index, index);
|
||||
}
|
||||
}
|
||||
else if (num == 90030)
|
||||
{
|
||||
remove_props_by_sitter(msg, FALSE);
|
||||
remove_props_by_sitter((string)id, FALSE);
|
||||
SITTERS = llListReplaceList(SITTERS, [NULL_KEY], (integer)msg, (integer)msg);
|
||||
SITTERS = llListReplaceList(SITTERS, [NULL_KEY], (integer)((string)id), (integer)((string)id));
|
||||
}
|
||||
else if (num == 90070)
|
||||
{
|
||||
SITTERS = llListReplaceList(SITTERS, [id], (integer)msg, (integer)msg);
|
||||
}
|
||||
else if (num == 90171 || num == 90173)
|
||||
{
|
||||
integer sitter;
|
||||
if (num == 90171)
|
||||
{
|
||||
sitter = (integer)msg;
|
||||
prop_triggers += [llList2String(SITTER_POSES, sitter)];
|
||||
}
|
||||
else
|
||||
{
|
||||
sitter = 0;
|
||||
SITTER_POSES = ["0|" + msg];
|
||||
prop_triggers += "0|" + msg;
|
||||
}
|
||||
prop_types += 0;
|
||||
prop_objects += (string)id;
|
||||
string prop_group = (string)sitter + "|G1";
|
||||
prop_groups += prop_group;
|
||||
if (llListFindList(sequential_prop_groups, [prop_group]) == -1)
|
||||
{
|
||||
sequential_prop_groups += prop_group;
|
||||
}
|
||||
prop_positions += <0,0,1>;
|
||||
prop_rotations += <0,0,0>;
|
||||
prop_points += "";
|
||||
rez_prop(llGetListLength(prop_triggers) - 1);
|
||||
string text = "PROP added: '" + (string)id + "' to '" + element(llList2String(SITTER_POSES, sitter), 1) + "'";
|
||||
if (llGetListLength(SITTERS) > 1)
|
||||
{
|
||||
text += " for SITTER " + (string)sitter;
|
||||
}
|
||||
llSay(0, text);
|
||||
llSay(0, "Position your prop and click [SAVE].");
|
||||
}
|
||||
else if (num == 90020 && (string)id == llGetScriptName())
|
||||
{
|
||||
integer i;
|
||||
for (; i < llGetListLength(prop_triggers); i++)
|
||||
{
|
||||
if (llSubStringIndex(llList2String(prop_triggers, i), msg + "|") == 0)
|
||||
{
|
||||
string type = (string)llList2Integer(prop_types, i);
|
||||
if (type == "0")
|
||||
{
|
||||
type = "";
|
||||
}
|
||||
Readout_Say("PROP" + type + " " + llDumpList2String([element(llList2String(prop_triggers, i), 1), llList2String(prop_objects, i), element(llList2String(prop_groups, i), 1), llList2String(prop_positions, i), llList2String(prop_rotations, i), llList2String(prop_points, i)], "|"));
|
||||
}
|
||||
}
|
||||
llMessageLinked(LINK_THIS, 90021, msg, llGetScriptName());
|
||||
}
|
||||
}
|
||||
}
|
||||
changed(integer change)
|
||||
{
|
||||
if (change & CHANGED_INVENTORY)
|
||||
{
|
||||
if (llGetInventoryKey(notecard_name) != notecard_key)
|
||||
{
|
||||
remove_all_props();
|
||||
llResetScript();
|
||||
}
|
||||
else if (get_number_of_scripts() != llGetListLength(SITTERS))
|
||||
{
|
||||
init_sitters();
|
||||
}
|
||||
}
|
||||
else if (change & CHANGED_LINK)
|
||||
{
|
||||
if (llGetAgentSize(llGetLinkKey(llGetNumberOfPrims())) == ZERO_VECTOR)
|
||||
{
|
||||
HAVENTNAGGED = TRUE;
|
||||
if (llGetInventoryType(main_script) == INVENTORY_SCRIPT)
|
||||
{
|
||||
remove_all_props();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
listen(integer channel, string name, key id, string message)
|
||||
{
|
||||
list data = llParseStringKeepNulls(message, ["|"], []);
|
||||
if (llList2String(data, 0) == "SAVEPROP")
|
||||
{
|
||||
integer index = (integer)llList2String(data, 1);
|
||||
if (index >= 0 && index < llGetListLength(prop_triggers))
|
||||
{
|
||||
if (llList2Vector(llGetObjectDetails(id, [OBJECT_POS]), 0) != ZERO_VECTOR)
|
||||
{
|
||||
list details = [OBJECT_POS, OBJECT_ROT];
|
||||
rotation f = llList2Rot(details = llGetObjectDetails(llGetKey(), details) + llGetObjectDetails(id, details), 1);
|
||||
vector target_rot = llRot2Euler(llList2Rot(details, 3) / f) * RAD_TO_DEG;
|
||||
vector target_pos = (llList2Vector(details, 2) - llList2Vector(details, 0)) / f;
|
||||
prop_positions = llListReplaceList(prop_positions, [target_pos], index, index);
|
||||
prop_rotations = llListReplaceList(prop_rotations, [target_rot], index, index);
|
||||
string type = llList2String(prop_types, index);
|
||||
if (type == "0")
|
||||
{
|
||||
type = "";
|
||||
}
|
||||
string text = "PROP Saved to memory, SITTER " + element(llList2String(prop_triggers, index), 0) + ": PROP" + type + " " + element(llList2String(prop_triggers, index), 1) + "|" + name + "|" + element(llList2String(prop_groups, index), 1) + "|" + (string)target_pos + "|" + (string)target_rot + "|" + llList2String(prop_points, index);
|
||||
llSay(0, text);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Out(0, "Error, cannot find prop: " + name);
|
||||
}
|
||||
}
|
||||
else if (llList2String(data, 0) == "ATTACHED" || llList2String(data, 0) == "DETACHED" || llList2String(data, 0) == "REZ" || llList2String(data, 0) == "DEREZ")
|
||||
{
|
||||
integer prop_index = (integer)llList2String(data, 1);
|
||||
integer sitter = (integer)llList2String(llParseStringKeepNulls(llList2String(prop_triggers, prop_index), ["|"], []), 0);
|
||||
key sitter_key = llList2Key(SITTERS, sitter);
|
||||
if (sitter_key != NULL_KEY && llList2String(data, 0) == "REZ" && llList2Integer(prop_types, prop_index) == 1)
|
||||
{
|
||||
llSay(comm_channel, "ATTACHTO|" + (string)sitter_key + "|" + (string)id);
|
||||
}
|
||||
llMessageLinked(LINK_SET, 90500, llDumpList2String([llList2String(data, 0), llList2String(prop_triggers, prop_index), llList2String(prop_objects, prop_index), llList2String(llParseStringKeepNulls(llList2String(prop_groups, prop_index), ["|"], []), 1), id], "|"), sitter_key);
|
||||
}
|
||||
else if (llList2String(data, 0) == "NAG" && HAVENTNAGGED && (!llGetAttached()))
|
||||
{
|
||||
llRegionSayTo(llGetOwner(), 0, "To enable auto-attachments, please enable the experience '" + llList2String(data, 1) + "' by Code Violet in 'About Land'.");
|
||||
HAVENTNAGGED = FALSE;
|
||||
}
|
||||
}
|
||||
dataserver(key query_id, string data)
|
||||
{
|
||||
if (query_id == notecard_query)
|
||||
{
|
||||
if (data == EOF)
|
||||
{
|
||||
Out(0, (string)llGetListLength(prop_triggers) + " Props Ready, Mem=" + (string)llGetFreeMemory());
|
||||
}
|
||||
else
|
||||
{
|
||||
data = llGetSubString(data, llSubStringIndex(data, "◆") + 1, -1);
|
||||
data = llStringTrim(data, STRING_TRIM);
|
||||
string command = llGetSubString(data, 0, llSubStringIndex(data, " ") - 1);
|
||||
list parts = llParseStringKeepNulls(llGetSubString(data, llSubStringIndex(data, " ") + 1, -1), [" | ", " |", "| ", "|"], []);
|
||||
if (command == "SITTER")
|
||||
{
|
||||
notecard_section = (integer)llList2String(parts, 0);
|
||||
}
|
||||
else if (llGetSubString(command, 0, 3) == "PROP")
|
||||
{
|
||||
if (llGetListLength(prop_triggers) == 100)
|
||||
{
|
||||
Out(0, "Max props is 100, could not add prop!"); // the real limit is less than this due to memory running out first :)
|
||||
}
|
||||
else
|
||||
{
|
||||
integer prop_type;
|
||||
if (command == "PROP1")
|
||||
{
|
||||
prop_type = 1;
|
||||
}
|
||||
else if (command == "PROP2")
|
||||
{
|
||||
prop_type = 2;
|
||||
}
|
||||
else if (command == "PROP3")
|
||||
{
|
||||
prop_type = 3;
|
||||
}
|
||||
prop_triggers += [(string)notecard_section + "|" + llList2String(parts, 0)];
|
||||
prop_types += prop_type;
|
||||
prop_objects += llList2String(parts, 1);
|
||||
string prop_group = (string)notecard_section + "|" + llList2String(parts, 2);
|
||||
prop_groups += prop_group;
|
||||
if (llListFindList(sequential_prop_groups, [prop_group]) == -1)
|
||||
{
|
||||
sequential_prop_groups += prop_group;
|
||||
}
|
||||
prop_positions += (vector)llList2String(parts, 3);
|
||||
prop_rotations += (vector)llList2String(parts, 4);
|
||||
prop_points += llList2String(parts, 5);
|
||||
}
|
||||
}
|
||||
else if (command == "WARN")
|
||||
{
|
||||
WARN = (integer)llList2String(parts, 0);
|
||||
}
|
||||
notecard_query = llGetNotecardLine(notecard_name, notecard_line += 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,25 +0,0 @@
|
|||
// Shared props with BUTTON (alpha) v0.01a
|
||||
//
|
||||
// Allows props to be rezzed by button. They won't derez when sitters "swap" or
|
||||
// if only one avatar stands up. Requires [AV]prop script from AVsitter2
|
||||
// box 2.1-09.01 or later. Shared props should use PROP3 in the AVpos notecard
|
||||
// (a special prop type specifically for shared props).
|
||||
//
|
||||
// example use:
|
||||
//
|
||||
// BUTTON myprop|555 <--- rez the prop
|
||||
// BUTTON [CLEAR]|555 <--- clear all props
|
||||
// BUTTON remprop_myprop|555 <--- derez the prop
|
||||
// PROP3 myprop|object|0|<0,0,0><0,0,0> <--- define the prop (in any SITTER)
|
||||
|
||||
default
|
||||
{
|
||||
link_message(integer sender, integer num, string msg, key id)
|
||||
{
|
||||
if (num != 555) return
|
||||
|
||||
llMessageLinked(LINK_THIS, 90220, "remprop_" + msg, NULL_KEY); // remove the prop
|
||||
llMessageLinked(LINK_THIS, 90220, msg, NULL_KEY); // rez the prop
|
||||
llMessageLinked(LINK_THIS, 90005, "", id); // give back the menu
|
||||
}
|
||||
}
|
|
@ -1,230 +0,0 @@
|
|||
// Shared prop script (alpha) v0.04a
|
||||
//
|
||||
// - Allows props to be "shared" i.e. props will rez while any one of a number
|
||||
// of POSE/SYNC are playing for any avatar.
|
||||
// - Also replaces the need for the "Rez Same Prop for Several Poses" script.
|
||||
// - Requires [AV]prop script from AVsitter2 box 2.1-09 or later.
|
||||
// - Shared props should use PROP3 in the AVpos notecard (a special prop type
|
||||
// specifically for shared props).
|
||||
// - Shared props can be set up in SITTER 0 section of the AVpos notecard in a
|
||||
// regular setup prim, or in a dedicated rezzer prim.
|
||||
// - Props for a specific sitter can use PROP, PROP1 or PROP2.
|
||||
// - All props referenced by this script should be named different from pose
|
||||
// names (unlike basic props, which do have names that match poses).
|
||||
//
|
||||
// - SITTER_SITTER_PROPS_N_POSES is your list of SITTER#, PROP names, and
|
||||
// POSE/SYNC names the props are for.
|
||||
// e.g: 0, "weights", "stand1,stand2"
|
||||
// - SITTER with -1 indicates the prop is for all sitters (i.e. shared prop,
|
||||
// that should use PROP3 in the AVpos notecard).
|
||||
// e.g: -1,"prop1", "sit1,sit2,sit3"
|
||||
//
|
||||
// - "*" for POSE name indicates the prop should rez for all poses.
|
||||
|
||||
list SITTER_PROPS_N_POSES = [
|
||||
-1, "prop1", "sit1,sit2,sit3",
|
||||
-1, "prop2", "sit4,sync2",
|
||||
-1, "prop3", "sync1,sync2",
|
||||
0, "hat", "*",
|
||||
0, "weights", "weights1,weights2",
|
||||
1, "weights", "weights1,weights2"
|
||||
];
|
||||
|
||||
|
||||
list SITTER_PRIMS; // which prims have AVsitter setups
|
||||
list SITTER_POSES_BY_PRIM; // which poses are playing for each sitter in each prim
|
||||
list SITTERS_BY_PRIM; // which sitters are occupied in each setup prim
|
||||
list REZZED; // which props are rezzed, for which avatars
|
||||
integer ANY_SITTERS; // if avatars are sitting
|
||||
|
||||
rez_derez()
|
||||
{
|
||||
integer i;
|
||||
for (; i < llGetListLength(SITTER_PROPS_N_POSES); i += 3)
|
||||
{
|
||||
integer wasRezzed = llList2Integer(REZZED, i);
|
||||
integer forSitter = llList2Integer(SITTER_PROPS_N_POSES, i);
|
||||
list poses = llParseString2List(llList2String(SITTER_PROPS_N_POSES, i + 2), [","], []);
|
||||
|
||||
integer j;
|
||||
for (; j < llGetListLength(poses); j++)
|
||||
{
|
||||
integer k;
|
||||
for (; k < llGetListLength(SITTER_PRIMS); k++)
|
||||
{
|
||||
list SITTER_POSES_IN_PRIM = llParseStringKeepNulls(llList2String(SITTER_POSES_BY_PRIM, k), ["|"], []);
|
||||
|
||||
integer found = llListFindList(SITTER_POSES_IN_PRIM, [llList2String(poses, j)]);
|
||||
if (~found || llList2String(poses, j) == "*")
|
||||
{
|
||||
list SITTERS_IN_PRIM = llParseStringKeepNulls(llList2String(SITTERS_BY_PRIM, k), ["|"], []);
|
||||
|
||||
integer l = found;
|
||||
for (; l < llGetListLength(SITTERS_IN_PRIM); l++)
|
||||
{
|
||||
if (forSitter == -1 || forSitter == l)
|
||||
{
|
||||
if ((llList2String(SITTER_POSES_IN_PRIM, l) == llList2String(poses, j) || llList2String(poses, j) == "*") && llList2String(SITTERS_IN_PRIM, l) != "")
|
||||
{
|
||||
if (!llList2Integer(REZZED, i))
|
||||
{
|
||||
string uuid;
|
||||
if (forSitter == l)
|
||||
{
|
||||
uuid = llList2String(SITTERS_IN_PRIM,l);
|
||||
}
|
||||
|
||||
// llOwnerSay("===REZ====" + llList2String(SITTER_PROPS_N_POSES, i + 1) + "for uuid:" + uuid);
|
||||
|
||||
// rez our prop
|
||||
llMessageLinked(LINK_THIS, 90220, llList2String(SITTER_PROPS_N_POSES, i + 1), uuid);
|
||||
|
||||
REZZED = llListReplaceList(REZZED, [TRUE, uuid], i, i + 1);
|
||||
}
|
||||
jump done;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (wasRezzed)
|
||||
{
|
||||
string uuid;
|
||||
if (~llList2Integer(SITTER_PROPS_N_POSES, i))
|
||||
{
|
||||
uuid = llList2String(SITTER_PROPS_N_POSES, i);
|
||||
}
|
||||
|
||||
// llOwnerSay("===DEREZ====" + llList2String(SITTER_PROPS_N_POSES, i + 1) + "for uuid:" + uuid);
|
||||
|
||||
// remove our prop
|
||||
llMessageLinked(LINK_THIS, 90220, "remprop_" + llList2String(SITTER_PROPS_N_POSES, i + 1), uuid);
|
||||
|
||||
REZZED = llListReplaceList(REZZED, [FALSE], i, i);
|
||||
}
|
||||
@done;
|
||||
}
|
||||
}
|
||||
|
||||
list fill_array(integer x)
|
||||
{
|
||||
list array;
|
||||
|
||||
integer i;
|
||||
for (; i < x; i++)
|
||||
{
|
||||
array += "";
|
||||
}
|
||||
|
||||
return array;
|
||||
}
|
||||
|
||||
default
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
REZZED = fill_array(llGetListLength(SITTER_PROPS_N_POSES));
|
||||
}
|
||||
|
||||
link_message(integer sender, integer num, string msg, key id)
|
||||
{
|
||||
// if props were cleared with a BUTTON
|
||||
if (msg == "[CLEAR]")
|
||||
{
|
||||
REZZED = fill_array(llGetListLength(SITTER_PROPS_N_POSES));
|
||||
}
|
||||
// pose played
|
||||
else if (num == 90045)
|
||||
{
|
||||
list data = llParseStringKeepNulls(msg, ["|"], []);
|
||||
integer SITTER_NUMBER = (integer)llList2String(data, 0);
|
||||
string POSE_NAME = llList2String(data, 1);
|
||||
list SITTERS_IN_PRIM = llParseStringKeepNulls(llList2String(data, 4), ["@"], []);
|
||||
list LAST_SITTERS_IN_PRIM;
|
||||
list SITTER_POSES_IN_PRIM;
|
||||
|
||||
integer index = llListFindList(SITTER_PRIMS, [sender]);
|
||||
if (~index)
|
||||
{
|
||||
SITTER_POSES_IN_PRIM = llParseStringKeepNulls(llList2String(SITTER_POSES_BY_PRIM, index), ["|"], []);
|
||||
SITTER_PRIMS = llDeleteSubList(SITTER_PRIMS, index, index);
|
||||
SITTER_POSES_BY_PRIM = llDeleteSubList(SITTER_POSES_BY_PRIM, index, index);
|
||||
LAST_SITTERS_IN_PRIM = llParseStringKeepNulls(llList2String(SITTERS_BY_PRIM, index), ["|"], []);
|
||||
SITTERS_BY_PRIM = llDeleteSubList(SITTERS_BY_PRIM, index, index);
|
||||
|
||||
// if the sitters have swapped, consider any props for the changed sitters derezzed
|
||||
integer i;
|
||||
for (; i < llGetListLength(LAST_SITTERS_IN_PRIM); i++)
|
||||
{
|
||||
if (llList2String(SITTERS_IN_PRIM, i) != llList2String(LAST_SITTERS_IN_PRIM, i))
|
||||
{
|
||||
integer j;
|
||||
for (; j < llGetListLength(SITTER_PROPS_N_POSES); j += 3)
|
||||
{
|
||||
if (llList2Integer(SITTER_PROPS_N_POSES, j) == i)
|
||||
{
|
||||
REZZED = llListReplaceList(REZZED, [FALSE, ""], j, j + 1);
|
||||
// llOwnerSay("rezzed:" + llList2CSV(REZZED));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SITTER_POSES_IN_PRIM = fill_array(llGetListLength(SITTERS_IN_PRIM));
|
||||
}
|
||||
|
||||
SITTER_POSES_IN_PRIM = llListReplaceList(SITTER_POSES_IN_PRIM, [POSE_NAME], SITTER_NUMBER, SITTER_NUMBER);
|
||||
SITTER_PRIMS += sender;
|
||||
SITTER_POSES_BY_PRIM += llDumpList2String(SITTER_POSES_IN_PRIM, "|");
|
||||
SITTERS_BY_PRIM += llDumpList2String(SITTERS_IN_PRIM, "|");
|
||||
|
||||
rez_derez();
|
||||
}
|
||||
// sitter stands
|
||||
else if (num == 90065)
|
||||
{
|
||||
integer index = llListFindList(SITTER_PRIMS, [sender]);
|
||||
if (~index)
|
||||
{
|
||||
list SITTER_POSES_IN_PRIM = llParseStringKeepNulls(llList2String(SITTER_POSES_BY_PRIM, index), ["|"], []);
|
||||
SITTER_POSES_IN_PRIM = llListReplaceList(SITTER_POSES_IN_PRIM, [""], (integer)msg, (integer)msg);
|
||||
SITTER_POSES_BY_PRIM = llListReplaceList(SITTER_POSES_BY_PRIM, [llDumpList2String(SITTER_POSES_IN_PRIM, "|")], index, index);
|
||||
list SITTERS_IN_PRIM = llParseStringKeepNulls(llList2String(SITTERS_BY_PRIM, index), ["|"], []);
|
||||
SITTERS_IN_PRIM = llListReplaceList(SITTERS_IN_PRIM, [""], (integer)msg, (integer)msg);
|
||||
SITTERS_BY_PRIM = llListReplaceList(SITTERS_BY_PRIM, [llDumpList2String(SITTERS_IN_PRIM, "|")], index, index);
|
||||
|
||||
rez_derez();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
changed(integer change)
|
||||
{
|
||||
if (change & CHANGED_LINK)
|
||||
{
|
||||
integer IS_SITTER;
|
||||
|
||||
// someone is sitting
|
||||
if (llGetAgentSize(llGetLinkKey(llGetNumberOfPrims())))
|
||||
{
|
||||
IS_SITTER = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
SITTER_PRIMS = [];
|
||||
SITTER_POSES_BY_PRIM = [];
|
||||
SITTERS_BY_PRIM = [];
|
||||
}
|
||||
|
||||
if (IS_SITTER != ANY_SITTERS)
|
||||
{
|
||||
ANY_SITTERS = IS_SITTER;
|
||||
|
||||
rez_derez();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
427
AVsitter2/Plugins/AVsequence/[AV]sequence.lsl
Normal file
427
AVsitter2/Plugins/AVsequence/[AV]sequence.lsl
Normal file
|
@ -0,0 +1,427 @@
|
|||
/*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* Copyright (c) the AVsitter Contributors (http://avsitter.github.io)
|
||||
* AVsitter™ is a trademark. For trademark use policy see:
|
||||
* https://avsitter.github.io/TRADEMARK.mediawiki
|
||||
*
|
||||
* Please consider supporting continued development of AVsitter and
|
||||
* receive automatic updates and other benefits! All details and user
|
||||
* instructions can be found at http://avsitter.github.io
|
||||
*/
|
||||
|
||||
string product = "AVsitter™ sequence";
|
||||
string version = "2.2";
|
||||
string main_script = "[AV]sitA";
|
||||
list SITTERS;
|
||||
integer DEBUG;
|
||||
string notecard_name = "[AV]sequence_settings";
|
||||
integer notecard_line;
|
||||
key notecard_query;
|
||||
key notecard_key;
|
||||
list SEQUENCE_DATA_NAMES;
|
||||
list SEQUENCE_DATA_ACTIONS;
|
||||
list SEQUENCE_DATA_DATAS;
|
||||
string CURRENT_SEQUENCE_NAME;
|
||||
list CURRENT_SEQUENCE_ACTIONS;
|
||||
list CURRENT_SEQUENCE_DATAS;
|
||||
integer SEQUENCE_LINKNUMBER = 90210;
|
||||
integer SEQUENCE_POINTER = -1;
|
||||
integer sequence_running;
|
||||
key CONTROLLER;
|
||||
key CONTROLLED;
|
||||
integer menu_channel;
|
||||
integer menu_handle;
|
||||
integer playsounds = TRUE;
|
||||
integer no_waits_yet;
|
||||
integer verbose = 1;
|
||||
Out(integer level, string out)
|
||||
{
|
||||
if (verbose >= level)
|
||||
{
|
||||
llOwnerSay(llGetScriptName() + "[" + version + "] " + out);
|
||||
}
|
||||
}
|
||||
string strReplace(string str, string search, string replace)
|
||||
{
|
||||
return llDumpList2String(llParseStringKeepNulls(str, [search], []), replace);
|
||||
}
|
||||
DEBUGSay(integer level, string out)
|
||||
{
|
||||
if (DEBUG >= level)
|
||||
{
|
||||
llWhisper(0, out);
|
||||
}
|
||||
}
|
||||
run_sequence()
|
||||
{
|
||||
while (SEQUENCE_POINTER >= 0)
|
||||
{
|
||||
string command = llList2String(CURRENT_SEQUENCE_ACTIONS, SEQUENCE_POINTER);
|
||||
string data = llList2String(CURRENT_SEQUENCE_DATAS, SEQUENCE_POINTER);
|
||||
list data_list = llParseStringKeepNulls(data, ["|"], []);
|
||||
if (command == "PLAY")
|
||||
{
|
||||
DEBUGSay(2, "Playing pose " + data);
|
||||
llMessageLinked(LINK_THIS, 90003, data, "");
|
||||
llSleep(0.5);
|
||||
}
|
||||
else if (command == "SAY")
|
||||
{
|
||||
llSay(0, parse_text(data));
|
||||
}
|
||||
else if (command == "WHISPER")
|
||||
{
|
||||
llWhisper(0, parse_text(data));
|
||||
}
|
||||
else if (command == "SOUND")
|
||||
{
|
||||
if (playsounds)
|
||||
{
|
||||
string sound = llList2String(data_list, 0);
|
||||
float volume = (float)llList2String(data_list, 1);
|
||||
llPlaySound(sound, volume);
|
||||
DEBUGSay(2, "Playing sound " + sound + " at volume " + (string)volume);
|
||||
}
|
||||
}
|
||||
else if (command == "LOOP")
|
||||
{
|
||||
no_waits_yet = FALSE;
|
||||
if (SEQUENCE_POINTER == llGetListLength(CURRENT_SEQUENCE_ACTIONS) - 1)
|
||||
{
|
||||
SEQUENCE_POINTER = -1;
|
||||
DEBUGSay(2, "Looping back to start of sequence");
|
||||
if (sequence_running)
|
||||
{
|
||||
llSetTimerEvent(0.1);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (command == "WAIT")
|
||||
{
|
||||
if (sequence_running)
|
||||
{
|
||||
float time = (float)data;
|
||||
DEBUGSay(2, "Waiting for " + (string)time + " seconds");
|
||||
llSetTimerEvent(time);
|
||||
if (time >= 2)
|
||||
{
|
||||
integer found;
|
||||
integer next_POINTER = SEQUENCE_POINTER;
|
||||
while (next_POINTER++ < llGetListLength(CURRENT_SEQUENCE_ACTIONS) && found == FALSE)
|
||||
{
|
||||
string next_command = llList2String(CURRENT_SEQUENCE_ACTIONS, SEQUENCE_POINTER + 1);
|
||||
if (next_command == "WAIT" || next_command == "SOUND")
|
||||
{
|
||||
found = TRUE;
|
||||
if (next_command == "SOUND")
|
||||
{
|
||||
list next_data_list = llParseStringKeepNulls(llList2String(CURRENT_SEQUENCE_DATAS, next_POINTER), ["|"], []);
|
||||
string sound = llList2String(next_data_list, 0);
|
||||
DEBUGSay(2, "Preloading sound " + sound);
|
||||
llPreloadSound(sound);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
no_waits_yet = FALSE;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (++SEQUENCE_POINTER >= llGetListLength(CURRENT_SEQUENCE_ACTIONS))
|
||||
{
|
||||
integer index = llListFindList(CURRENT_SEQUENCE_ACTIONS, ["LOOP"]);
|
||||
if (index != -1)
|
||||
{
|
||||
SEQUENCE_POINTER = index;
|
||||
DEBUGSay(2, "Looping back to line " + (string)SEQUENCE_POINTER + " of sequence");
|
||||
if (sequence_running)
|
||||
{
|
||||
llSetTimerEvent(0.1);
|
||||
}
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
stop_sequence(FALSE);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
integer get_number_of_scripts()
|
||||
{
|
||||
integer i;
|
||||
while (llGetInventoryType(main_script + " " + (string)(++i)) == INVENTORY_SCRIPT)
|
||||
;
|
||||
return i;
|
||||
}
|
||||
string parse_text(string say)
|
||||
{
|
||||
integer i;
|
||||
for (i = 0; i < llGetListLength(SITTERS); i++)
|
||||
{
|
||||
string sitter_name = llList2String(llParseString2List(llKey2Name(llList2String(SITTERS, i)), [" "], []), 0);
|
||||
if (sitter_name == "")
|
||||
{
|
||||
sitter_name = "nobody";
|
||||
}
|
||||
say = strReplace(say, "/" + (string)i, sitter_name);
|
||||
}
|
||||
return say;
|
||||
}
|
||||
start_sequence(integer index)
|
||||
{
|
||||
no_waits_yet = (sequence_running = TRUE);
|
||||
SEQUENCE_POINTER = 0;
|
||||
CURRENT_SEQUENCE_NAME = llList2String(SEQUENCE_DATA_NAMES, index);
|
||||
CURRENT_SEQUENCE_ACTIONS = llParseStringKeepNulls(llList2String(SEQUENCE_DATA_ACTIONS, index), ["◆"], []);
|
||||
CURRENT_SEQUENCE_DATAS = llParseStringKeepNulls(llList2String(SEQUENCE_DATA_DATAS, index), ["◆"], []);
|
||||
DEBUGSay(1, "Sequence '" + CURRENT_SEQUENCE_NAME + "' Started!");
|
||||
}
|
||||
stop_sequence(integer stopSound)
|
||||
{
|
||||
if (sequence_running)
|
||||
{
|
||||
DEBUGSay(1, "Sequence '" + CURRENT_SEQUENCE_NAME + "' Ended!");
|
||||
}
|
||||
sequence_running = FALSE;
|
||||
SEQUENCE_POINTER = -1;
|
||||
llSetTimerEvent(0);
|
||||
if (stopSound && (~llListFindList(CURRENT_SEQUENCE_ACTIONS, ["SOUND"])))
|
||||
{
|
||||
llStopSound();
|
||||
}
|
||||
}
|
||||
sequence_control()
|
||||
{
|
||||
llListenRemove(menu_handle);
|
||||
menu_channel = ((integer)llFrand(2147483646) + 1) * -1;
|
||||
string pauseplay = "▶";
|
||||
if (sequence_running)
|
||||
{
|
||||
pauseplay = "▮▮";
|
||||
}
|
||||
list menu_items = ["◀◀", pauseplay, "▶▶"];
|
||||
menu_handle = llListen(menu_channel, "", CONTROLLER, "");
|
||||
llDialog(CONTROLLER, product + " " + version + "\n\n[" + CURRENT_SEQUENCE_NAME + "]\n◀◀ = previous anim in sequence.\n▮▮ = pause sequence.\n▶▶ = skip to next anim in sequence.", order_buttons(["[BACK]"] + menu_items), menu_channel);
|
||||
}
|
||||
list order_buttons(list buttons)
|
||||
{
|
||||
return llList2List(buttons, -3, -1) + llList2List(buttons, -6, -4) + llList2List(buttons, -9, -7) + llList2List(buttons, -12, -10);
|
||||
}
|
||||
commit_sequence_data()
|
||||
{
|
||||
SEQUENCE_DATA_NAMES += CURRENT_SEQUENCE_NAME;
|
||||
SEQUENCE_DATA_ACTIONS += llDumpList2String(CURRENT_SEQUENCE_ACTIONS, "◆");
|
||||
SEQUENCE_DATA_DATAS += llDumpList2String(CURRENT_SEQUENCE_DATAS, "◆");
|
||||
}
|
||||
default
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
notecard_key = llGetInventoryKey(notecard_name);
|
||||
if (llGetInventoryType(notecard_name) == INVENTORY_NOTECARD)
|
||||
{
|
||||
Out(0, "Loading...");
|
||||
notecard_query = llGetNotecardLine(notecard_name, notecard_line);
|
||||
}
|
||||
}
|
||||
changed(integer change)
|
||||
{
|
||||
if (change & CHANGED_INVENTORY)
|
||||
{
|
||||
if (llGetInventoryKey(notecard_name) != notecard_key)
|
||||
{
|
||||
llResetScript();
|
||||
}
|
||||
}
|
||||
}
|
||||
dataserver(key query_id, string data)
|
||||
{
|
||||
if (query_id == notecard_query)
|
||||
{
|
||||
if (data == EOF)
|
||||
{
|
||||
commit_sequence_data();
|
||||
state running;
|
||||
}
|
||||
else
|
||||
{
|
||||
list datalist = llParseString2List(data, [" "], []);
|
||||
string command = llList2String(datalist, 0);
|
||||
data = llStringTrim(llDumpList2String(llList2List(datalist, 1, -1), " "), STRING_TRIM);
|
||||
list commands = ["PLAY", "WAIT", "SAY", "WHISPER", "SOUND", "LOOP"];
|
||||
if (command == "DEBUG")
|
||||
{
|
||||
DEBUG = (integer)data;
|
||||
}
|
||||
else if (command == "SEQUENCE")
|
||||
{
|
||||
if (CURRENT_SEQUENCE_NAME)
|
||||
{
|
||||
commit_sequence_data();
|
||||
}
|
||||
CURRENT_SEQUENCE_NAME = data;
|
||||
CURRENT_SEQUENCE_ACTIONS = [];
|
||||
CURRENT_SEQUENCE_DATAS = [];
|
||||
}
|
||||
else if (llListFindList(commands, [command]) != -1)
|
||||
{
|
||||
CURRENT_SEQUENCE_ACTIONS += command;
|
||||
CURRENT_SEQUENCE_DATAS += data;
|
||||
}
|
||||
notecard_query = llGetNotecardLine(notecard_name, ++notecard_line);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
state running
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
Out(0, (string)llGetListLength(SEQUENCE_DATA_NAMES) + " Sequences Ready, Mem=" + (string)(65536 - llGetUsedMemory()));
|
||||
integer i;
|
||||
for (i = 0; i < get_number_of_scripts(); i++)
|
||||
{
|
||||
SITTERS += NULL_KEY;
|
||||
}
|
||||
}
|
||||
link_message(integer sender, integer num, string msg, key id)
|
||||
{
|
||||
if (sender == llGetLinkNumber())
|
||||
{
|
||||
if (num == 90065)
|
||||
{
|
||||
integer index = llListFindList(SITTERS, [id]);
|
||||
if (index != -1)
|
||||
{
|
||||
SITTERS = llListReplaceList(SITTERS, [NULL_KEY], index, index);
|
||||
}
|
||||
stop_sequence(TRUE);
|
||||
}
|
||||
else if (num == 90030)
|
||||
{
|
||||
SITTERS = llListReplaceList(SITTERS, [NULL_KEY], (integer)msg, (integer)msg);
|
||||
SITTERS = llListReplaceList(SITTERS, [NULL_KEY], (integer)((string)id), (integer)((string)id));
|
||||
stop_sequence(TRUE);
|
||||
}
|
||||
else if (num == 90070)
|
||||
{
|
||||
SITTERS = llListReplaceList(SITTERS, [id], (integer)msg, (integer)msg);
|
||||
}
|
||||
else if (num == 90000)
|
||||
{
|
||||
stop_sequence(TRUE);
|
||||
integer index = llListFindList(SEQUENCE_DATA_NAMES, [msg]);
|
||||
if (index != -1)
|
||||
{
|
||||
start_sequence(index);
|
||||
run_sequence();
|
||||
}
|
||||
}
|
||||
else if (num == 90205)
|
||||
{
|
||||
llMessageLinked(LINK_SET, 90005, "", id);
|
||||
playsounds = (!playsounds);
|
||||
if (playsounds)
|
||||
{
|
||||
llSay(0, "Sounds ON");
|
||||
}
|
||||
else
|
||||
{
|
||||
llSay(0, "Sounds OFF");
|
||||
llStopSound();
|
||||
}
|
||||
}
|
||||
else if (num == SEQUENCE_LINKNUMBER)
|
||||
{
|
||||
stop_sequence(TRUE);
|
||||
list data = llParseStringKeepNulls(id, ["|"], []);
|
||||
CONTROLLER = (key)llList2String(data, 0);
|
||||
CONTROLLED = (key)llList2String(data, -1);
|
||||
integer index = llListFindList(SEQUENCE_DATA_NAMES, [msg]);
|
||||
if (index != -1)
|
||||
{
|
||||
start_sequence(index);
|
||||
if ((~llListFindList(CURRENT_SEQUENCE_ACTIONS, ["WAIT"])) && (~llListFindList(CURRENT_SEQUENCE_ACTIONS, ["PLAY"])))
|
||||
{
|
||||
sequence_control();
|
||||
}
|
||||
else
|
||||
{
|
||||
llMessageLinked(LINK_SET, 90005, "", id);
|
||||
}
|
||||
run_sequence();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
listen(integer listen_channel, string name, key id, string msg)
|
||||
{
|
||||
if (msg == "▮▮")
|
||||
{
|
||||
sequence_running = FALSE;
|
||||
llSetTimerEvent(0);
|
||||
DEBUGSay(1, "Sequence '" + CURRENT_SEQUENCE_NAME + "' Paused!");
|
||||
}
|
||||
else if (msg == "▶")
|
||||
{
|
||||
sequence_running = TRUE;
|
||||
SEQUENCE_POINTER++;
|
||||
DEBUGSay(1, "Sequence '" + CURRENT_SEQUENCE_NAME + "' Resumed!");
|
||||
run_sequence();
|
||||
}
|
||||
else if (msg == "▶▶")
|
||||
{
|
||||
SEQUENCE_POINTER++;
|
||||
run_sequence();
|
||||
}
|
||||
else if (msg == "◀◀")
|
||||
{
|
||||
integer count_waits;
|
||||
while (SEQUENCE_POINTER > -1 && count_waits < 2)
|
||||
{
|
||||
SEQUENCE_POINTER--;
|
||||
if (llList2String(CURRENT_SEQUENCE_ACTIONS, SEQUENCE_POINTER) == "WAIT")
|
||||
{
|
||||
count_waits++;
|
||||
}
|
||||
}
|
||||
SEQUENCE_POINTER++;
|
||||
run_sequence();
|
||||
}
|
||||
else if (msg == "[BACK]")
|
||||
{
|
||||
llMessageLinked(LINK_SET, 90005, "", (string)id + "|" + (string)CONTROLLED);
|
||||
return;
|
||||
}
|
||||
sequence_control();
|
||||
}
|
||||
timer()
|
||||
{
|
||||
llSetTimerEvent(0);
|
||||
SEQUENCE_POINTER++;
|
||||
run_sequence();
|
||||
}
|
||||
on_rez(integer start)
|
||||
{
|
||||
playsounds = TRUE;
|
||||
}
|
||||
changed(integer change)
|
||||
{
|
||||
if (change & CHANGED_LINK)
|
||||
{
|
||||
}
|
||||
if (change & CHANGED_INVENTORY)
|
||||
{
|
||||
if (llGetInventoryKey(notecard_name) != notecard_key || get_number_of_scripts() != llGetListLength(SITTERS))
|
||||
{
|
||||
llResetScript();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
49
AVsitter2/Utilities/AVpos-generator.lsl
Normal file
49
AVsitter2/Utilities/AVpos-generator.lsl
Normal file
|
@ -0,0 +1,49 @@
|
|||
/*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* Copyright (c) the AVsitter Contributors (http://avsitter.github.io)
|
||||
* AVsitter™ is a trademark. For trademark use policy see:
|
||||
* https://avsitter.github.io/TRADEMARK.mediawiki
|
||||
*
|
||||
* Please consider supporting continued development of AVsitter and
|
||||
* receive automatic updates and other benefits! All details and user
|
||||
* instructions can be found at http://avsitter.github.io
|
||||
*/
|
||||
|
||||
string notecard_basename = "AVpos";
|
||||
string name = "Anim";
|
||||
Readout_Say(string say)
|
||||
{
|
||||
llSleep(0.2);
|
||||
string objectname = llGetObjectName();
|
||||
llSetObjectName("");
|
||||
llRegionSayTo(llGetOwner(), 0, "◆" + say);
|
||||
llSetObjectName(objectname);
|
||||
}
|
||||
default
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
if (llGetInventoryNumber(INVENTORY_ANIMATION) > 0)
|
||||
{
|
||||
Readout_Say("");
|
||||
Readout_Say("--✄--COPY BELOW INTO " + notecard_basename + " NOTECARD--✄--");
|
||||
Readout_Say("");
|
||||
integer i;
|
||||
for (i = 0; i < llGetInventoryNumber(INVENTORY_ANIMATION); i++)
|
||||
{
|
||||
Readout_Say("POSE " + name + (string)(i + 1) + "|" + llGetInventoryName(INVENTORY_ANIMATION, i));
|
||||
}
|
||||
Readout_Say("");
|
||||
Readout_Say("--✄--COPY ABOVE INTO " + notecard_basename + " NOTECARD--✄--");
|
||||
Readout_Say("");
|
||||
if (llSubStringIndex(llGetObjectName(), "Utilities") == -1) // remove it except from Utilities box
|
||||
{
|
||||
llOwnerSay("Removing " + llGetScriptName() + " script");
|
||||
llRemoveInventory(llGetScriptName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
209
AVsitter2/Utilities/AVpos-shifter.lsl
Normal file
209
AVsitter2/Utilities/AVpos-shifter.lsl
Normal file
|
@ -0,0 +1,209 @@
|
|||
/*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* Copyright (c) the AVsitter Contributors (http://avsitter.github.io)
|
||||
* AVsitter™ is a trademark. For trademark use policy see:
|
||||
* https://avsitter.github.io/TRADEMARK.mediawiki
|
||||
*
|
||||
* Please consider supporting continued development of AVsitter and
|
||||
* receive automatic updates and other benefits! All details and user
|
||||
* instructions can be found at http://avsitter.github.io
|
||||
*/
|
||||
|
||||
float version = 1.2;
|
||||
string notecard_name = "AVpos";
|
||||
key notecard_query;
|
||||
integer notecard_line;
|
||||
vector target_prim_pos;
|
||||
rotation target_prim_rot;
|
||||
vector rot_offset;
|
||||
vector pos_offset;
|
||||
string cache;
|
||||
string webkey;
|
||||
integer webcount;
|
||||
integer IsVector(string s)
|
||||
{
|
||||
list split = llParseString2List(s, [" "], ["<", ">", ","]);
|
||||
if (llGetListLength(split) != 7)
|
||||
return FALSE;
|
||||
return !((string)((vector)s) == (string)((vector)((string)llListInsertList(split, ["-"], 5))));
|
||||
}
|
||||
string FormatFloat(float f, integer num_decimals)
|
||||
{
|
||||
float rounding = (float)(".5e-" + (string)num_decimals) - 5e-07;
|
||||
if (f < 0.)
|
||||
f -= rounding;
|
||||
else
|
||||
f += rounding;
|
||||
string ret = llGetSubString((string)f, 0, num_decimals - (!num_decimals) - 7);
|
||||
if (llSubStringIndex(ret, ".") != -1)
|
||||
{
|
||||
while (llGetSubString(ret, -1, -1) == "0")
|
||||
{
|
||||
ret = llGetSubString(ret, 0, -2);
|
||||
}
|
||||
}
|
||||
if (llGetSubString(ret, -1, -1) == ".")
|
||||
{
|
||||
ret = llGetSubString(ret, 0, -2);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
instructions()
|
||||
{
|
||||
llOwnerSay("\n\nINSTRUCTIONS:\n\nFOR MOVING ALL POSE & PROP POSITIONS BY AN OFFSET:\nManual Position: specify a position offset on channel 5, and positions will be converted by that offset. E.g. /5 <0,0,1.5>\nManual Rotation: specify a rotation offset on channel 6 (in degrees), and rotations will be converted by that offset, relative to the prim center. E.g. /6 <0,0,180>\n\nFOR RELOCATING SCRIPTS TO NEW PRIM:\n1. Unlink your object and re-link so that the prim you want to move the animations from is the root prim, then place this script inside the root prim.\n2. Touch the prim you want to locate the poses to. This prim should be empty or contain a script with llPassTouches(TRUE);\n3. The script will read out the notecard in chat, with pos/rot modified to the prim you touched.\n\nHave Fun! :)\n");
|
||||
}
|
||||
cut_above_text()
|
||||
{
|
||||
webkey = (string)llGenerateKey();
|
||||
webcount = 0;
|
||||
Readout_Say("");
|
||||
Readout_Say("--✄--COPY BELOW INTO \"AVpos\" NOTECARD--✄--");
|
||||
Readout_Say("");
|
||||
}
|
||||
cut_below_text()
|
||||
{
|
||||
Readout_Say("");
|
||||
Readout_Say("--✄--COPY ABOVE INTO \"AVpos\" NOTECARD--✄--");
|
||||
Readout_Say("");
|
||||
}
|
||||
Readout_Say(string say)
|
||||
{
|
||||
llSleep(0.1);
|
||||
string objectname = llGetObjectName();
|
||||
llSetObjectName("");
|
||||
llRegionSayTo(llGetOwner(), 0, "◆" + say);
|
||||
llSetObjectName(objectname);
|
||||
}
|
||||
integer check_in_root()
|
||||
{
|
||||
if (llGetLinkNumber() > 1 || llGetInventoryType("AVpos") != INVENTORY_NOTECARD)
|
||||
{
|
||||
if (llGetInventoryCreator(llGetScriptName()) != llGetOwner())
|
||||
{
|
||||
llOwnerSay("This script must be placed only in the root prim and with AVpos notecard! - Removing script!");
|
||||
llRemoveInventory(llGetScriptName());
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
default
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
check_in_root();
|
||||
instructions();
|
||||
llListen(5, "", llGetOwner(), "");
|
||||
llListen(6, "", llGetOwner(), "");
|
||||
}
|
||||
touch_start(integer touched)
|
||||
{
|
||||
check_in_root();
|
||||
if (llDetectedLinkNumber(0) > 1)
|
||||
{
|
||||
notecard_line = 0;
|
||||
target_prim_pos = llList2Vector(llGetLinkPrimitiveParams(llDetectedLinkNumber(0), [PRIM_POS_LOCAL]), 0);
|
||||
target_prim_rot = llList2Rot(llGetLinkPrimitiveParams(llDetectedLinkNumber(0), [PRIM_ROT_LOCAL]), 0);
|
||||
llOwnerSay("Converting " + notecard_name + " for use in prim #" + (string)llDetectedLinkNumber(0));
|
||||
cut_above_text();
|
||||
notecard_query = llGetNotecardLine(notecard_name, notecard_line);
|
||||
}
|
||||
}
|
||||
listen(integer chan, string name, key id, string msg)
|
||||
{
|
||||
if (chan == 5)
|
||||
{
|
||||
vector v = (vector)msg;
|
||||
if (v != ZERO_VECTOR)
|
||||
{
|
||||
llOwnerSay("Converting positions in " + notecard_name + " by offset: " + (string)v);
|
||||
cut_above_text();
|
||||
target_prim_pos = -v;
|
||||
notecard_query = llGetNotecardLine(notecard_name, notecard_line);
|
||||
}
|
||||
else
|
||||
{
|
||||
llOwnerSay("You didn't enter a vector!");
|
||||
}
|
||||
}
|
||||
if (chan == 6)
|
||||
{
|
||||
vector v = (vector)msg;
|
||||
if (v != ZERO_VECTOR)
|
||||
{
|
||||
target_prim_rot = llEuler2Rot(v * DEG_TO_RAD);
|
||||
llOwnerSay("Converting rotations in " + notecard_name + " by offset: " + (string)v);
|
||||
cut_above_text();
|
||||
notecard_query = llGetNotecardLine(notecard_name, notecard_line);
|
||||
}
|
||||
else
|
||||
{
|
||||
llOwnerSay("You didn't enter a vector!");
|
||||
}
|
||||
}
|
||||
}
|
||||
dataserver(key query_id, string data)
|
||||
{
|
||||
if (query_id == notecard_query)
|
||||
{
|
||||
if (data == EOF)
|
||||
{
|
||||
cut_below_text();
|
||||
llOwnerSay("Conversion complete, removing script.");
|
||||
llRemoveInventory(llGetScriptName());
|
||||
}
|
||||
else
|
||||
{
|
||||
data = llStringTrim(llGetSubString(data, llSubStringIndex(data, "◆") + 1, -1), STRING_TRIM);
|
||||
if (llGetSubString(data, 0, 0) == "{")
|
||||
{
|
||||
string command = llStringTrim(llGetSubString(data, 1, llSubStringIndex(data, "}") - 1), STRING_TRIM);
|
||||
data = llDumpList2String(llParseString2List(data, [" "], [""]), "");
|
||||
data = llGetSubString(data, llSubStringIndex(data, "}") + 1, -1);
|
||||
list parts = llParseStringKeepNulls(data, ["<"], []);
|
||||
vector pos = (vector)("<" + llList2String(parts, 1));
|
||||
pos = -target_prim_pos / target_prim_rot + pos / target_prim_rot;
|
||||
rotation rot = llEuler2Rot((vector)("<" + llList2String(parts, 2)) * DEG_TO_RAD);
|
||||
vector vec_rot = llRot2Euler(rot / target_prim_rot) * RAD_TO_DEG;
|
||||
string result = "<" + FormatFloat(pos.x, 3) + "," + FormatFloat(pos.y, 3) + "," + FormatFloat(pos.z, 3) + ">";
|
||||
result += "<" + FormatFloat(vec_rot.x, 1) + "," + FormatFloat(vec_rot.y, 1) + "," + FormatFloat(vec_rot.z, 1) + ">";
|
||||
Readout_Say("{" + command + "}" + result);
|
||||
}
|
||||
else if (llSubStringIndex(llGetSubString(data, 0, 0), "PROP"))
|
||||
{
|
||||
integer index;
|
||||
vector pos;
|
||||
rotation rot;
|
||||
list parts = llParseStringKeepNulls(data, ["|"], [""]);
|
||||
if (IsVector(llList2String(parts, 2)) && IsVector(llList2String(parts, 3)))
|
||||
{
|
||||
index = 2;
|
||||
}
|
||||
else if (IsVector(llList2String(parts, 3)) && IsVector(llList2String(parts, 4)))
|
||||
{
|
||||
index = 3;
|
||||
}
|
||||
if (index)
|
||||
{
|
||||
pos = (vector)llList2String(parts, index);
|
||||
rot = llEuler2Rot((vector)llList2String(parts, index + 1) * DEG_TO_RAD);
|
||||
pos = -target_prim_pos / target_prim_rot + pos / target_prim_rot;
|
||||
vector vec_rot = llRot2Euler(rot / target_prim_rot) * RAD_TO_DEG;
|
||||
string pos_string = "<" + FormatFloat(pos.x, 3) + "," + FormatFloat(pos.y, 3) + "," + FormatFloat(pos.z, 3) + ">";
|
||||
string rot_string = "<" + FormatFloat(vec_rot.x, 1) + "," + FormatFloat(vec_rot.y, 1) + "," + FormatFloat(vec_rot.z, 1) + ">";
|
||||
parts = llListReplaceList(parts, [pos_string, rot_string], index, index + 1);
|
||||
}
|
||||
Readout_Say(llDumpList2String(parts, "|"));
|
||||
}
|
||||
else if (data != "")
|
||||
{
|
||||
Readout_Say(data);
|
||||
}
|
||||
notecard_query = llGetNotecardLine(notecard_name, notecard_line += 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
64
AVsitter2/Utilities/Anim-perm-checker.lsl
Normal file
64
AVsitter2/Utilities/Anim-perm-checker.lsl
Normal file
|
@ -0,0 +1,64 @@
|
|||
/*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* Copyright (c) the AVsitter Contributors (http://avsitter.github.io)
|
||||
* AVsitter™ is a trademark. For trademark use policy see:
|
||||
* https://avsitter.github.io/TRADEMARK.mediawiki
|
||||
*
|
||||
* Please consider supporting continued development of AVsitter and
|
||||
* receive automatic updates and other benefits! All details and user
|
||||
* instructions can be found at http://avsitter.github.io
|
||||
*/
|
||||
|
||||
Owner_Say(string say)
|
||||
{
|
||||
llOwnerSay(llGetScriptName() + ": " + say);
|
||||
}
|
||||
default
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
integer copy_trans_count;
|
||||
integer copy_count;
|
||||
integer trans_count;
|
||||
Owner_Say(" ");
|
||||
Owner_Say("================================");
|
||||
integer total = llGetInventoryNumber(INVENTORY_ANIMATION);
|
||||
Owner_Say("Checking NEXT_OWNER permissions of ANIMATIONS.");
|
||||
integer i;
|
||||
for (i = 0; i < total; i++)
|
||||
{
|
||||
string item = llGetInventoryName(INVENTORY_ANIMATION, i);
|
||||
integer perms = llGetInventoryPermMask(item, MASK_NEXT);
|
||||
if (perms & PERM_COPY)
|
||||
{
|
||||
if (perms & PERM_TRANSFER)
|
||||
{
|
||||
Owner_Say(item + " is COPY-TRANSFER!");
|
||||
copy_trans_count++;
|
||||
}
|
||||
else
|
||||
{
|
||||
copy_count++;
|
||||
}
|
||||
}
|
||||
else if (perms & PERM_TRANSFER)
|
||||
{
|
||||
trans_count++;
|
||||
}
|
||||
}
|
||||
Owner_Say((string)total + " anims total");
|
||||
Owner_Say((string)trans_count + " anims are TRANSFER");
|
||||
Owner_Say((string)copy_count + " anims are COPY.");
|
||||
Owner_Say((string)copy_trans_count + " anims are COPY-TRANSFER!");
|
||||
Owner_Say("Check complete, removing script.");
|
||||
Owner_Say("================================");
|
||||
Owner_Say(" ");
|
||||
if (llSubStringIndex(llGetObjectName(), "Utilities") == -1) // remove it except from Utilities box
|
||||
{
|
||||
llRemoveInventory(llGetScriptName());
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,183 +1,194 @@
|
|||
// MLP to AVsitter converter
|
||||
// Converts POSE and SYNC only! (facial expressions, props, submenus are not implemented yet)
|
||||
// You can enter a position offset vector in the description such as <0,0,0.1>
|
||||
|
||||
string product = "AVsitter2 MLP converter";
|
||||
string version = "2.1";
|
||||
|
||||
string notecard_basename = "AVpos";
|
||||
|
||||
list NOTECARDS;
|
||||
list PROPS_NOTECARDS;
|
||||
|
||||
string notecard_name;
|
||||
key notecard_query;
|
||||
integer notecard_line;
|
||||
integer notecard_pointer;
|
||||
integer animator_count;
|
||||
integer animator_total;
|
||||
|
||||
list ommit = ["default","stand"];
|
||||
|
||||
integer verbose = 0;
|
||||
Out(integer level,string out){
|
||||
if(verbose>=level){
|
||||
llOwnerSay(llGetScriptName()+"["+version+"] "+out);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
"Fixed number of decimals version" from
|
||||
http://wiki.secondlife.com/wiki/User:Pedro_Oval/Float_formatting_functions
|
||||
*/
|
||||
string FormatFloat(float f, integer num_decimals){
|
||||
float rounding = (float)(".5e-" + (string)num_decimals) - 0.0000005;
|
||||
if (f < 0.) f -= rounding; else f += rounding;
|
||||
string ret = llGetSubString((string)f, 0, num_decimals - !num_decimals - 7);
|
||||
|
||||
//if ((float)ret == 0.) ret = "0";
|
||||
|
||||
if(llSubStringIndex(ret,".")!=-1){
|
||||
while(llGetSubString(ret,-1,-1)=="0"){
|
||||
ret = llGetSubString(ret,0,-2);
|
||||
}
|
||||
}
|
||||
if(llGetSubString(ret,-1,-1)=="."){
|
||||
ret = llGetSubString(ret,0,-2);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
finish(){
|
||||
if(llSubStringIndex(llGetObjectName(),"Utilities")==-1){
|
||||
Out(0,"Removing script");
|
||||
llRemoveInventory(llGetScriptName());
|
||||
}
|
||||
}
|
||||
|
||||
get_notecards(){
|
||||
integer i;
|
||||
for(i=0;i<llGetInventoryNumber(INVENTORY_NOTECARD);i++){
|
||||
string name = llGetInventoryName(INVENTORY_NOTECARD,i);
|
||||
if(llGetSubString(name,0,9)==".MENUITEMS" || llGetSubString(name,0,9)==".POSITIONS"){ //must be in alphabetical order (MENUITEMS FIRST)
|
||||
NOTECARDS+=name;
|
||||
}
|
||||
else if(llGetSubString(name,0,5)==".PROPS"){
|
||||
PROPS_NOTECARDS+=name; // not implemented
|
||||
}
|
||||
}
|
||||
//llOwnerSay(llDumpList2String(NOTECARDS,","));
|
||||
}
|
||||
|
||||
|
||||
Readout_Say(string say){
|
||||
string objectname = llGetObjectName();
|
||||
llSetObjectName("");
|
||||
llRegionSayTo(llGetOwner(),0,"◆"+say);
|
||||
llSetObjectName(objectname);
|
||||
}
|
||||
|
||||
default{
|
||||
state_entry(){
|
||||
Out(0,"Reading MLP notecards...");
|
||||
Readout_Say(" ");
|
||||
get_notecards();
|
||||
//state part_two;
|
||||
if(llGetListLength(NOTECARDS)>0){
|
||||
notecard_name = llList2String(NOTECARDS,notecard_pointer);
|
||||
Readout_Say("--✄--COPY BELOW INTO "+notecard_basename+" NOTECARD--✄--");
|
||||
Readout_Say(" ");
|
||||
//llOwnerSay("N: "+notecard_name);
|
||||
|
||||
Readout_Say("SITTER "+(string)animator_count);
|
||||
notecard_query = llGetNotecardLine(notecard_name,notecard_line);
|
||||
}
|
||||
else{
|
||||
Out(0,"No MLP notecards found!");
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
||||
dataserver(key query_id, string data){
|
||||
//llOwnerSay((string)notecard_line);
|
||||
if(query_id==notecard_query){
|
||||
if(data == EOF){
|
||||
if(llGetListLength(NOTECARDS)-notecard_pointer>1){
|
||||
notecard_name = llList2String(NOTECARDS,notecard_pointer+=1);
|
||||
//llOwnerSay("N: "+notecard_name);
|
||||
notecard_query = llGetNotecardLine(notecard_name,notecard_line=0);
|
||||
}
|
||||
else if (animator_count+1<animator_total){
|
||||
animator_count++;
|
||||
Readout_Say(" ");
|
||||
Readout_Say("SITTER "+(string)animator_count);
|
||||
notecard_name = llList2String(NOTECARDS,notecard_pointer=0);
|
||||
notecard_query = llGetNotecardLine(notecard_name,notecard_line=0);
|
||||
}
|
||||
else{
|
||||
//state part_two;
|
||||
Readout_Say(" ");
|
||||
Readout_Say("--✄--COPY ABOVE INTO "+notecard_basename+" NOTECARD--✄--");
|
||||
finish();
|
||||
}
|
||||
}
|
||||
else{
|
||||
string out;
|
||||
data = llStringTrim(llList2String(llParseString2List(data,["//"],[]),0),STRING_TRIM);
|
||||
if(llGetSubString(notecard_name,0,9)==".MENUITEMS"){
|
||||
string command = llGetSubString(data,0,llSubStringIndex(data," ")-1);
|
||||
list parts = llParseString2List(llGetSubString(data,llSubStringIndex(data," ")+1,-1),[" | "," |","| ","|"],[]);
|
||||
if(command=="TOMENU" || command =="MENU"){
|
||||
/*
|
||||
if(llListFindList(["-","MAIN MENU","Height","OPTIONS","ShutDown..."],[llList2String(parts,0)])==-1){
|
||||
if(command =="MENU"){
|
||||
Readout_Say(" ");
|
||||
}
|
||||
out+=command+" "+llList2String(parts,0);
|
||||
Readout_Say(out);
|
||||
}
|
||||
*/
|
||||
}
|
||||
else if(command=="POSE"){
|
||||
if(llListFindList(ommit,[llList2String(parts,0)])==-1){
|
||||
if(llGetListLength(parts)-1>animator_total){
|
||||
animator_total=llGetListLength(parts)-1;
|
||||
}
|
||||
if(llGetListLength(parts)-animator_count>1){
|
||||
out = "POSE ";
|
||||
if(llGetListLength(parts)+animator_count>2){
|
||||
out = "SYNC ";
|
||||
}
|
||||
string pose = llStringTrim(llList2String(parts,animator_count+1),STRING_TRIM);
|
||||
pose = llList2String(llParseString2List(pose,["::"],[]),0); //remove MLP facial expressions
|
||||
pose = llList2String(llParseString2List(pose,[";"],[]),0); //remove XPOSE facial expressions
|
||||
|
||||
out+=llStringTrim(llList2String(parts,0),STRING_TRIM)+"|"+pose;
|
||||
Readout_Say(out);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else{//POSITIONS
|
||||
if (llSubStringIndex(data,"{")!=-1){//llGetSubString(data,0,0)=="{"){
|
||||
string command = llStringTrim(llGetSubString(data,llSubStringIndex(data,"{")+1,llSubStringIndex(data,"}")-1),STRING_TRIM);
|
||||
if(llListFindList(ommit,[command])==-1){
|
||||
data = llDumpList2String(llParseString2List(data,[" "],[""]),"");//remove spaces
|
||||
list parts = llParseString2List(data,["<"],[]);
|
||||
if(llGetListLength(parts)>animator_count*2+1){
|
||||
vector pos = (vector)("<"+llList2String(parts,animator_count*2+1));
|
||||
vector rot = (vector)("<"+llList2String(parts,animator_count*2+2));
|
||||
pos+= (vector)llGetObjectDesc();
|
||||
string result = "<"+FormatFloat(pos.x,3)+","+FormatFloat(pos.y,3)+","+FormatFloat(pos.z,3)+">";
|
||||
result += "<"+FormatFloat(rot.x,1)+","+FormatFloat(rot.y,1)+","+FormatFloat(rot.z,1)+">";
|
||||
Readout_Say("{"+command+"}"+result);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
notecard_query = llGetNotecardLine(notecard_name,notecard_line+=1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* Copyright (c) the AVsitter Contributors (http://avsitter.github.io)
|
||||
* AVsitter™ is a trademark. For trademark use policy see:
|
||||
* https://avsitter.github.io/TRADEMARK.mediawiki
|
||||
*
|
||||
* Please consider supporting continued development of AVsitter and
|
||||
* receive automatic updates and other benefits! All details and user
|
||||
* instructions can be found at http://avsitter.github.io
|
||||
*/
|
||||
|
||||
string product = "AVsitter2 MLP converter";
|
||||
string version = "2.2";
|
||||
string notecard_basename = "AVpos";
|
||||
list NOTECARDS;
|
||||
list PROPS_NOTECARDS;
|
||||
string notecard_name;
|
||||
key notecard_query;
|
||||
integer notecard_line;
|
||||
integer notecard_pointer;
|
||||
integer animator_count;
|
||||
integer animator_total;
|
||||
list ommit = ["default", "stand"];
|
||||
integer verbose = 0;
|
||||
Out(integer level, string out)
|
||||
{
|
||||
if (verbose >= level)
|
||||
{
|
||||
llOwnerSay(llGetScriptName() + "[" + version + "] " + out);
|
||||
}
|
||||
}
|
||||
string FormatFloat(float f, integer num_decimals)
|
||||
{
|
||||
float rounding = (float)(".5e-" + (string)num_decimals) - 5e-07;
|
||||
if (f < 0.)
|
||||
f -= rounding;
|
||||
else
|
||||
f += rounding;
|
||||
string ret = llGetSubString((string)f, 0, num_decimals - (!num_decimals) - 7);
|
||||
if (llSubStringIndex(ret, ".") != -1)
|
||||
{
|
||||
while (llGetSubString(ret, -1, -1) == "0")
|
||||
{
|
||||
ret = llGetSubString(ret, 0, -2);
|
||||
}
|
||||
}
|
||||
if (llGetSubString(ret, -1, -1) == ".")
|
||||
{
|
||||
ret = llGetSubString(ret, 0, -2);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
finish()
|
||||
{
|
||||
if (llSubStringIndex(llGetObjectName(), "Utilities") == -1) // remove it except from Utilities box
|
||||
{
|
||||
Out(0, "Removing script");
|
||||
llRemoveInventory(llGetScriptName());
|
||||
}
|
||||
}
|
||||
get_notecards()
|
||||
{
|
||||
integer i;
|
||||
for (i = 0; i < llGetInventoryNumber(INVENTORY_NOTECARD); i++)
|
||||
{
|
||||
string name = llGetInventoryName(INVENTORY_NOTECARD, i);
|
||||
if (llGetSubString(name, 0, 9) == ".MENUITEMS" || llGetSubString(name, 0, 9) == ".POSITIONS")
|
||||
{
|
||||
NOTECARDS += name;
|
||||
}
|
||||
else if (llGetSubString(name, 0, 5) == ".PROPS")
|
||||
{
|
||||
PROPS_NOTECARDS += name;
|
||||
}
|
||||
}
|
||||
}
|
||||
Readout_Say(string say)
|
||||
{
|
||||
string objectname = llGetObjectName();
|
||||
llSetObjectName("");
|
||||
llRegionSayTo(llGetOwner(), 0, "◆" + say);
|
||||
llSetObjectName(objectname);
|
||||
}
|
||||
default
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
Out(0, "Reading MLP notecards...");
|
||||
Readout_Say(" ");
|
||||
get_notecards();
|
||||
if (llGetListLength(NOTECARDS) > 0)
|
||||
{
|
||||
notecard_name = llList2String(NOTECARDS, notecard_pointer);
|
||||
Readout_Say("--✄--COPY BELOW INTO " + notecard_basename + " NOTECARD--✄--");
|
||||
Readout_Say(" ");
|
||||
Readout_Say("SITTER " + (string)animator_count);
|
||||
notecard_query = llGetNotecardLine(notecard_name, notecard_line);
|
||||
}
|
||||
else
|
||||
{
|
||||
Out(0, "No MLP notecards found!");
|
||||
finish();
|
||||
}
|
||||
}
|
||||
dataserver(key query_id, string data)
|
||||
{
|
||||
if (query_id == notecard_query)
|
||||
{
|
||||
if (data == EOF)
|
||||
{
|
||||
if (llGetListLength(NOTECARDS) - notecard_pointer > 1)
|
||||
{
|
||||
notecard_name = llList2String(NOTECARDS, notecard_pointer += 1);
|
||||
notecard_query = llGetNotecardLine(notecard_name, notecard_line = 0);
|
||||
}
|
||||
else if (animator_count + 1 < animator_total)
|
||||
{
|
||||
animator_count++;
|
||||
Readout_Say(" ");
|
||||
Readout_Say("SITTER " + (string)animator_count);
|
||||
notecard_name = llList2String(NOTECARDS, notecard_pointer = 0);
|
||||
notecard_query = llGetNotecardLine(notecard_name, notecard_line = 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
Readout_Say(" ");
|
||||
Readout_Say("--✄--COPY ABOVE INTO " + notecard_basename + " NOTECARD--✄--");
|
||||
finish();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
string out;
|
||||
data = llStringTrim(llList2String(llParseString2List(data, ["//"], []), 0), STRING_TRIM);
|
||||
if (llGetSubString(notecard_name, 0, 9) == ".MENUITEMS")
|
||||
{
|
||||
string command = llGetSubString(data, 0, llSubStringIndex(data, " ") - 1);
|
||||
list parts = llParseString2List(llGetSubString(data, llSubStringIndex(data, " ") + 1, -1), [" | ", " |", "| ", "|"], []);
|
||||
if (command == "TOMENU" || command == "MENU")
|
||||
{
|
||||
}
|
||||
else if (command == "POSE")
|
||||
{
|
||||
if (llListFindList(ommit, [llList2String(parts, 0)]) == -1)
|
||||
{
|
||||
if (llGetListLength(parts) - 1 > animator_total)
|
||||
{
|
||||
animator_total = llGetListLength(parts) - 1;
|
||||
}
|
||||
if (llGetListLength(parts) - animator_count > 1)
|
||||
{
|
||||
out = "POSE ";
|
||||
if (llGetListLength(parts) + animator_count > 2)
|
||||
{
|
||||
out = "SYNC ";
|
||||
}
|
||||
string pose = llStringTrim(llList2String(parts, animator_count + 1), STRING_TRIM);
|
||||
pose = llList2String(llParseString2List(pose, ["::"], []), 0);
|
||||
pose = llList2String(llParseString2List(pose, [";"], []), 0);
|
||||
out += llStringTrim(llList2String(parts, 0), STRING_TRIM) + "|" + pose;
|
||||
Readout_Say(out);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (llSubStringIndex(data, "{") != -1)
|
||||
{
|
||||
string command = llStringTrim(llGetSubString(data, llSubStringIndex(data, "{") + 1, llSubStringIndex(data, "}") - 1), STRING_TRIM);
|
||||
if (llListFindList(ommit, [command]) == -1)
|
||||
{
|
||||
data = llDumpList2String(llParseString2List(data, [" "], [""]), "");
|
||||
list parts = llParseString2List(data, ["<"], []);
|
||||
if (llGetListLength(parts) > animator_count * 2 + 1)
|
||||
{
|
||||
vector pos = (vector)("<" + llList2String(parts, animator_count * 2 + 1));
|
||||
vector rot = (vector)("<" + llList2String(parts, animator_count * 2 + 2));
|
||||
pos += (vector)llGetObjectDesc();
|
||||
string result = "<" + FormatFloat(pos.x, 3) + "," + FormatFloat(pos.y, 3) + "," + FormatFloat(pos.z, 3) + ">";
|
||||
result += "<" + FormatFloat(rot.x, 1) + "," + FormatFloat(rot.y, 1) + "," + FormatFloat(rot.z, 1) + ">";
|
||||
Readout_Say("{" + command + "}" + result);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
notecard_query = llGetNotecardLine(notecard_name, notecard_line += 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
124
AVsitter2/Utilities/Missing-anim-finder.lsl
Normal file
124
AVsitter2/Utilities/Missing-anim-finder.lsl
Normal file
|
@ -0,0 +1,124 @@
|
|||
/*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* Copyright (c) the AVsitter Contributors (http://avsitter.github.io)
|
||||
* AVsitter™ is a trademark. For trademark use policy see:
|
||||
* https://avsitter.github.io/TRADEMARK.mediawiki
|
||||
*
|
||||
* Please consider supporting continued development of AVsitter and
|
||||
* receive automatic updates and other benefits! All details and user
|
||||
* instructions can be found at http://avsitter.github.io
|
||||
*/
|
||||
|
||||
string notecard_basename = "AVpos";
|
||||
integer variable1;
|
||||
key notecard_query;
|
||||
list ALL_USED_ANIMATIONS;
|
||||
list UNUSED_ANIMS;
|
||||
Owner_Say(string say)
|
||||
{
|
||||
llOwnerSay(llGetScriptName() + ": " + say);
|
||||
}
|
||||
finish()
|
||||
{
|
||||
Owner_Say("Check complete, removing script.");
|
||||
Owner_Say("================================");
|
||||
Owner_Say(" ");
|
||||
if (llSubStringIndex(llGetObjectName(), "Utilities") == -1) // remove it except from Utilities box
|
||||
{
|
||||
llRemoveInventory(llGetScriptName());
|
||||
}
|
||||
}
|
||||
default
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
if (llGetInventoryType(notecard_basename) == INVENTORY_NOTECARD)
|
||||
{
|
||||
Owner_Say(" ");
|
||||
Owner_Say("================================");
|
||||
Owner_Say("Checking for missing or unused anims.");
|
||||
notecard_query = llGetNotecardLine(notecard_basename, variable1);
|
||||
}
|
||||
else
|
||||
{
|
||||
Owner_Say(notecard_basename + " notecard not found. Removing '" + llGetScriptName() + "' from inventory.");
|
||||
if (llSubStringIndex(llGetObjectName(), "Utilities") == -1)
|
||||
{
|
||||
llRemoveInventory(llGetScriptName());
|
||||
}
|
||||
}
|
||||
}
|
||||
dataserver(key query_id, string data)
|
||||
{
|
||||
if (query_id == notecard_query)
|
||||
{
|
||||
if (data == EOF)
|
||||
{
|
||||
integer i;
|
||||
for (i = 0; i < llGetInventoryNumber(INVENTORY_ANIMATION); i++)
|
||||
{
|
||||
if (llListFindList(ALL_USED_ANIMATIONS, [llGetInventoryName(INVENTORY_ANIMATION, i)]) == -1 && llListFindList(["AVhipfix"], [llGetInventoryName(INVENTORY_ANIMATION, i)]) == -1)
|
||||
{
|
||||
Owner_Say("Animation '" + llGetInventoryName(INVENTORY_ANIMATION, i) + "' found in inventory but not used in notecard!");
|
||||
UNUSED_ANIMS += llGetInventoryName(INVENTORY_ANIMATION, i);
|
||||
}
|
||||
}
|
||||
if (llGetListLength(UNUSED_ANIMS))
|
||||
{
|
||||
llDialog(llGetOwner(), "\n" + (string)llGetListLength(UNUSED_ANIMS) + " unused anims were found. Do you want to delete them?\n\nMake sure you take a backup of your work first!", ["YES", "NO"], -268534);
|
||||
llListen(-268534, "", llGetOwner(), "");
|
||||
llSetTimerEvent(60);
|
||||
}
|
||||
else
|
||||
{
|
||||
finish();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
data = llGetSubString(data, llSubStringIndex(data, "◆") + 1, -1);
|
||||
data = llStringTrim(data, STRING_TRIM);
|
||||
string command = llGetSubString(data, 0, llSubStringIndex(data, " ") - 1);
|
||||
list parts = llParseString2List(llGetSubString(data, llSubStringIndex(data, " ") + 1, -1), [" | ", " |", "| ", "|"], []);
|
||||
if (command == "POSE" || command == "SYNC")
|
||||
{
|
||||
list anims = llList2ListStrided(llDeleteSubList(parts, 0, 0), 0, -1, 2);
|
||||
integer i;
|
||||
for (i = 0; i < llGetListLength(anims); i++)
|
||||
{
|
||||
if (llGetInventoryType(llList2String(anims, i)) != INVENTORY_ANIMATION)
|
||||
{
|
||||
Owner_Say("Animation '" + llList2String(anims, i) + "' not found in inventory!");
|
||||
}
|
||||
ALL_USED_ANIMATIONS += llList2String(anims, i);
|
||||
}
|
||||
}
|
||||
notecard_query = llGetNotecardLine(notecard_basename, variable1 += 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
listen(integer chan, string name, key id, string msg)
|
||||
{
|
||||
if (msg == "YES")
|
||||
{
|
||||
integer i;
|
||||
for (i = 0; i < llGetListLength(UNUSED_ANIMS); i++)
|
||||
{
|
||||
if (llGetInventoryType(llList2String(UNUSED_ANIMS, i)) == INVENTORY_ANIMATION)
|
||||
{
|
||||
llRemoveInventory(llList2String(UNUSED_ANIMS, i));
|
||||
Owner_Say("Deleted unused anim: '" + llList2String(UNUSED_ANIMS, i) + "'");
|
||||
}
|
||||
}
|
||||
}
|
||||
finish();
|
||||
}
|
||||
timer()
|
||||
{
|
||||
Owner_Say("timeout");
|
||||
finish();
|
||||
}
|
||||
}
|
96
AVsitter2/Utilities/Updater/update-receiver.lsl
Normal file
96
AVsitter2/Utilities/Updater/update-receiver.lsl
Normal file
|
@ -0,0 +1,96 @@
|
|||
/*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* Copyright (c) the AVsitter Contributors (http://avsitter.github.io)
|
||||
* AVsitter™ is a trademark. For trademark use policy see:
|
||||
* https://avsitter.github.io/TRADEMARK.mediawiki
|
||||
*
|
||||
* Please consider supporting continued development of AVsitter and
|
||||
* receive automatic updates and other benefits! All details and user
|
||||
* instructions can be found at http://avsitter.github.io
|
||||
*/
|
||||
|
||||
/*
|
||||
* Simple script used for updating a large number of furniture items at once
|
||||
* This script goes in each furniture prim that expects an update from the sender
|
||||
* will auto-delete if a non-admin avatar rezzes the furniture
|
||||
*/
|
||||
|
||||
integer pin = -29752;
|
||||
list admin_avatars = ["b30c9262-9abf-4cd1-9476-adcf5723c029", "f2e0ed5e-6592-4199-901d-a659c324ca94"];
|
||||
default
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
llSetTimerEvent(0.1);
|
||||
if (llGetStartParameter() == -1)
|
||||
{
|
||||
integer i;
|
||||
while (llGetInventoryNumber(INVENTORY_OBJECT))
|
||||
{
|
||||
string item = llGetInventoryName(INVENTORY_OBJECT, llGetInventoryNumber(INVENTORY_OBJECT) - 1);
|
||||
llRegionSayTo(llGetOwner(), 0, "Removing :" + item);
|
||||
llRemoveInventory(item);
|
||||
}
|
||||
}
|
||||
llSetRemoteScriptAccessPin(pin);
|
||||
llListen(pin, "", "", "");
|
||||
}
|
||||
timer()
|
||||
{
|
||||
if (llGetLinkNumber() == 0 || llGetLinkNumber() == 1 && llGetInventoryType("[AV]object") != INVENTORY_SCRIPT)
|
||||
{
|
||||
if (llGetAgentSize(llGetLinkKey(llGetNumberOfPrims())) == ZERO_VECTOR)
|
||||
{
|
||||
llSetText(llGetObjectName(), <1,1,0>, 1);
|
||||
}
|
||||
}
|
||||
llSetTimerEvent(10);
|
||||
}
|
||||
on_rez(integer start)
|
||||
{
|
||||
if (start)
|
||||
{
|
||||
if (~llListFindList(admin_avatars, [llGetOwner()]))
|
||||
{
|
||||
llRegionSayTo(llGetOwner(), 0, "Removing :" + llGetScriptName());
|
||||
}
|
||||
llRemoveInventory(llGetScriptName());
|
||||
}
|
||||
}
|
||||
listen(integer chan, string name, key id, string msg)
|
||||
{
|
||||
if (llGetOwnerKey(id) == llGetOwner())
|
||||
{
|
||||
list data = llParseStringKeepNulls(msg, ["|"], []);
|
||||
if (llList2String(data, 0) == "OBJECT_SEARCH")
|
||||
{
|
||||
list reply;
|
||||
integer i;
|
||||
for (i = 1; i < llGetListLength(data); i++)
|
||||
{
|
||||
if (llGetInventoryType(llList2String(data, i)) != INVENTORY_NONE)
|
||||
{
|
||||
reply += [llList2String(data, i), (string)llGetInventoryKey(llList2String(data, i))];
|
||||
}
|
||||
}
|
||||
if (llGetListLength(reply) > 0)
|
||||
{
|
||||
llRegionSay(pin, "OBJECT_HERE|" + llDumpList2String(reply, "|"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
changed(integer change)
|
||||
{
|
||||
if (change & CHANGED_OWNER)
|
||||
{
|
||||
if (!llListFindList(admin_avatars, [llGetOwner()]))
|
||||
{
|
||||
llRemoveInventory(llGetScriptName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
184
AVsitter2/Utilities/Updater/update-sender.lsl
Normal file
184
AVsitter2/Utilities/Updater/update-sender.lsl
Normal file
|
@ -0,0 +1,184 @@
|
|||
/*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* Copyright (c) the AVsitter Contributors (http://avsitter.github.io)
|
||||
* AVsitter™ is a trademark. For trademark use policy see:
|
||||
* https://avsitter.github.io/TRADEMARK.mediawiki
|
||||
*
|
||||
* Please consider supporting continued development of AVsitter and
|
||||
* receive automatic updates and other benefits! All details and user
|
||||
* instructions can be found at http://avsitter.github.io
|
||||
*/
|
||||
|
||||
/*
|
||||
* Simple script used for updating a large number of furniture items at once
|
||||
* This script goes in a "sender" prim along with the latest copies of the
|
||||
* (not running) scripts and inventory objects (e.g. prop objects)
|
||||
* Touching the sender will shout in a radius and update all prims that respond.
|
||||
*/
|
||||
|
||||
integer pin = -29752;
|
||||
string receiver_script = "update receiver (auto removing)";
|
||||
list objects_to_update;
|
||||
list objects_files;
|
||||
integer menu_handle;
|
||||
key av;
|
||||
particles_on(key target)
|
||||
{
|
||||
llParticleSystem([
|
||||
PSYS_PART_FLAGS, 0 | PSYS_PART_INTERP_COLOR_MASK | PSYS_PART_INTERP_SCALE_MASK | PSYS_PART_FOLLOW_VELOCITY_MASK | PSYS_PART_EMISSIVE_MASK | PSYS_PART_TARGET_POS_MASK,
|
||||
PSYS_SRC_PATTERN, 0 | PSYS_SRC_PATTERN_DROP,
|
||||
PSYS_PART_START_ALPHA, 1.00000,
|
||||
PSYS_PART_END_ALPHA, 1,
|
||||
PSYS_PART_START_COLOR, <1, 0, 0>,
|
||||
PSYS_PART_END_COLOR, <0, 0, 1>,
|
||||
PSYS_PART_START_SCALE, <0.08, 0.2, 0>,
|
||||
PSYS_PART_END_SCALE, <0.08, 0.2, 0>,
|
||||
PSYS_PART_MAX_AGE, 2.0,
|
||||
PSYS_SRC_MAX_AGE, 0,
|
||||
PSYS_SRC_ACCEL, <0, 0, 0>,
|
||||
PSYS_SRC_BURST_PART_COUNT, 250,
|
||||
PSYS_SRC_BURST_RADIUS, 0.00000,
|
||||
PSYS_SRC_BURST_RATE, 0.05766,
|
||||
PSYS_SRC_BURST_SPEED_MIN, 0.07813,
|
||||
PSYS_SRC_BURST_SPEED_MAX, 0.15625,
|
||||
PSYS_SRC_INNERANGLE, 0.09375,
|
||||
PSYS_SRC_OUTERANGLE, 0.00000,
|
||||
PSYS_SRC_OMEGA, <0, 0, 0>,
|
||||
PSYS_SRC_TEXTURE, (key)"",
|
||||
PSYS_SRC_TARGET_KEY, target
|
||||
]);
|
||||
}
|
||||
default
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
llParticleSystem([]);
|
||||
llListen(pin, "", "", "");
|
||||
}
|
||||
on_rez(integer x)
|
||||
{
|
||||
llResetScript();
|
||||
}
|
||||
timer()
|
||||
{
|
||||
llRegionSayTo(av, 0, "Found " + (string)llGetListLength(objects_to_update) + " objects...");
|
||||
integer i;
|
||||
for (i = 0; i < llGetListLength(objects_to_update); i++)
|
||||
{
|
||||
key object = llList2Key(objects_to_update, i);
|
||||
list items = llParseStringKeepNulls(llList2String(objects_files, i), ["|"], []);
|
||||
if (1 == 1)
|
||||
{
|
||||
list scripts_to_update;
|
||||
list other_to_update;
|
||||
list surplus_to_update;
|
||||
integer j;
|
||||
for (j = 0; j < llGetListLength(items); j = j + 2)
|
||||
{
|
||||
string item = llList2String(items, j);
|
||||
key item_key = (key)llList2String(items, j + 1);
|
||||
if (item_key != llGetInventoryKey(item) || item_key == NULL_KEY)
|
||||
{
|
||||
if (llGetInventoryType(item) == INVENTORY_SCRIPT)
|
||||
{
|
||||
scripts_to_update += item;
|
||||
}
|
||||
else
|
||||
{
|
||||
other_to_update += item;
|
||||
}
|
||||
}
|
||||
else if (llGetInventoryType(item) == INVENTORY_OBJECT)
|
||||
{
|
||||
surplus_to_update += item;
|
||||
}
|
||||
}
|
||||
if (llGetListLength(scripts_to_update) == 0 && llGetListLength(other_to_update) == 0)
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
particles_on(object);
|
||||
if (llGetListLength(other_to_update) > 0)
|
||||
{
|
||||
if (llListFindList(scripts_to_update, [receiver_script]) == -1)
|
||||
{
|
||||
scripts_to_update += receiver_script;
|
||||
}
|
||||
}
|
||||
if (llListFindList(scripts_to_update, [receiver_script]) != -1)
|
||||
{
|
||||
other_to_update += surplus_to_update;
|
||||
}
|
||||
for (j = 0; j < llGetListLength(scripts_to_update); j++)
|
||||
{
|
||||
llRegionSayTo(av, 0, "Sending: " + llList2String(scripts_to_update, j) + " to " + llKey2Name(object));
|
||||
integer running = TRUE;
|
||||
if (llSubStringIndex(llKey2Name(object), "[BOX]") != -1 && llList2String(scripts_to_update, j) != receiver_script)
|
||||
{
|
||||
running = FALSE; // set scripts not running if the target name contains [BOX]
|
||||
}
|
||||
integer remove_objects = -1;
|
||||
if (llGetListLength(surplus_to_update))
|
||||
{
|
||||
remove_objects = -1;
|
||||
}
|
||||
llRemoteLoadScriptPin(object, llList2String(scripts_to_update, j), pin, running, remove_objects);
|
||||
}
|
||||
for (j = 0; j < llGetListLength(other_to_update); j++)
|
||||
{
|
||||
llRegionSayTo(av, 0, "Sending: " + llList2String(other_to_update, j) + " to " + llKey2Name(object));
|
||||
llGiveInventory(object, llList2String(other_to_update, j));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
llRemoteLoadScriptPin(object, receiver_script, pin, TRUE, -1);
|
||||
}
|
||||
}
|
||||
llRegionSayTo(av, 0, "Updating Complete!");
|
||||
llResetScript();
|
||||
}
|
||||
touch_start(integer touched)
|
||||
{
|
||||
if (llDetectedKey(0) == llGetOwner() || llSameGroup(llDetectedKey(0)))
|
||||
{
|
||||
av = llDetectedKey(0);
|
||||
objects_to_update = [];
|
||||
objects_files = [];
|
||||
llSetTimerEvent(10);
|
||||
list items;
|
||||
integer i;
|
||||
for (i = 0; i < llGetInventoryNumber(INVENTORY_ALL); i++)
|
||||
{
|
||||
if (llGetInventoryName(INVENTORY_ALL, i) != llGetScriptName())
|
||||
{
|
||||
items += llGetInventoryName(INVENTORY_ALL, i);
|
||||
}
|
||||
}
|
||||
llRegionSayTo(av, 0, "listening...");
|
||||
llSay(pin, "OBJECT_SEARCH|" + llDumpList2String(items, "|"));
|
||||
}
|
||||
}
|
||||
listen(integer chan, string name, key id, string msg)
|
||||
{
|
||||
if (llGetOwnerKey(id) == llGetOwner())
|
||||
{
|
||||
list data = llParseStringKeepNulls(msg, ["|"], []);
|
||||
if (llList2String(data, 0) == "OBJECT_HERE")
|
||||
{
|
||||
vector mysize = llGetScale();
|
||||
float distance = llVecMag(llGetPos() - llList2Vector(llGetObjectDetails(id, [OBJECT_POS]), 0));
|
||||
if (distance <= mysize.x / 2)
|
||||
{
|
||||
objects_to_update += id;
|
||||
objects_files += llDumpList2String(llList2List(data, 1, -1), "|");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
866
AVsitter2/[AV]adjuster.lsl
Normal file
866
AVsitter2/[AV]adjuster.lsl
Normal file
|
@ -0,0 +1,866 @@
|
|||
/*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* Copyright (c) the AVsitter Contributors (http://avsitter.github.io)
|
||||
* AVsitter™ is a trademark. For trademark use policy see:
|
||||
* https://avsitter.github.io/TRADEMARK.mediawiki
|
||||
*
|
||||
* Please consider supporting continued development of AVsitter and
|
||||
* receive automatic updates and other benefits! All details and user
|
||||
* instructions can be found at http://avsitter.github.io
|
||||
*/
|
||||
|
||||
integer OLD_HELPER_METHOD;
|
||||
key key_request;
|
||||
string url = "https://avsitter.com/settings.php"; // the settings dump service remains up for AVsitter customers. settings clear periodically.
|
||||
string version = "2.2";
|
||||
string helper_name = "[AV]helper";
|
||||
string prop_script = "[AV]prop";
|
||||
string expression_script = "[AV]faces";
|
||||
string camera_script = "[AV]camera";
|
||||
string mainscript = "[AV]sitA";
|
||||
string notecard_name = "AVpos";
|
||||
list POS_LIST;
|
||||
list ROT_LIST;
|
||||
list HELPER_KEY_LIST;
|
||||
list SITTER_POSES;
|
||||
list SITTERS;
|
||||
integer sitter_count;
|
||||
integer end_count;
|
||||
integer verbose = 0;
|
||||
integer chat_channel = 5;
|
||||
integer helper_mode;
|
||||
integer comm_channel;
|
||||
integer listen_handle;
|
||||
integer active_sitter;
|
||||
key controller;
|
||||
integer menu_page;
|
||||
string adding;
|
||||
integer adding_item_type;
|
||||
string last_text;
|
||||
integer menu_pages;
|
||||
integer number_per_page = 9;
|
||||
list chosen_animations;
|
||||
string cache;
|
||||
string webkey;
|
||||
integer webcount;
|
||||
string FormatFloat(float f, integer num_decimals)
|
||||
{
|
||||
float rounding = (float)(".5e-" + (string)num_decimals) - 5e-07;
|
||||
if (f < 0.)
|
||||
f -= rounding;
|
||||
else
|
||||
f += rounding;
|
||||
string ret = llGetSubString((string)f, 0, num_decimals - (!num_decimals) - 7);
|
||||
if (~llSubStringIndex(ret, "."))
|
||||
{
|
||||
while (llGetSubString(ret, -1, -1) == "0")
|
||||
{
|
||||
ret = llGetSubString(ret, 0, -2);
|
||||
}
|
||||
}
|
||||
if (llGetSubString(ret, -1, -1) == ".")
|
||||
{
|
||||
ret = llGetSubString(ret, 0, -2);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
web(integer force)
|
||||
{
|
||||
if (llStringLength(llEscapeURL(cache)) > 1024 || force)
|
||||
{
|
||||
if (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);
|
||||
cache = "";
|
||||
}
|
||||
}
|
||||
Readout_Say(string say)
|
||||
{
|
||||
string objectname = llGetObjectName();
|
||||
llSetObjectName("");
|
||||
llRegionSayTo(llGetOwner(), 0, "◆" + say);
|
||||
llSetObjectName(objectname);
|
||||
cache += say + "\n";
|
||||
say = "";
|
||||
web(FALSE);
|
||||
}
|
||||
stop_all_anims(key id)
|
||||
{
|
||||
list animations = llGetAnimationList(id);
|
||||
integer i;
|
||||
for (i = 0; i < llGetListLength(animations); i++)
|
||||
{
|
||||
llMessageLinked(LINK_THIS, 90002, llList2String(animations, i), id);
|
||||
}
|
||||
}
|
||||
list order_buttons(list buttons)
|
||||
{
|
||||
return llList2List(buttons, -3, -1) + llList2List(buttons, -6, -4) + llList2List(buttons, -9, -7) + llList2List(buttons, -12, -10);
|
||||
}
|
||||
string strReplace(string str, string search, string replace)
|
||||
{
|
||||
return llDumpList2String(llParseStringKeepNulls((str = "") + str, [search], []), replace);
|
||||
}
|
||||
preview_anim(string anim, key id)
|
||||
{
|
||||
if (id)
|
||||
{
|
||||
stop_all_anims(id);
|
||||
llMessageLinked(LINK_THIS, 90001, anim, id);
|
||||
}
|
||||
}
|
||||
list get_choices()
|
||||
{
|
||||
integer my_number_per_page = number_per_page;
|
||||
if (adding == "[SYNC]" && sitter_count > 1)
|
||||
{
|
||||
my_number_per_page--;
|
||||
}
|
||||
list options;
|
||||
integer i;
|
||||
integer start = my_number_per_page * menu_page;
|
||||
integer end = start + my_number_per_page;
|
||||
if (adding == "[FACE]")
|
||||
{
|
||||
list facial_anim_list = ["none", "express_afraid_emote", "express_anger_emote", "express_laugh_emote", "express_bored_emote", "express_cry_emote", "express_embarrassed_emote", "express_sad_emote", "express_toothsmile", "express_smile", "express_surprise_emote", "express_worry_emote", "express_repulsed_emote", "express_shrug_emote", "express_wink_emote", "express_disdain", "express_frown", "express_kiss", "express_open_mouth", "express_tongue_out"];
|
||||
i = llGetListLength(facial_anim_list);
|
||||
options = llList2List(facial_anim_list, start, end - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
integer type = INVENTORY_ANIMATION;
|
||||
if (adding == "[PROP]")
|
||||
{
|
||||
type = INVENTORY_OBJECT;
|
||||
}
|
||||
i = start;
|
||||
while (i < end && i < llGetInventoryNumber(type))
|
||||
{
|
||||
if (llGetInventoryName(type, i) != helper_name)
|
||||
{
|
||||
options += llGetInventoryName(type, i);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
i = llGetInventoryNumber(type);
|
||||
}
|
||||
menu_pages = llCeil((float)i / my_number_per_page);
|
||||
return options;
|
||||
}
|
||||
ask_anim()
|
||||
{
|
||||
choice_menu(get_choices(), "Choose anim" + sitter_text(sitter_count) + ":");
|
||||
}
|
||||
choice_menu(list options, string menu_text)
|
||||
{
|
||||
last_text = menu_text;
|
||||
menu_text = "\n(Page " + (string)(menu_page + 1) + "/" + (string)menu_pages + ")\n" + menu_text + "\n\n";
|
||||
list menu_items;
|
||||
integer i;
|
||||
if (llGetListLength(options) == 0)
|
||||
{
|
||||
menu_text = "\nNo items of required type in prim inventory.";
|
||||
menu_items = ["[BACK]"];
|
||||
}
|
||||
else
|
||||
{
|
||||
integer cutoff = 65;
|
||||
integer all_options_length = llStringLength(llDumpList2String(options, ""));
|
||||
integer total_need_to_cut = 412 - all_options_length;
|
||||
if (total_need_to_cut < 0)
|
||||
{
|
||||
cutoff = 43;
|
||||
}
|
||||
for (i = 0; i < llGetListLength(options); i++)
|
||||
{
|
||||
menu_items += (string)(i + 1);
|
||||
string item = llList2String(options, i);
|
||||
if (llStringLength(item) > cutoff)
|
||||
{
|
||||
item = llGetSubString(item, 0, cutoff) + "..";
|
||||
}
|
||||
menu_text += (string)(i + 1) + "." + item + "\n";
|
||||
}
|
||||
if (adding == "[SYNC]" && sitter_count > 1)
|
||||
{
|
||||
menu_items += "[DONE]";
|
||||
}
|
||||
menu_items += ["[BACK]", "[<<]", "[>>]"];
|
||||
}
|
||||
llDialog(controller, menu_text, order_buttons(menu_items), comm_channel);
|
||||
}
|
||||
new_menu()
|
||||
{
|
||||
menu_page = 0;
|
||||
list menu_items = ["[BACK]", "[POSE]", "[SYNC]", "[SUBMENU]"];
|
||||
if (llList2String(SITTER_POSES, active_sitter) != "")
|
||||
{
|
||||
menu_items += ["[PROP]", "[FACE]"];
|
||||
}
|
||||
menu_items += "[CAMERA]";
|
||||
string menu_text = "\nWhat would you like to create?\n";
|
||||
llDialog(controller, menu_text, order_buttons(menu_items), comm_channel);
|
||||
}
|
||||
end_helper_mode()
|
||||
{
|
||||
llRegionSay(comm_channel, "DONEA");
|
||||
helper_mode = FALSE;
|
||||
}
|
||||
Out(string out)
|
||||
{
|
||||
llOwnerSay(llGetScriptName() + "[" + version + "] " + out);
|
||||
}
|
||||
integer get_number_of_scripts()
|
||||
{
|
||||
integer i;
|
||||
while (llGetInventoryType(mainscript + " " + (string)(++i)) == INVENTORY_SCRIPT)
|
||||
;
|
||||
return i;
|
||||
}
|
||||
string convert_to_world_positions(integer num)
|
||||
{
|
||||
list details = llGetObjectDetails(llGetLinkKey(llGetLinkNumber()), [OBJECT_POS, OBJECT_ROT]);
|
||||
rotation target_rot = llEuler2Rot(llList2Vector(ROT_LIST, num) * DEG_TO_RAD) * llList2Rot(details, 1);
|
||||
vector target_pos = llList2Vector(POS_LIST, num) * llList2Rot(details, 1) + llList2Vector(details, 0);
|
||||
return (string)target_pos + "|" + (string)target_rot;
|
||||
}
|
||||
string sitter_text(integer sitter)
|
||||
{
|
||||
return " for SITTER " + (string)sitter;
|
||||
}
|
||||
remove_script(string reason)
|
||||
{
|
||||
string message = "\n" + llGetScriptName() + " ==Script Removed==\n\n" + reason;
|
||||
llDialog(llGetOwner(), message, [], -3675);
|
||||
llInstantMessage(llGetOwner(), message);
|
||||
llRemoveInventory(llGetScriptName());
|
||||
}
|
||||
done_choosing_anims()
|
||||
{
|
||||
string adding_text = llList2String(llParseString2List(adding, ["[", "]"], []), 0);
|
||||
adding += "2";
|
||||
integer i;
|
||||
string text;
|
||||
for (i = 0; i < llGetListLength(chosen_animations); i++)
|
||||
{
|
||||
text += "\nSITTER " + (string)i + ": " + llList2String(chosen_animations, i);
|
||||
}
|
||||
llTextBox(controller, "\nType a menu name for " + adding_text + text, comm_channel);
|
||||
}
|
||||
camera_menu()
|
||||
{
|
||||
string text = "\nCamera:\n\n";
|
||||
if (llGetInventoryType(camera_script) == INVENTORY_SCRIPT)
|
||||
{
|
||||
text += "(using [AV]camera scripts)";
|
||||
}
|
||||
else
|
||||
{
|
||||
text += "(prim property)";
|
||||
}
|
||||
llDialog(controller, text, ["[BACK]", "[SAVE]", "[CLEAR]"], comm_channel);
|
||||
}
|
||||
unsit_all()
|
||||
{
|
||||
integer i = llGetNumberOfPrims();
|
||||
while (llGetAgentSize(llGetLinkKey(i)))
|
||||
{
|
||||
stop_all_anims(llGetLinkKey(i));
|
||||
llUnSit(llGetLinkKey(i));
|
||||
i--;
|
||||
}
|
||||
}
|
||||
toggle_helper_mode()
|
||||
{
|
||||
helper_mode = (!helper_mode);
|
||||
if (helper_mode)
|
||||
{
|
||||
if (OLD_HELPER_METHOD)
|
||||
{
|
||||
unsit_all();
|
||||
}
|
||||
listen_handle = llListen(comm_channel, "", "", "");
|
||||
integer i;
|
||||
for (i = 0; i < llGetListLength(SITTERS); i++)
|
||||
{
|
||||
integer param = comm_channel + i * -1;
|
||||
if (llGetListLength(SITTERS) == 1)
|
||||
{
|
||||
param = comm_channel + llGetLinkNumber() * -1;
|
||||
}
|
||||
vector offset = llList2Vector(POS_LIST, i);
|
||||
if (llVecMag(offset) > 10)
|
||||
{
|
||||
offset = ZERO_VECTOR;
|
||||
}
|
||||
llRezObject(helper_name, llGetPos() + offset * llGetRot(), ZERO_VECTOR, llEuler2Rot(llList2Vector(ROT_LIST, i) * DEG_TO_RAD) * llGetRot(), param);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
end_helper_mode();
|
||||
}
|
||||
}
|
||||
default
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
if (~llSubStringIndex(llGetScriptName(), " "))
|
||||
{
|
||||
remove_script("Use only one of this script!");
|
||||
}
|
||||
llListen(chat_channel, "", llGetOwner(), "");
|
||||
comm_channel = ((integer)llFrand(99999) + 1) * 1000 * -1;
|
||||
integer i;
|
||||
while (i++ < get_number_of_scripts())
|
||||
{
|
||||
SITTERS += 0;
|
||||
POS_LIST += 0;
|
||||
ROT_LIST += 0;
|
||||
HELPER_KEY_LIST += 0;
|
||||
SITTER_POSES += "";
|
||||
}
|
||||
if (llGetListLength(SITTERS) == 1)
|
||||
{
|
||||
comm_channel -= 1000000000;
|
||||
}
|
||||
}
|
||||
link_message(integer sender, integer num, string msg, key id)
|
||||
{
|
||||
integer one = (integer)msg;
|
||||
integer two = (integer)((string)id);
|
||||
if (sender == llGetLinkNumber())
|
||||
{
|
||||
list data = llParseStringKeepNulls(msg, ["|"], []);
|
||||
if (num == 90065)
|
||||
{
|
||||
integer index = llListFindList(SITTERS, [id]);
|
||||
if (~index)
|
||||
{
|
||||
SITTERS = llListReplaceList(SITTERS, [NULL_KEY], index, index);
|
||||
}
|
||||
}
|
||||
else 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);
|
||||
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);
|
||||
}
|
||||
}
|
||||
else if (num == 90070)
|
||||
{
|
||||
SITTERS = llListReplaceList(SITTERS, [id], (integer)msg, (integer)msg);
|
||||
}
|
||||
else 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))
|
||||
{
|
||||
index++;
|
||||
string lookfor = llList2String(scripts, index);
|
||||
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));
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (llGetInventoryType(mainscript + " " + (string)(script_channel + 1)) == INVENTORY_SCRIPT)
|
||||
{
|
||||
llMessageLinked(LINK_THIS, 90020, (string)(script_channel + 1), "");
|
||||
}
|
||||
else
|
||||
{
|
||||
Readout_Say("");
|
||||
Readout_Say("--✄--COPY ABOVE INTO \"AVpos\" NOTECARD--✄--");
|
||||
Readout_Say("");
|
||||
web(TRUE);
|
||||
llRegionSayTo(llGetOwner(), 0, "Settings copy: " + url + "?q=" + webkey);
|
||||
}
|
||||
}
|
||||
else if (num == 90022)
|
||||
{
|
||||
if (llGetSubString(msg, 0, 3) == "S:M:" || llGetSubString(msg, 0, 3) == "S:T:")
|
||||
{
|
||||
msg = strReplace(msg, "*|", "|");
|
||||
}
|
||||
if (llGetSubString(msg, 0, 1) == "V:")
|
||||
{
|
||||
if (!(integer)((string)id))
|
||||
{
|
||||
webkey = (string)llGenerateKey();
|
||||
webcount = 0;
|
||||
Readout_Say("");
|
||||
Readout_Say("--✄--COPY BELOW INTO \"AVpos\" NOTECARD--✄--");
|
||||
Readout_Say("");
|
||||
Readout_Say("\"" + llToUpper(llGetObjectName()) + "\" " + strReplace(llList2String(data, 0), "V:", "AVsitter "));
|
||||
if ((integer)llList2String(data, 1))
|
||||
{
|
||||
Readout_Say("MTYPE " + llList2String(data, 1));
|
||||
}
|
||||
if ((integer)llList2String(data, 2) != 1)
|
||||
{
|
||||
Readout_Say("ETYPE " + llList2String(data, 2));
|
||||
}
|
||||
if ((integer)llList2String(data, 3) > -1)
|
||||
{
|
||||
Readout_Say("SET " + llList2String(data, 3));
|
||||
}
|
||||
if ((integer)llList2String(data, 4) != 2)
|
||||
{
|
||||
Readout_Say("SWAP " + llList2String(data, 4));
|
||||
}
|
||||
if (llList2String(data, 6))
|
||||
{
|
||||
Readout_Say("TEXT " + strReplace(llList2String(data, 6), "\n", "\\n"));
|
||||
}
|
||||
if (llList2String(data, 7))
|
||||
{
|
||||
Readout_Say("ADJUST " + strReplace(llList2String(data, 7), "<22>", "|"));
|
||||
}
|
||||
if ((integer)llList2String(data, 8))
|
||||
{
|
||||
Readout_Say("SELECT " + llList2String(data, 8));
|
||||
}
|
||||
if ((integer)llList2String(data, 9) != 2)
|
||||
{
|
||||
Readout_Say("AMENU " + llList2String(data, 9));
|
||||
}
|
||||
if ((integer)llList2String(data, 10))
|
||||
{
|
||||
Readout_Say("HELPER " + llList2String(data, 10));
|
||||
}
|
||||
}
|
||||
Readout_Say("");
|
||||
if (llGetListLength(SITTERS) > 1 || llList2String(data, 5) != "")
|
||||
{
|
||||
string SITTER_TEXT;
|
||||
if (llList2String(data, 5))
|
||||
{
|
||||
SITTER_TEXT = "|" + strReplace(llList2String(data, 5), "<22>", "|");
|
||||
}
|
||||
Readout_Say("SITTER " + (string)id + SITTER_TEXT);
|
||||
Readout_Say("");
|
||||
}
|
||||
return;
|
||||
}
|
||||
else if (llGetSubString(msg, 0, 0) == "{")
|
||||
{
|
||||
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;
|
||||
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;
|
||||
}
|
||||
else if (llGetSubString(msg, 1, 1) == ":")
|
||||
{
|
||||
msg = strReplace(msg, "S:P:", "POSE ");
|
||||
msg = strReplace(msg, "S:M:", "MENU ");
|
||||
msg = strReplace(msg, "S:T:", "TOMENU ");
|
||||
if (llGetSubString(msg, -6, -1) == "|90210")
|
||||
{
|
||||
msg = strReplace(msg, "S:B:", "SEQUENCE ");
|
||||
msg = strReplace(msg, "|90210", "");
|
||||
}
|
||||
else
|
||||
{
|
||||
msg = strReplace(msg, "S:B:", "BUTTON ");
|
||||
if (!~llSubStringIndex(msg, "<22>"))
|
||||
{
|
||||
msg = strReplace(msg, "|90200", "");
|
||||
}
|
||||
}
|
||||
msg = strReplace(msg, "S:", "SYNC ");
|
||||
msg = strReplace(msg, "<22>", "|");
|
||||
}
|
||||
if (llGetSubString(msg, -1, -1) == "*")
|
||||
{
|
||||
msg = llGetSubString(msg, 0, -2);
|
||||
}
|
||||
if (llGetSubString(msg, -1, -1) == "|")
|
||||
{
|
||||
msg = llGetSubString(msg, 0, -2);
|
||||
}
|
||||
if (llGetSubString(msg, 0, 3) == "MENU")
|
||||
{
|
||||
Readout_Say("");
|
||||
}
|
||||
Readout_Say(msg);
|
||||
}
|
||||
else if (num == 90100 || num == 90101)
|
||||
{
|
||||
if (llList2String(data, 1) == "[DUMP]")
|
||||
{
|
||||
if (id != llGetOwner())
|
||||
{
|
||||
llRegionSayTo(id, 0, "Dumping settings to Owner");
|
||||
}
|
||||
llMessageLinked(LINK_THIS, 90020, "0", "");
|
||||
}
|
||||
else if (llList2String(data, 1) == "[NEW]")
|
||||
{
|
||||
controller = (key)llList2String(data, 2);
|
||||
active_sitter = (integer)llList2String(data, 0);
|
||||
adding = "";
|
||||
new_menu();
|
||||
}
|
||||
else if (llList2String(data, 1) == "[SAVE]")
|
||||
{
|
||||
integer i;
|
||||
for (i = 0; i < llGetListLength(SITTERS); i++)
|
||||
{
|
||||
if (llList2String(SITTER_POSES, i))
|
||||
{
|
||||
string type = "SYNC";
|
||||
string temp_pose_name = llList2String(SITTER_POSES, i);
|
||||
if (!llSubStringIndex(llList2String(SITTER_POSES, i), "P:"))
|
||||
{
|
||||
type = "POSE";
|
||||
temp_pose_name = llGetSubString(temp_pose_name, 2, -1);
|
||||
}
|
||||
llMessageLinked(LINK_THIS, 90301, (string)i, llList2String(SITTER_POSES, i) + "|" + llList2String(POS_LIST, i) + "|" + llList2String(ROT_LIST, i) + "|");
|
||||
vector pos = llList2Vector(POS_LIST, i);
|
||||
vector rot = llList2Vector(ROT_LIST, i);
|
||||
llSay(0, type + " Saved to memory " + sitter_text(i) + ": {" + temp_pose_name + "}" + llList2String(POS_LIST, i) + llList2String(ROT_LIST, i));
|
||||
}
|
||||
}
|
||||
llMessageLinked(LINK_THIS, 90005, "", llDumpList2String([llList2String(data, 2), id], "|"));
|
||||
}
|
||||
else if (llList2String(data, 1) == "[HELPER]")
|
||||
{
|
||||
controller = id;
|
||||
OLD_HELPER_METHOD = (integer)llList2String(data, 3);
|
||||
toggle_helper_mode();
|
||||
}
|
||||
else if (llList2String(data, 1) == "[ADJUST]")
|
||||
{
|
||||
end_helper_mode();
|
||||
}
|
||||
}
|
||||
else if (num == 90055 || num == 90056)
|
||||
{
|
||||
data = llParseStringKeepNulls(id, ["|"], []);
|
||||
SITTER_POSES = llListReplaceList(SITTER_POSES, [llList2String(data, 0)], one, one);
|
||||
POS_LIST = llListReplaceList(POS_LIST, [(vector)llList2String(data, 2)], one, one);
|
||||
ROT_LIST = llListReplaceList(ROT_LIST, [(vector)llList2String(data, 3)], one, one);
|
||||
if (helper_mode)
|
||||
{
|
||||
llRegionSay(comm_channel, "POS|" + (string)one + "|" + convert_to_world_positions(one) + "|" + (string)OLD_HELPER_METHOD + "|" + llList2String(SITTERS, one));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
changed(integer change)
|
||||
{
|
||||
if (change & CHANGED_LINK)
|
||||
{
|
||||
if (OLD_HELPER_METHOD)
|
||||
{
|
||||
if (llGetAgentSize(llGetLinkKey(llGetNumberOfPrims())))
|
||||
{
|
||||
end_helper_mode();
|
||||
}
|
||||
}
|
||||
else if (llGetListLength(SITTERS) == 1 && llAvatarOnSitTarget() == NULL_KEY || llGetAgentSize(llGetLinkKey(llGetNumberOfPrims())) == ZERO_VECTOR)
|
||||
{
|
||||
end_helper_mode();
|
||||
}
|
||||
}
|
||||
if (change & CHANGED_INVENTORY)
|
||||
{
|
||||
unsit_all();
|
||||
end_helper_mode();
|
||||
llResetScript();
|
||||
}
|
||||
}
|
||||
run_time_permissions(integer perm)
|
||||
{
|
||||
if (llGetPermissions() & PERMISSION_TRACK_CAMERA)
|
||||
{
|
||||
llPlaySound("3d09f582-3851-c0e0-f5ba-277ac5c73fb4", 1.);
|
||||
vector eye = (llGetCameraPos() - llGetPos()) / llGetRot();
|
||||
vector at = eye + llRot2Fwd(llGetCameraRot() / llGetRot());
|
||||
if (llGetInventoryType(camera_script) == INVENTORY_SCRIPT)
|
||||
{
|
||||
llMessageLinked(LINK_THIS, 90174, (string)active_sitter, (string)eye + "|" + (string)at);
|
||||
}
|
||||
else
|
||||
{
|
||||
llMessageLinked(LINK_THIS, 90011, (string)eye, (string)at);
|
||||
llSay(0, "Camera property saved for all sitters in prim (takes effect next sit).");
|
||||
}
|
||||
camera_menu();
|
||||
}
|
||||
}
|
||||
listen(integer chan, string name, key id, string msg)
|
||||
{
|
||||
if (chan == chat_channel)
|
||||
{
|
||||
if (msg == "cleanup")
|
||||
{
|
||||
llRegionSay(comm_channel, "DONEA");
|
||||
Out("Cleaning \"" + llGetScriptName() + "\" and \"" + helper_name + "\" from prim " + (string)llGetLinkNumber());
|
||||
if (llGetInventoryType(helper_name) == INVENTORY_OBJECT)
|
||||
{
|
||||
llRemoveInventory(helper_name);
|
||||
}
|
||||
llRemoveInventory(llGetScriptName());
|
||||
}
|
||||
else if (msg == "targets")
|
||||
{
|
||||
llMessageLinked(LINK_THIS, 90298, "", "");
|
||||
}
|
||||
else if (msg == "helper")
|
||||
{
|
||||
if (llGetAgentSize(llGetLinkKey(llGetNumberOfPrims())) != ZERO_VECTOR)
|
||||
{
|
||||
llMessageLinked(LINK_SET, 90100, "0|[HELPER]||" + (string)OLD_HELPER_METHOD, llList2Key(SITTERS, 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (id == controller)
|
||||
{
|
||||
if (msg == "[>>]")
|
||||
{
|
||||
menu_page++;
|
||||
if (menu_page >= menu_pages)
|
||||
{
|
||||
menu_page = 0;
|
||||
}
|
||||
choice_menu(get_choices(), last_text);
|
||||
}
|
||||
else if (msg == "[<<]")
|
||||
{
|
||||
menu_page--;
|
||||
if (menu_page < 0)
|
||||
{
|
||||
menu_page = menu_pages - 1;
|
||||
}
|
||||
choice_menu(get_choices(), last_text);
|
||||
}
|
||||
else if (msg == "[BACK]")
|
||||
{
|
||||
llMessageLinked(LINK_THIS, 90005, "", llDumpList2String([controller, llList2String(SITTERS, active_sitter)], "|"));
|
||||
}
|
||||
else if (msg == "[POSE]" || msg == "[SYNC]")
|
||||
{
|
||||
adding = msg;
|
||||
chosen_animations = [];
|
||||
sitter_count = active_sitter;
|
||||
end_count = sitter_count;
|
||||
if (msg == "[SYNC]")
|
||||
{
|
||||
sitter_count = 0;
|
||||
end_count = llGetListLength(SITTERS) - 1;
|
||||
}
|
||||
ask_anim();
|
||||
}
|
||||
else if (msg == "[SUBMENU]")
|
||||
{
|
||||
adding = msg;
|
||||
llTextBox(controller, "\n\nName your submenu:", comm_channel);
|
||||
}
|
||||
else if (msg == "[PROP]")
|
||||
{
|
||||
if (llGetInventoryType(prop_script) == INVENTORY_SCRIPT)
|
||||
{
|
||||
adding = msg;
|
||||
choice_menu(get_choices(), "Choose your prop:");
|
||||
}
|
||||
else
|
||||
{
|
||||
llSay(0, "For this you need the " + prop_script + " plugin script.");
|
||||
llMessageLinked(LINK_THIS, 90005, "", llDumpList2String([controller, llList2String(SITTERS, active_sitter)], "|"));
|
||||
}
|
||||
}
|
||||
else if (msg == "[FACE]")
|
||||
{
|
||||
if (llGetInventoryType(expression_script) == INVENTORY_SCRIPT)
|
||||
{
|
||||
adding = msg;
|
||||
choice_menu(get_choices(), "Choose your facial anim:");
|
||||
}
|
||||
else
|
||||
{
|
||||
llSay(0, "For this you need the " + expression_script + " plugin script.");
|
||||
llMessageLinked(LINK_THIS, 90005, "", llDumpList2String([controller, llList2String(SITTERS, active_sitter)], "|"));
|
||||
}
|
||||
}
|
||||
else if (msg == "[CAMERA]")
|
||||
{
|
||||
camera_menu();
|
||||
}
|
||||
else if (msg == "[CLEAR]")
|
||||
{
|
||||
integer i;
|
||||
for (i = 0; i < llGetNumberOfPrims(); i++)
|
||||
{
|
||||
llSetLinkCamera(i, ZERO_VECTOR, ZERO_VECTOR);
|
||||
}
|
||||
if (llGetInventoryType(camera_script) == INVENTORY_SCRIPT)
|
||||
{
|
||||
llMessageLinked(LINK_THIS, 90174, (string)active_sitter, "none");
|
||||
}
|
||||
else
|
||||
{
|
||||
llSay(0, "Camera property cleared from all prims (takes effect next sit).");
|
||||
}
|
||||
camera_menu();
|
||||
}
|
||||
else if (msg == "[SAVE]")
|
||||
{
|
||||
llRequestPermissions(id, PERMISSION_TRACK_CAMERA);
|
||||
}
|
||||
else if ((~llListFindList(["[DONE]", "1", "2", "3", "4", "5", "6", "7", "8", "9"], [msg])) && (~llListFindList(["[POSE]", "[SYNC]", "[SYNC]2", "[PROP]", "[FACE]"], [adding])))
|
||||
{
|
||||
string choice = llList2String(get_choices(), (integer)msg - 1);
|
||||
if (adding == "[PROP]")
|
||||
{
|
||||
integer perms = llGetInventoryPermMask(choice, MASK_NEXT);
|
||||
if (!(perms & PERM_COPY))
|
||||
{
|
||||
llSay(0, "Could not add prop '" + choice + "'. Props and their content must be COPY-OK for NEXT owner.");
|
||||
}
|
||||
else
|
||||
{
|
||||
llMessageLinked(LINK_THIS, 90171, (string)active_sitter, choice);
|
||||
}
|
||||
llMessageLinked(LINK_THIS, 90005, "", llDumpList2String([controller, llList2String(SITTERS, active_sitter)], "|"));
|
||||
}
|
||||
else if (adding == "[FACE]")
|
||||
{
|
||||
llMessageLinked(LINK_THIS, 90172, (string)active_sitter, choice);
|
||||
llMessageLinked(LINK_THIS, 90005, "", llDumpList2String([controller, llList2String(SITTERS, active_sitter)], "|"));
|
||||
}
|
||||
else if (msg == "[DONE]")
|
||||
{
|
||||
done_choosing_anims();
|
||||
}
|
||||
else if (adding == "[SYNC]" || adding == "[POSE]")
|
||||
{
|
||||
chosen_animations += choice;
|
||||
preview_anim(choice, llList2Key(SITTERS, sitter_count));
|
||||
sitter_count++;
|
||||
if (sitter_count > end_count)
|
||||
{
|
||||
done_choosing_anims();
|
||||
}
|
||||
else
|
||||
{
|
||||
ask_anim();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
msg = strReplace(msg, "\n", "");
|
||||
msg = strReplace(msg, "|", "");
|
||||
msg = llGetSubString(msg, 0, 22);
|
||||
if (msg == "")
|
||||
{
|
||||
llMessageLinked(LINK_THIS, 90005, "", llDumpList2String([controller, llList2String(SITTERS, active_sitter)], "|"));
|
||||
}
|
||||
else if (adding == "[SUBMENU]")
|
||||
{
|
||||
llMessageLinked(LINK_THIS, 90300, (string)active_sitter, "T:" + msg + "*" + "||");
|
||||
llMessageLinked(LINK_THIS, 90300, (string)active_sitter, "M:" + msg + "*" + "||");
|
||||
llSay(0, "MENU Added: '" + msg + "'" + sitter_text(active_sitter));
|
||||
llMessageLinked(LINK_THIS, 90005, "", llDumpList2String([controller, llList2String(SITTERS, active_sitter)], "|"));
|
||||
}
|
||||
else if (adding == "[POSE]2" || adding == "[SYNC]2")
|
||||
{
|
||||
integer start = 0;
|
||||
integer end = llGetListLength(chosen_animations);
|
||||
string type = "SYNC";
|
||||
string prefix;
|
||||
if (adding == "[POSE]2")
|
||||
{
|
||||
prefix = "P:";
|
||||
type = "POSE";
|
||||
start = active_sitter;
|
||||
end = active_sitter + 1;
|
||||
}
|
||||
integer x;
|
||||
integer i;
|
||||
for (i = start; i < end; i++)
|
||||
{
|
||||
llSay(0, type + " Added: '" + msg + "' using anim '" + llList2String(chosen_animations, x) + "' to SITTER " + (string)i);
|
||||
llMessageLinked(LINK_THIS, 90300, (string)i, prefix + msg + "|" + llList2String(chosen_animations, x) + "|" + llList2String(POS_LIST, i) + "|" + llList2String(ROT_LIST, i));
|
||||
x++;
|
||||
}
|
||||
}
|
||||
if (msg != "" && (adding == "[POSE]2" || adding == "[SYNC]2"))
|
||||
{
|
||||
llMessageLinked(LINK_THIS, 90005, "", llDumpList2String([controller, llList2String(SITTERS, active_sitter)], "|"));
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (llGetOwnerKey(id) == llGetOwner())
|
||||
{
|
||||
list data = llParseString2List(msg, ["|"], []);
|
||||
integer num = (integer)llList2String(data, 1);
|
||||
if (llList2String(data, 0) == "REG")
|
||||
{
|
||||
HELPER_KEY_LIST = llListReplaceList(HELPER_KEY_LIST, [id], num, num);
|
||||
llRegionSay(comm_channel, "POS|" + (string)num + "|" + convert_to_world_positions(num) + "|" + (string)OLD_HELPER_METHOD + "|" + llList2String(SITTERS, num));
|
||||
}
|
||||
else if (llList2String(data, 0) == "MENU")
|
||||
{
|
||||
if (llList2String(data, 1) == controller)
|
||||
{
|
||||
llMessageLinked(LINK_SET, 90005, "", llDumpList2String([controller, llList2String(SITTERS, num)], "|"));
|
||||
}
|
||||
}
|
||||
else if (llList2String(data, 0) == "MOVED")
|
||||
{
|
||||
list myprim = llGetObjectDetails(llGetLinkKey(llGetLinkNumber()), [OBJECT_POS, OBJECT_ROT]);
|
||||
rotation f = llList2Rot(myprim, 1);
|
||||
vector target_rot = llRot2Euler((rotation)llList2String(data, 3) / f) * RAD_TO_DEG;
|
||||
vector target_pos = ((vector)llList2String(data, 2) - llList2Vector(myprim, 0)) / f;
|
||||
if ((string)target_pos != (string)llList2Vector(POS_LIST, num) || (string)target_rot != (string)llList2Vector(ROT_LIST, num))
|
||||
{
|
||||
POS_LIST = llListReplaceList(POS_LIST, [target_pos], num, num);
|
||||
ROT_LIST = llListReplaceList(ROT_LIST, [target_rot], num, num);
|
||||
llMessageLinked(LINK_THIS, 90057, (string)num, (string)target_pos + "|" + (string)target_rot);
|
||||
}
|
||||
}
|
||||
else if (OLD_HELPER_METHOD)
|
||||
{
|
||||
integer sitter = (integer)llGetSubString(name, llSubStringIndex(name, " ") + 1, -1);
|
||||
if (llList2String(data, 0) == "ANIMA")
|
||||
{
|
||||
llMessageLinked(LINK_THIS, 90075, (string)sitter, llList2Key(data, 1));
|
||||
}
|
||||
else if (llList2String(data, 0) == "GETUP")
|
||||
{
|
||||
llMessageLinked(LINK_THIS, 90076, (string)sitter, llList2Key(data, 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
on_rez(integer x)
|
||||
{
|
||||
llResetScript();
|
||||
}
|
||||
}
|
272
AVsitter2/[AV]helper.lsl
Normal file
272
AVsitter2/[AV]helper.lsl
Normal file
|
@ -0,0 +1,272 @@
|
|||
/*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* Copyright (c) the AVsitter Contributors (http://avsitter.github.io)
|
||||
* AVsitter™ is a trademark. For trademark use policy see:
|
||||
* https://avsitter.github.io/TRADEMARK.mediawiki
|
||||
*
|
||||
* Please consider supporting continued development of AVsitter and
|
||||
* receive automatic updates and other benefits! All details and user
|
||||
* instructions can be found at http://avsitter.github.io
|
||||
*/
|
||||
|
||||
string registration_product = "AVsitter2";
|
||||
string product = "AVhelper";
|
||||
string version = "2.2";
|
||||
integer OLD_HELPER_METHOD;
|
||||
list colors = [<1,0.5,1>, <0.5,0.5,1>, <1,0.5,0.5>, <0.5,1,0.5>, <1,1,0.5>, <0.5,1,1>];
|
||||
integer helper_index;
|
||||
float alpha;
|
||||
integer sitter_number;
|
||||
key CURRENT_AV;
|
||||
integer comm_channel;
|
||||
string base_object_name = "[AV]helper";
|
||||
vector ball_size = <0.2,0.2,0.2>;
|
||||
vector default_size = <0.12,0.12,3.5>;
|
||||
key key_request;
|
||||
vector my_pos;
|
||||
rotation my_rot;
|
||||
stop_all_anims()
|
||||
{
|
||||
if (llAvatarOnSitTarget())
|
||||
{
|
||||
if (llGetPermissions() & PERMISSION_TRIGGER_ANIMATION)
|
||||
{
|
||||
if (llGetAgentSize(llGetPermissionsKey()))
|
||||
{
|
||||
list anims = llGetAnimationList(llGetPermissionsKey());
|
||||
integer n;
|
||||
for (n = 0; n < llGetListLength(anims); n++)
|
||||
{
|
||||
llStopAnimation(llList2String(anims, n));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
set_text()
|
||||
{
|
||||
string text = "▽";
|
||||
integer i;
|
||||
string t = "SITTER";
|
||||
if (llGetStartParameter() < -1000000000)
|
||||
{
|
||||
t = "PRIM";
|
||||
}
|
||||
for (i = 0; i < sitter_number % 5; i++)
|
||||
{
|
||||
text += "\n \n ";
|
||||
}
|
||||
text = t + " " + (string)helper_index + "\n" + text;
|
||||
llSetLinkPrimitiveParamsFast(llGetLinkNumber(), [PRIM_TEXT, text, llList2Vector(colors, helper_index % llGetListLength(colors)), 1]);
|
||||
}
|
||||
setup()
|
||||
{
|
||||
alpha = llList2Float(llGetPrimitiveParams([PRIM_COLOR, 0]), 1);
|
||||
CURRENT_AV = "";
|
||||
vector size = default_size;
|
||||
if (llGetCreator() != llGetInventoryCreator(llGetScriptName()))
|
||||
{
|
||||
size = llGetScale();
|
||||
}
|
||||
integer i;
|
||||
for (i = 0; i < sitter_number; i++)
|
||||
{
|
||||
size -= <0.001,0.001,0.>;
|
||||
}
|
||||
set_text();
|
||||
llSetObjectName(base_object_name + " " + (string)helper_index);
|
||||
if (llGetCreator() == llGetInventoryCreator(llGetScriptName()))
|
||||
{
|
||||
llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_TYPE, PRIM_TYPE_BOX, PRIM_HOLE_DEFAULT, <0,1,0>, 0, ZERO_VECTOR, <1,1,0>, ZERO_VECTOR, PRIM_TEXTURE, ALL_SIDES, "5748decc-f629-461c-9a36-a35a221fe21f", <1,1,0>, ZERO_VECTOR, 0, PRIM_COLOR, ALL_SIDES, llList2Vector(colors, helper_index % llGetListLength(colors)), alpha, PRIM_COLOR, 1, <1,1,1>, alpha, PRIM_COLOR, 3, <1,1,1>, alpha, PRIM_SIZE, size]);
|
||||
}
|
||||
else
|
||||
{
|
||||
llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_COLOR, ALL_SIDES, llList2Vector(colors, helper_index % llGetListLength(colors)), alpha, PRIM_SIZE, size]);
|
||||
}
|
||||
llRegionSay(comm_channel, "REG|" + (string)sitter_number);
|
||||
}
|
||||
default
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
llSetText("", <1,1,1>, 1);
|
||||
llSetObjectName(base_object_name);
|
||||
if (llGetCreator() == llGetInventoryCreator(llGetScriptName()))
|
||||
{
|
||||
llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_TEXTURE, ALL_SIDES, "5748decc-f629-461c-9a36-a35a221fe21f", <1,1,0>, <0,0,0>, 0, PRIM_FULLBRIGHT, ALL_SIDES, TRUE, PRIM_COLOR, ALL_SIDES, llList2Vector(colors, 0), 0.7, PRIM_GLOW, ALL_SIDES, 0.]);
|
||||
}
|
||||
else
|
||||
{
|
||||
llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_TEXTURE, ALL_SIDES, "5748decc-f629-461c-9a36-a35a221fe21f", <1,1,0>, <0,0,0>, 0, PRIM_FULLBRIGHT, ALL_SIDES, TRUE]);
|
||||
}
|
||||
integer everyonePerms = llGetObjectPermMask(MASK_EVERYONE);
|
||||
if ((!(everyonePerms & PERM_MOVE)) && llGetOwner() == llGetInventoryCreator(llGetScriptName()))
|
||||
{
|
||||
llOwnerSay("WARNING! AVhelper should be set to 'Anyone Can Move'");
|
||||
}
|
||||
llSitTarget(-<0,0,0.35>, ZERO_ROTATION);
|
||||
llSetStatus(STATUS_PHANTOM, TRUE);
|
||||
}
|
||||
on_rez(integer start)
|
||||
{
|
||||
llResetTime();
|
||||
llSetClickAction(CLICK_ACTION_TOUCH);
|
||||
if (start == 0)
|
||||
{
|
||||
llSetTimerEvent(0);
|
||||
llSetText("", <1,1,1>, 1);
|
||||
if (llList2Key(llGetObjectDetails(llGetKey(), [OBJECT_CREATOR]), 0) == llGetInventoryCreator(llGetScriptName()))
|
||||
{
|
||||
llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_SIZE, ball_size]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
helper_index = start % 1000 * -1;
|
||||
sitter_number = helper_index;
|
||||
if (start < -1000000000)
|
||||
{
|
||||
helper_index = (sitter_number = 0);
|
||||
}
|
||||
comm_channel = llFloor(start / 1000) * 1000;
|
||||
llListen(5, "", "", "");
|
||||
llListen(comm_channel, "", "", "");
|
||||
setup();
|
||||
}
|
||||
}
|
||||
listen(integer chan, string name, key id, string msg)
|
||||
{
|
||||
if (chan == 5 && id == CURRENT_AV)
|
||||
{
|
||||
key av = (key)msg;
|
||||
if (av)
|
||||
{
|
||||
if (llGetAgentSize(av))
|
||||
{
|
||||
list avatar_location = llGetObjectDetails(av, [OBJECT_POS, OBJECT_ROT]);
|
||||
if (llVecMag(llGetPos() - llList2Vector(avatar_location, 0)) < 10)
|
||||
{
|
||||
llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_POSITION, llList2Vector(avatar_location, 0), PRIM_ROTATION, llList2Rot(avatar_location, 1)]);
|
||||
}
|
||||
else
|
||||
{
|
||||
llRegionSayTo(id, 0, "Avatar too far away.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
llRegionSayTo(id, 0, "Avatar not found nearby.");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (llGetOwnerKey(id) == llGetOwner())
|
||||
{
|
||||
list data = llParseString2List(msg, ["|"], []);
|
||||
if (llList2String(data, 0) == "DONE" && llList2Integer(data, 1) == sitter_number || llList2String(data, 0) == "DONEA")
|
||||
{
|
||||
if (OLD_HELPER_METHOD)
|
||||
{
|
||||
if (llAvatarOnSitTarget())
|
||||
{
|
||||
stop_all_anims();
|
||||
llRegionSay(comm_channel, "GETUP");
|
||||
}
|
||||
}
|
||||
llDie();
|
||||
}
|
||||
else if (llList2String(data, 0) == "SWAP")
|
||||
{
|
||||
integer one = (integer)llList2String(data, 1);
|
||||
integer two = (integer)llList2String(data, 2);
|
||||
if (sitter_number == one)
|
||||
{
|
||||
sitter_number = (helper_index = two);
|
||||
setup();
|
||||
}
|
||||
else if (sitter_number == two)
|
||||
{
|
||||
sitter_number = (helper_index = one);
|
||||
setup();
|
||||
}
|
||||
}
|
||||
else if (llList2Integer(data, 1) == sitter_number)
|
||||
{
|
||||
if (llList2String(data, 0) == "POS")
|
||||
{
|
||||
vector pos = (vector)llList2String(data, 2);
|
||||
rotation rot = (rotation)llList2String(data, 3);
|
||||
OLD_HELPER_METHOD = (integer)llList2String(data, 4);
|
||||
CURRENT_AV = (key)llList2String(data, 5);
|
||||
if (OLD_HELPER_METHOD)
|
||||
{
|
||||
llSetClickAction(CLICK_ACTION_SIT);
|
||||
}
|
||||
llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_POSITION, pos, PRIM_ROTATION, rot]);
|
||||
if (llGetPos() != pos)
|
||||
{
|
||||
llSetRegionPos(pos);
|
||||
}
|
||||
my_pos = llGetPos();
|
||||
my_rot = llGetRot();
|
||||
llSetTimerEvent(0.01);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
timer()
|
||||
{
|
||||
if (my_pos != llGetPos() || my_rot != llGetRot())
|
||||
{
|
||||
my_pos = llGetPos();
|
||||
my_rot = llGetRot();
|
||||
llRegionSay(comm_channel, "MOVED|" + (string)sitter_number + "|" + (string)my_pos + "|" + (string)my_rot);
|
||||
}
|
||||
else if (llGetTime() > 86400) // auto-remove helper after 1 day
|
||||
{
|
||||
llDie();
|
||||
}
|
||||
}
|
||||
changed(integer change)
|
||||
{
|
||||
if (change & CHANGED_LINK)
|
||||
{
|
||||
key av = llAvatarOnSitTarget();
|
||||
if (OLD_HELPER_METHOD)
|
||||
{
|
||||
if (av)
|
||||
{
|
||||
llRequestPermissions(av, PERMISSION_TRIGGER_ANIMATION);
|
||||
llRegionSay(comm_channel, "ANIMA|" + (string)av);
|
||||
}
|
||||
else
|
||||
{
|
||||
stop_all_anims();
|
||||
llRegionSay(comm_channel, "GETUP");
|
||||
CURRENT_AV = "";
|
||||
}
|
||||
}
|
||||
else if (av)
|
||||
{
|
||||
llUnSit(av);
|
||||
llDialog(av, product + " " + version + "\n\nDo not sit on the helper with AVsitter2 unless you have enabled the old helper mode. Move the helper while sitting on the furniture. Please see instructions at http://avsitter.com", ["OK"], -68154283);
|
||||
}
|
||||
}
|
||||
}
|
||||
touch_start(integer total_number)
|
||||
{
|
||||
if (llGetStartParameter() != 0)
|
||||
{
|
||||
llRegionSay(comm_channel, "MENU|" + (string)llDetectedKey(0));
|
||||
}
|
||||
}
|
||||
run_time_permissions(integer perm)
|
||||
{
|
||||
if (perm & PERMISSION_TRIGGER_ANIMATION)
|
||||
{
|
||||
llStopAnimation("sit");
|
||||
}
|
||||
}
|
||||
}
|
215
AVsitter2/[AV]root-security.lsl
Normal file
215
AVsitter2/[AV]root-security.lsl
Normal file
|
@ -0,0 +1,215 @@
|
|||
/*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* Copyright (c) the AVsitter Contributors (http://avsitter.github.io)
|
||||
* AVsitter™ is a trademark. For trademark use policy see:
|
||||
* https://avsitter.github.io/TRADEMARK.mediawiki
|
||||
*
|
||||
* Please consider supporting continued development of AVsitter and
|
||||
* receive automatic updates and other benefits! All details and user
|
||||
* instructions can be found at http://avsitter.github.io
|
||||
*/
|
||||
|
||||
string product = "AVsitter™ Security 2.2";
|
||||
string script_basename = "[AV]sitA";
|
||||
string menucontrol_script = "[AV]root-control";
|
||||
string RLV_script = "[AV]root-RLV";
|
||||
key active_sitter;
|
||||
integer active_prim;
|
||||
integer active_script_channel;
|
||||
integer menu_channel;
|
||||
integer menu_handle;
|
||||
list SIT_TYPES = ["ALL", "OWNER", "GROUP"];
|
||||
list MENU_TYPES = ["ALL", "OWNER", "GROUP"];
|
||||
integer SIT_INDEX;
|
||||
integer MENU_INDEX;
|
||||
string lastmenu;
|
||||
integer pass_security(key id, string context)
|
||||
{
|
||||
integer ALLOWED = FALSE;
|
||||
string TYPE = llList2String(SIT_TYPES, SIT_INDEX);
|
||||
if (context == "MENU")
|
||||
{
|
||||
TYPE = llList2String(MENU_TYPES, MENU_INDEX);
|
||||
}
|
||||
if (TYPE == "GROUP")
|
||||
{
|
||||
if (llSameGroup(id) == TRUE)
|
||||
{
|
||||
ALLOWED = TRUE;
|
||||
}
|
||||
}
|
||||
else if (id == llGetOwner() || TYPE == "ALL")
|
||||
{
|
||||
ALLOWED = TRUE;
|
||||
}
|
||||
return ALLOWED;
|
||||
}
|
||||
check_sitters()
|
||||
{
|
||||
integer i = llGetNumberOfPrims();
|
||||
while (llGetAgentSize(llGetLinkKey(i)) != ZERO_VECTOR)
|
||||
{
|
||||
key av = llGetLinkKey(i);
|
||||
if (pass_security(av, "SIT") == FALSE)
|
||||
{
|
||||
llUnSit(av);
|
||||
llDialog(av, product + "\n\nSorry, Sit access is set to: " + llList2String(SIT_TYPES, SIT_INDEX), [], -164289491);
|
||||
}
|
||||
i--;
|
||||
}
|
||||
}
|
||||
back_to_adjust(integer SCRIPT_CHANNEL, key sitter)
|
||||
{
|
||||
llMessageLinked(LINK_SET, 90101, (string)SCRIPT_CHANNEL + "|[ADJUST]", sitter);
|
||||
}
|
||||
list order_buttons(list menu_items)
|
||||
{
|
||||
return llList2List(menu_items, -3, -1) + llList2List(menu_items, -6, -4) + llList2List(menu_items, -9, -7) + llList2List(menu_items, -12, -10);
|
||||
}
|
||||
register_touch(key id, integer animation_menu_function, integer active_prim, integer giveFailedMessage)
|
||||
{
|
||||
if (pass_security(id, "MENU"))
|
||||
{
|
||||
if (llGetInventoryType(menucontrol_script) == INVENTORY_SCRIPT)
|
||||
{
|
||||
if (check_for_RLV())
|
||||
{
|
||||
llMessageLinked(LINK_THIS, 90012, (string)active_prim, id);
|
||||
}
|
||||
else
|
||||
{
|
||||
llMessageLinked(LINK_THIS, 90007, "", id);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
llMessageLinked(LINK_SET, 90005, (string)animation_menu_function, id);
|
||||
}
|
||||
}
|
||||
else if (giveFailedMessage)
|
||||
{
|
||||
llDialog(id, product + "\n\nSorry, Menu access is set to: " + llList2String(MENU_TYPES, MENU_INDEX), [], -164289491);
|
||||
}
|
||||
}
|
||||
main_menu()
|
||||
{
|
||||
dialog("Sit access: " + llList2String(SIT_TYPES, SIT_INDEX) + "\nMenu access: " + llList2String(MENU_TYPES, MENU_INDEX) + "\n\nChange security settings:", ["[BACK]", "Sit", "Menu"]);
|
||||
lastmenu = "";
|
||||
}
|
||||
dialog(string text, list menu_items)
|
||||
{
|
||||
llListenRemove(menu_handle);
|
||||
menu_handle = llListen(menu_channel = ((integer)llFrand(2147483646) + 1) * -1, "", llGetOwner(), "");
|
||||
llDialog(llGetOwner(), product + "\n\n" + text, order_buttons(menu_items), menu_channel);
|
||||
llSetTimerEvent(600);
|
||||
}
|
||||
integer check_for_RLV()
|
||||
{
|
||||
if (llGetInventoryType(RLV_script) == INVENTORY_SCRIPT)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
default
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
llMessageLinked(LINK_SET, 90202, (string)check_for_RLV(), "");
|
||||
}
|
||||
timer()
|
||||
{
|
||||
llSetTimerEvent(0);
|
||||
llListenRemove(menu_handle);
|
||||
}
|
||||
link_message(integer sender, integer num, string msg, key id)
|
||||
{
|
||||
if (num == 90201)
|
||||
{
|
||||
llMessageLinked(LINK_SET, 90202, (string)check_for_RLV(), "");
|
||||
}
|
||||
else if (num == 90006)
|
||||
{
|
||||
if (llGetInventoryType(menucontrol_script) != INVENTORY_SCRIPT)
|
||||
{
|
||||
register_touch(id, (integer)msg, sender, FALSE);
|
||||
}
|
||||
}
|
||||
else if (num == 90100)
|
||||
{
|
||||
list data = llParseString2List(msg, ["|"], []);
|
||||
if (llList2String(data, 1) == "[SECURITY]")
|
||||
{
|
||||
if (id == llGetOwner())
|
||||
{
|
||||
active_prim = sender;
|
||||
active_script_channel = (integer)llList2String(data, 0);
|
||||
active_sitter = (key)llList2String(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));
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (num == 90033)
|
||||
{
|
||||
llListenRemove(menu_handle);
|
||||
}
|
||||
}
|
||||
listen(integer listen_channel, string name, key id, string msg)
|
||||
{
|
||||
if (msg == "Sit")
|
||||
{
|
||||
dialog("Sit security:", SIT_TYPES);
|
||||
lastmenu = msg;
|
||||
return;
|
||||
}
|
||||
else if (msg == "Menu")
|
||||
{
|
||||
dialog("Menu security:", MENU_TYPES);
|
||||
lastmenu = msg;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (msg == "[BACK]")
|
||||
{
|
||||
llMessageLinked(LINK_SET, 90101, llDumpList2String([active_script_channel, "[ADJUST]", id], "|"), active_sitter);
|
||||
}
|
||||
else if (lastmenu == "Sit")
|
||||
{
|
||||
SIT_INDEX = llListFindList(SIT_TYPES, [msg]);
|
||||
main_menu();
|
||||
check_sitters();
|
||||
return;
|
||||
}
|
||||
else if (lastmenu == "Menu")
|
||||
{
|
||||
MENU_INDEX = llListFindList(MENU_TYPES, [msg]);
|
||||
main_menu();
|
||||
return;
|
||||
}
|
||||
}
|
||||
llListenRemove(menu_handle);
|
||||
}
|
||||
changed(integer change)
|
||||
{
|
||||
if (change & CHANGED_LINK)
|
||||
{
|
||||
check_sitters();
|
||||
}
|
||||
}
|
||||
touch_end(integer touched)
|
||||
{
|
||||
if (check_for_RLV() || llGetAgentSize(llGetLinkKey(llGetNumberOfPrims())) != ZERO_VECTOR)
|
||||
{
|
||||
register_touch(llDetectedKey(0), 0, llDetectedLinkNumber(0), TRUE);
|
||||
}
|
||||
}
|
||||
}
|
26
AVsitter2/[AV]root.lsl
Normal file
26
AVsitter2/[AV]root.lsl
Normal file
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* Copyright (c) the AVsitter Contributors (http://avsitter.github.io)
|
||||
* AVsitter™ is a trademark. For trademark use policy see:
|
||||
* https://avsitter.github.io/TRADEMARK.mediawiki
|
||||
*
|
||||
* Please consider supporting continued development of AVsitter and
|
||||
* receive automatic updates and other benefits! All details and user
|
||||
* instructions can be found at http://avsitter.github.io
|
||||
*/
|
||||
|
||||
string script_basename = "[AV]sitA";
|
||||
string menu_script = "[AV]menu";
|
||||
default
|
||||
{
|
||||
touch_end(integer touched)
|
||||
{
|
||||
if (llGetInventoryType(script_basename) != INVENTORY_SCRIPT && llGetInventoryType(menu_script) != INVENTORY_SCRIPT)
|
||||
{
|
||||
llMessageLinked(LINK_ALL_OTHERS, 90005, "", llDetectedKey(0));
|
||||
}
|
||||
}
|
||||
}
|
244
AVsitter2/[AV]select.lsl
Normal file
244
AVsitter2/[AV]select.lsl
Normal file
|
@ -0,0 +1,244 @@
|
|||
/*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* Copyright (c) the AVsitter Contributors (http://avsitter.github.io)
|
||||
* AVsitter™ is a trademark. For trademark use policy see:
|
||||
* https://avsitter.github.io/TRADEMARK.mediawiki
|
||||
*
|
||||
* Please consider supporting continued development of AVsitter and
|
||||
* receive automatic updates and other benefits! All details and user
|
||||
* instructions can be found at http://avsitter.github.io
|
||||
*/
|
||||
|
||||
string product = "AVsitter™ seat select";
|
||||
string version = "2.2";
|
||||
integer select_type;
|
||||
list BUTTONS;
|
||||
integer reading_notecard_section = -1;
|
||||
key notecard_key;
|
||||
key notecard_query;
|
||||
string notecard_name = "AVpos";
|
||||
string main_script = "[AV]sitA";
|
||||
string adjust_script = "[AV]adjuster";
|
||||
string helper_object = "[AV]helper";
|
||||
string CUSTOM_TEXT;
|
||||
list SITTERS;
|
||||
list SYNCS;
|
||||
integer menu_channel;
|
||||
integer menu_handle;
|
||||
integer menu_type;
|
||||
integer variable1;
|
||||
integer verbose = 0;
|
||||
Out(integer level, string out)
|
||||
{
|
||||
if (verbose >= level)
|
||||
{
|
||||
llOwnerSay(llGetScriptName() + "[" + version + "] " + out);
|
||||
}
|
||||
}
|
||||
string strReplace(string str, string search, string replace)
|
||||
{
|
||||
return llDumpList2String(llParseStringKeepNulls((str = "") + str, [search], []), replace);
|
||||
}
|
||||
list order_buttons(list buttons)
|
||||
{
|
||||
return llList2List(buttons, -3, -1) + llList2List(buttons, -6, -4) + llList2List(buttons, -9, -7) + llList2List(buttons, -12, -10);
|
||||
}
|
||||
menu(key av)
|
||||
{
|
||||
integer sitter_index = llListFindList(SITTERS, [av]);
|
||||
if (sitter_index != -1)
|
||||
{
|
||||
list menu_buttons;
|
||||
integer i;
|
||||
for (i = 0; i < llGetListLength(BUTTONS); i++)
|
||||
{
|
||||
string avname = llKey2Name(llList2Key(SITTERS, i));
|
||||
if ((!select_type) && llList2Integer(SYNCS, i) == FALSE || select_type == 2 && avname != "" && av != llList2Key(SITTERS, i))
|
||||
{
|
||||
menu_buttons += "⊘" + llGetSubString(strReplace(avname, " Resident", " "), 0, 11);
|
||||
}
|
||||
else
|
||||
{
|
||||
menu_buttons += llList2String(BUTTONS, i);
|
||||
}
|
||||
}
|
||||
while ((llGetListLength(menu_buttons) + 1) % 3)
|
||||
{
|
||||
menu_buttons += " ";
|
||||
}
|
||||
menu_buttons += "[ADJUST]";
|
||||
llListenControl(menu_handle, TRUE);
|
||||
llDialog(av, product + " " + version + "\n\n" + CUSTOM_TEXT + "[" + llList2String(BUTTONS, sitter_index) + "]", order_buttons(menu_buttons), menu_channel);
|
||||
}
|
||||
}
|
||||
integer get_number_of_scripts()
|
||||
{
|
||||
integer i = 1;
|
||||
while (llGetInventoryType(main_script + " " + (string)i) == INVENTORY_SCRIPT)
|
||||
{
|
||||
i++;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
default
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
menu_channel = ((integer)llFrand(2147483646) + 1) * -1;
|
||||
menu_handle = llListen(menu_channel, "", "", "");
|
||||
llListenControl(menu_handle, FALSE);
|
||||
integer i;
|
||||
for (i = 0; i < get_number_of_scripts(); i++)
|
||||
{
|
||||
SITTERS += NULL_KEY;
|
||||
SYNCS += FALSE;
|
||||
BUTTONS += "Sitter " + (string)i;
|
||||
}
|
||||
notecard_key = llGetInventoryKey(notecard_name);
|
||||
Out(0, "Loading...");
|
||||
notecard_query = llGetNotecardLine(notecard_name, variable1);
|
||||
}
|
||||
listen(integer listen_channel, string name, key id, string message)
|
||||
{
|
||||
integer av_index = llListFindList(SITTERS, [id]);
|
||||
integer button_index = llListFindList(BUTTONS, [message]);
|
||||
if (av_index != -1)
|
||||
{
|
||||
if (message == "[ADJUST]" || message == "[HELPER]")
|
||||
{
|
||||
llMessageLinked(LINK_SET, 90101, llDumpList2String(["X", message, id], "|"), id);
|
||||
}
|
||||
else if (llGetSubString(message, 0, 0) == "⊘" || ((!select_type) && llList2Integer(SYNCS, button_index) == FALSE && llList2Key(SITTERS, button_index) != NULL_KEY && llList2Key(SITTERS, button_index) != id))
|
||||
{
|
||||
menu(id);
|
||||
}
|
||||
else if (button_index != -1)
|
||||
{
|
||||
llMessageLinked(LINK_SET, 90030, (string)av_index, (string)button_index);
|
||||
}
|
||||
}
|
||||
}
|
||||
changed(integer change)
|
||||
{
|
||||
if (change & CHANGED_INVENTORY)
|
||||
{
|
||||
if (llGetInventoryKey(notecard_name) != notecard_key || get_number_of_scripts() != llGetListLength(SITTERS))
|
||||
{
|
||||
llResetScript();
|
||||
}
|
||||
}
|
||||
if (change & CHANGED_LINK)
|
||||
{
|
||||
if (llGetAgentSize(llGetLinkKey(llGetNumberOfPrims())) == ZERO_VECTOR)
|
||||
{
|
||||
llListenControl(menu_handle, FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
link_message(integer sender, integer num, string msg, key id)
|
||||
{
|
||||
if (sender == llGetLinkNumber())
|
||||
{
|
||||
if (num == 90055)
|
||||
{
|
||||
list data = llParseStringKeepNulls(id, ["|"], []);
|
||||
if (llGetSubString(llList2String(data, 0), 0, 1) != "P:")
|
||||
{
|
||||
SYNCS = llListReplaceList(SYNCS, [TRUE], (integer)msg, (integer)msg);
|
||||
}
|
||||
else
|
||||
{
|
||||
SYNCS = llListReplaceList(SYNCS, [FALSE], (integer)msg, (integer)msg);
|
||||
}
|
||||
}
|
||||
else if (num == 90065)
|
||||
{
|
||||
integer index = llListFindList(SITTERS, [id]);
|
||||
if (index != -1)
|
||||
{
|
||||
SITTERS = llListReplaceList(SITTERS, [NULL_KEY], index, index);
|
||||
}
|
||||
}
|
||||
else if (num == 90030)
|
||||
{
|
||||
SITTERS = llListReplaceList(SITTERS, [NULL_KEY], (integer)msg, (integer)msg);
|
||||
SITTERS = llListReplaceList(SITTERS, [NULL_KEY], (integer)((string)id), (integer)((string)id));
|
||||
}
|
||||
else if (num == 90070)
|
||||
{
|
||||
SITTERS = llListReplaceList(SITTERS, [id], (integer)msg, (integer)msg);
|
||||
}
|
||||
else if (num == 90009)
|
||||
{
|
||||
menu(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
dataserver(key query_id, string data)
|
||||
{
|
||||
if (query_id == notecard_query)
|
||||
{
|
||||
if (data == EOF)
|
||||
{
|
||||
integer i;
|
||||
Out(0, "Ready");
|
||||
}
|
||||
else
|
||||
{
|
||||
data = llGetSubString(data, llSubStringIndex(data, "◆") + 1, -1);
|
||||
data = llStringTrim(data, STRING_TRIM);
|
||||
string command = llGetSubString(data, 0, llSubStringIndex(data, " ") - 1);
|
||||
list parts = llParseString2List(llGetSubString(data, llSubStringIndex(data, " ") + 1, -1), [" | ", " |", "| ", "|"], []);
|
||||
string part0 = llList2String(parts, 0);
|
||||
if (command == "TEXT")
|
||||
{
|
||||
CUSTOM_TEXT = llDumpList2String(llParseStringKeepNulls(part0, ["\\n"], []), "\n") + "\n";
|
||||
}
|
||||
else if (command == "SITTER")
|
||||
{
|
||||
reading_notecard_section = (integer)part0;
|
||||
string button_text = llList2String(parts, 1);
|
||||
if (reading_notecard_section < llGetListLength(SITTERS))
|
||||
{
|
||||
if (button_text != "" && llListFindList(BUTTONS, [button_text]) == -1)
|
||||
{
|
||||
BUTTONS = llListReplaceList(BUTTONS, [button_text], reading_notecard_section, reading_notecard_section);
|
||||
reading_notecard_section = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (command == "MTYPE")
|
||||
{
|
||||
menu_type = (integer)part0;
|
||||
}
|
||||
else if (command == "SELECT")
|
||||
{
|
||||
select_type = (integer)part0;
|
||||
}
|
||||
else if (command == "POSE" || command == "SYNC")
|
||||
{
|
||||
if (reading_notecard_section < llGetListLength(SITTERS) && reading_notecard_section != -1)
|
||||
{
|
||||
if (llList2String(BUTTONS, reading_notecard_section) == "Sitter " + (string)reading_notecard_section)
|
||||
{
|
||||
part0 = llGetSubString(part0, 0, 22);
|
||||
if (llListFindList(BUTTONS, [part0]) == -1)
|
||||
{
|
||||
BUTTONS = llListReplaceList(BUTTONS, [part0], reading_notecard_section, reading_notecard_section);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
BUTTONS = llListReplaceList(BUTTONS, ["Sitter " + (string)reading_notecard_section], reading_notecard_section, reading_notecard_section);
|
||||
reading_notecard_section = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
notecard_query = llGetNotecardLine(notecard_name, variable1 += 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
1203
AVsitter2/[AV]sitA.lsl
Normal file
1203
AVsitter2/[AV]sitA.lsl
Normal file
File diff suppressed because it is too large
Load diff
611
AVsitter2/[AV]sitB.lsl
Normal file
611
AVsitter2/[AV]sitB.lsl
Normal file
|
@ -0,0 +1,611 @@
|
|||
/*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* Copyright (c) the AVsitter Contributors (http://avsitter.github.io)
|
||||
* AVsitter™ is a trademark. For trademark use policy see:
|
||||
* https://avsitter.github.io/TRADEMARK.mediawiki
|
||||
*
|
||||
* Please consider supporting continued development of AVsitter and
|
||||
* receive automatic updates and other benefits! All details and user
|
||||
* instructions can be found at http://avsitter.github.io
|
||||
*/
|
||||
|
||||
string product = "AVsitter™";
|
||||
string version = "2.2";
|
||||
string BRAND;
|
||||
integer OLD_HELPER_METHOD;
|
||||
string main_script = "[AV]sitA";
|
||||
string select_script = "[AV]select";
|
||||
integer SET;
|
||||
integer ETYPE;
|
||||
integer MTYPE;
|
||||
integer SWAP;
|
||||
integer AMENU;
|
||||
integer SELECT;
|
||||
integer SCRIPT_CHANNEL;
|
||||
integer number_of_sitters;
|
||||
string CUSTOM_TEXT;
|
||||
string ADJUST_MENU;
|
||||
string SITTER_INFO;
|
||||
list MENU_LIST;
|
||||
list DATA_LIST;
|
||||
list POS_ROT_LIST;
|
||||
integer helper_mode;
|
||||
integer has_RLV;
|
||||
integer ANIM_INDEX;
|
||||
integer FIRST_INDEX = -1;
|
||||
integer menu_handle;
|
||||
integer menu_channel;
|
||||
integer current_menu = -1;
|
||||
integer last_menu;
|
||||
string submenu_info;
|
||||
integer menu_page;
|
||||
key MY_SITTER;
|
||||
key CONTROLLER;
|
||||
string RLVDesignations;
|
||||
string onSit;
|
||||
integer speed_index;
|
||||
integer verbose = 0;
|
||||
Out(integer level, string out)
|
||||
{
|
||||
if (verbose >= level)
|
||||
{
|
||||
llOwnerSay(llGetScriptName() + "[" + version + "]:" + out);
|
||||
}
|
||||
}
|
||||
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], "|"));
|
||||
}
|
||||
Readout_Say(string say)
|
||||
{
|
||||
llMessageLinked(LINK_THIS, 90022, say, (string)SCRIPT_CHANNEL);
|
||||
}
|
||||
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)(MENU_LIST != []) + " Items Ready, Mem=" + (string)(65536 - llGetUsedMemory()));
|
||||
}
|
||||
integer animation_menu(integer animation_menu_function)
|
||||
{
|
||||
if (animation_menu_function == -1 || (MENU_LIST != []) < 2 && (!helper_mode) && llGetInventoryType(select_script) == INVENTORY_SCRIPT)
|
||||
{
|
||||
llMessageLinked(LINK_SET, 90009, CONTROLLER, MY_SITTER);
|
||||
}
|
||||
else
|
||||
{
|
||||
string menu = product + version;
|
||||
if (BRAND)
|
||||
menu = BRAND;
|
||||
if (CONTROLLER != MY_SITTER || has_RLV)
|
||||
{
|
||||
menu += "\n\nMenu for " + llKey2Name(MY_SITTER);
|
||||
}
|
||||
menu += "\n\n";
|
||||
if (CUSTOM_TEXT)
|
||||
{
|
||||
menu += CUSTOM_TEXT + "\n";
|
||||
}
|
||||
if (SITTER_INFO)
|
||||
{
|
||||
menu += "[" + llList2String(llParseStringKeepNulls(SITTER_INFO, ["<22>"], []), 0) + "]";
|
||||
}
|
||||
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), ["<22>"], []), 0);
|
||||
if (llGetInventoryType(animation_file + "+") == INVENTORY_ANIMATION)
|
||||
{
|
||||
anim_has_speeds = TRUE;
|
||||
}
|
||||
string CURRENT_POSE_NAME;
|
||||
if (~FIRST_INDEX)
|
||||
{
|
||||
CURRENT_POSE_NAME = llList2String(MENU_LIST, ANIM_INDEX);
|
||||
menu += " [" + llList2String(llParseString2List(CURRENT_POSE_NAME, ["P:"], []), 0);
|
||||
if (anim_has_speeds)
|
||||
{
|
||||
if (speed_index < 0)
|
||||
{
|
||||
menu += ", Soft";
|
||||
}
|
||||
else if (speed_index > 0)
|
||||
{
|
||||
menu += ", Hard";
|
||||
}
|
||||
}
|
||||
menu += "]";
|
||||
}
|
||||
integer total_items;
|
||||
integer i = current_menu + 1;
|
||||
while (i++ < (MENU_LIST != []) && llSubStringIndex(llList2String(MENU_LIST, i), "M:"))
|
||||
{
|
||||
++total_items;
|
||||
}
|
||||
list menu_items0;
|
||||
list menu_items2;
|
||||
if ((~current_menu) || llGetInventoryType(select_script) == INVENTORY_SCRIPT)
|
||||
{
|
||||
menu_items0 += "[BACK]";
|
||||
}
|
||||
string submenu_info;
|
||||
if (~current_menu)
|
||||
{
|
||||
submenu_info = llList2String(DATA_LIST, current_menu);
|
||||
}
|
||||
if (helper_mode)
|
||||
{
|
||||
menu_items2 += "[NEW]";
|
||||
if (CURRENT_POSE_NAME)
|
||||
{
|
||||
menu_items2 += "[DUMP]";
|
||||
menu_items2 += "[SAVE]";
|
||||
}
|
||||
}
|
||||
else if (~llSubStringIndex(submenu_info, "V"))
|
||||
{
|
||||
menu_items0 += "<< Softer";
|
||||
menu_items0 += "Harder >>";
|
||||
}
|
||||
if (AMENU == 2 || (AMENU == 1 && (!~current_menu)) || (~llSubStringIndex(submenu_info, "A")))
|
||||
{
|
||||
if (!(OLD_HELPER_METHOD && helper_mode))
|
||||
{
|
||||
menu_items2 += "[ADJUST]";
|
||||
}
|
||||
}
|
||||
if (llSubStringIndex(onSit, "ASK") && ((!~current_menu) && SWAP == 1 || SWAP == 2 || (~llSubStringIndex(submenu_info, "S"))) && (number_of_sitters > 1 && (!(llGetInventoryType(select_script) == INVENTORY_SCRIPT))))
|
||||
{
|
||||
menu_items2 += "[SWAP]";
|
||||
}
|
||||
if (!~current_menu)
|
||||
{
|
||||
if (has_RLV && (llGetSubString(RLVDesignations, SCRIPT_CHANNEL, SCRIPT_CHANNEL) == "D" || CONTROLLER != MY_SITTER))
|
||||
{
|
||||
menu_items2 += "[STOP]";
|
||||
if (!helper_mode)
|
||||
{
|
||||
menu_items2 += ["Control..."];
|
||||
}
|
||||
}
|
||||
}
|
||||
integer items_per_page = 12 - (menu_items2 != []) - (menu_items0 != []);
|
||||
if (items_per_page < total_items)
|
||||
{
|
||||
menu_items2 += ["[<<]", "[>>]"];
|
||||
items_per_page -= 2;
|
||||
}
|
||||
list menu_items1;
|
||||
integer page_start = i = current_menu + 1 + menu_page * items_per_page;
|
||||
do
|
||||
{
|
||||
if (i < (MENU_LIST != []))
|
||||
{
|
||||
string m = llList2String(MENU_LIST, i);
|
||||
if (!llSubStringIndex(m, "M:"))
|
||||
{
|
||||
jump end;
|
||||
}
|
||||
if (!~llListFindList(["T:", "P:", "B:"], [llGetSubString(m, 0, 1)]))
|
||||
{
|
||||
menu_items1 += m;
|
||||
}
|
||||
else
|
||||
{
|
||||
menu_items1 += llGetSubString(m, 2, -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
while (++i < page_start + items_per_page);
|
||||
@end;
|
||||
if (animation_menu_function == 1)
|
||||
{
|
||||
integer pages = total_items / (12 - (menu_items2 != []) - (menu_items0 != []));
|
||||
if (!(total_items % (12 - (menu_items2 != []) - (menu_items0 != []))))
|
||||
{
|
||||
pages--;
|
||||
}
|
||||
return pages;
|
||||
}
|
||||
if (submenu_info == "V")
|
||||
{
|
||||
while ((menu_items1 != []) < items_per_page)
|
||||
{
|
||||
menu_items1 += " ";
|
||||
}
|
||||
}
|
||||
llListenRemove(menu_handle);
|
||||
menu_handle = llListen(menu_channel, "", CONTROLLER, "");
|
||||
llDialog(CONTROLLER, menu, order_buttons(menu_items0 + menu_items1 + menu_items2), menu_channel);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
default
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
memory();
|
||||
SCRIPT_CHANNEL = (integer)llGetSubString(llGetScriptName(), llSubStringIndex(llGetScriptName(), " "), -1);
|
||||
if (SCRIPT_CHANNEL)
|
||||
main_script += " " + (string)SCRIPT_CHANNEL;
|
||||
if (llGetInventoryType(main_script) == INVENTORY_SCRIPT)
|
||||
{
|
||||
llResetOtherScript(main_script);
|
||||
}
|
||||
}
|
||||
listen(integer listen_channel, string name, key id, string msg)
|
||||
{
|
||||
string channel;
|
||||
integer index = llListFindList(MENU_LIST, [msg]);
|
||||
if (!~index)
|
||||
{
|
||||
channel = (string)SCRIPT_CHANNEL;
|
||||
index = llListFindList(MENU_LIST, ["P:" + msg]);
|
||||
}
|
||||
if (~index)
|
||||
{
|
||||
llMessageLinked(LINK_THIS, 90050, (string)channel + "|" + msg + "|" + (string)SET, MY_SITTER);
|
||||
llMessageLinked(LINK_THIS, 90000, msg, channel);
|
||||
if (MTYPE != 2 && MTYPE != 4)
|
||||
{
|
||||
llMessageLinked(LINK_THIS, 90005, "", llDumpList2String([id, MY_SITTER], "|"));
|
||||
}
|
||||
return;
|
||||
}
|
||||
index = llListFindList(MENU_LIST, ["M:" + msg]);
|
||||
if (~index)
|
||||
{
|
||||
llMessageLinked(LINK_SET, 90051, (string)channel + "|" + llGetSubString(msg, 0, -2) + "|" + (string)SET, MY_SITTER);
|
||||
menu_page = 0;
|
||||
last_menu = current_menu;
|
||||
current_menu = index;
|
||||
animation_menu(0);
|
||||
return;
|
||||
}
|
||||
index = llListFindList(MENU_LIST, ["B:" + msg]);
|
||||
if (~index)
|
||||
{
|
||||
list button_data = llParseStringKeepNulls(llList2String(DATA_LIST, index), ["<22>"], []);
|
||||
if (llList2String(button_data, 1))
|
||||
{
|
||||
msg = llList2String(button_data, 1);
|
||||
}
|
||||
integer n = llList2Integer(button_data, 0);
|
||||
if (llGetListLength(button_data) > 2)
|
||||
{
|
||||
id = llList2String(button_data, 2);
|
||||
}
|
||||
else if (CONTROLLER != MY_SITTER)
|
||||
{
|
||||
id = llDumpList2String([CONTROLLER, MY_SITTER], "|");
|
||||
}
|
||||
llMessageLinked(LINK_SET, n, msg, id);
|
||||
return;
|
||||
}
|
||||
if (msg == "[>>]" || msg == "[<<]")
|
||||
{
|
||||
if (msg == "[<<]")
|
||||
{
|
||||
if (!~--menu_page)
|
||||
{
|
||||
menu_page = animation_menu(1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (++menu_page > animation_menu(1))
|
||||
{
|
||||
menu_page = 0;
|
||||
}
|
||||
}
|
||||
animation_menu(0);
|
||||
}
|
||||
else if (msg == "[BACK]")
|
||||
{
|
||||
menu_page = 0;
|
||||
if (!~current_menu)
|
||||
{
|
||||
if (llGetInventoryType(select_script) == INVENTORY_SCRIPT)
|
||||
{
|
||||
llMessageLinked(LINK_SET, 90009, "", id);
|
||||
}
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (~last_menu)
|
||||
{
|
||||
current_menu = last_menu;
|
||||
last_menu = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
current_menu = llListFindList(MENU_LIST, ["T:" + llGetSubString(llList2String(MENU_LIST, current_menu), 2, -1)]);
|
||||
if (~current_menu)
|
||||
{
|
||||
current_menu -= 1;
|
||||
while ((~current_menu) && llSubStringIndex(llList2String(MENU_LIST, current_menu), "M:") != 0)
|
||||
{
|
||||
current_menu--;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
animation_menu(0);
|
||||
}
|
||||
else if (msg == "Control..." || msg == "[STOP]")
|
||||
{
|
||||
llMessageLinked(LINK_SET, 90100, llDumpList2String([SCRIPT_CHANNEL, msg, MY_SITTER], "|"), id);
|
||||
}
|
||||
else if (!~index)
|
||||
{
|
||||
llMessageLinked(LINK_SET, 90101, llDumpList2String([SCRIPT_CHANNEL, msg, CONTROLLER], "|"), MY_SITTER);
|
||||
}
|
||||
}
|
||||
changed(integer change)
|
||||
{
|
||||
if (change & CHANGED_LINK)
|
||||
{
|
||||
if (llGetAgentSize(llGetLinkKey(llGetNumberOfPrims())) == ZERO_VECTOR)
|
||||
{
|
||||
speed_index = 0;
|
||||
if (!OLD_HELPER_METHOD)
|
||||
{
|
||||
helper_mode = FALSE;
|
||||
}
|
||||
MY_SITTER = "";
|
||||
ANIM_INDEX = FIRST_INDEX;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (OLD_HELPER_METHOD)
|
||||
{
|
||||
helper_mode = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
link_message(integer sender, integer num, string msg, key id)
|
||||
{
|
||||
integer one = (integer)msg;
|
||||
integer two = (integer)((string)id);
|
||||
if (num == 90000 || num == 90010 || num == 90003)
|
||||
{
|
||||
integer index = llListFindList(MENU_LIST, [msg]);
|
||||
if (!~index)
|
||||
{
|
||||
index = llListFindList(MENU_LIST, ["P:" + msg]);
|
||||
}
|
||||
integer doit;
|
||||
if (id == "")
|
||||
{
|
||||
doit = TRUE;
|
||||
}
|
||||
else if (id)
|
||||
{
|
||||
if (id == MY_SITTER)
|
||||
{
|
||||
doit = TRUE;
|
||||
}
|
||||
}
|
||||
else if (two == SCRIPT_CHANNEL)
|
||||
{
|
||||
doit = TRUE;
|
||||
}
|
||||
if (doit && ((~index) || msg == ""))
|
||||
{
|
||||
ANIM_INDEX = index;
|
||||
integer broadcast = TRUE;
|
||||
send_anim_info(broadcast);
|
||||
return;
|
||||
}
|
||||
if (ETYPE == 2)
|
||||
{
|
||||
if (num != 90010 && llGetSubString(llList2String(MENU_LIST, ANIM_INDEX), 0, 1) != "P:")
|
||||
{
|
||||
if (MY_SITTER != "")
|
||||
{
|
||||
llUnSit(MY_SITTER);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (num == 90045 && sender == llGetLinkNumber() && (ETYPE == 1 || ETYPE == 2))
|
||||
{
|
||||
list data = llParseStringKeepNulls(msg, ["|"], []);
|
||||
string OLD_SYNC = llList2String(data, 5);
|
||||
if (OLD_SYNC != "" && llList2String(MENU_LIST, ANIM_INDEX) == OLD_SYNC)
|
||||
{
|
||||
ANIM_INDEX = FIRST_INDEX;
|
||||
send_anim_info(TRUE);
|
||||
}
|
||||
}
|
||||
else if (num == 90033)
|
||||
{
|
||||
llListenRemove(menu_handle);
|
||||
}
|
||||
else if (num == 90004 || num == 90005)
|
||||
{
|
||||
list data = llParseStringKeepNulls(id, ["|"], []);
|
||||
if ((key)llList2String(data, -1) == MY_SITTER)
|
||||
{
|
||||
key lastController = CONTROLLER;
|
||||
CONTROLLER = (key)llList2String(data, 0);
|
||||
integer index = llListFindList(MENU_LIST, ["M:" + msg + "*"]);
|
||||
if (num == 90004)
|
||||
{
|
||||
current_menu = -1;
|
||||
}
|
||||
else if (~index)
|
||||
{
|
||||
last_menu = -1;
|
||||
menu_page = 0;
|
||||
current_menu = index;
|
||||
msg = "";
|
||||
}
|
||||
animation_menu((integer)msg);
|
||||
}
|
||||
}
|
||||
else if (num == 90030 && (one == SCRIPT_CHANNEL || two == SCRIPT_CHANNEL))
|
||||
{
|
||||
CONTROLLER = (MY_SITTER = "");
|
||||
}
|
||||
else if (num == 90100 || num == 90101)
|
||||
{
|
||||
list data = llParseStringKeepNulls(msg, ["|"], []);
|
||||
if (llList2String(data, 1) == "[HELPER]")
|
||||
{
|
||||
menu_page = 0;
|
||||
helper_mode = (!helper_mode);
|
||||
if ((key)llList2String(data, 2) == MY_SITTER && (!OLD_HELPER_METHOD))
|
||||
{
|
||||
animation_menu(0);
|
||||
}
|
||||
}
|
||||
else if (llList2String(data, 1) == "[ADJUST]")
|
||||
{
|
||||
helper_mode = FALSE;
|
||||
menu_page = 0;
|
||||
}
|
||||
else if (llList2String(data, 1) == "Harder >>")
|
||||
{
|
||||
++speed_index;
|
||||
if (speed_index > 1)
|
||||
speed_index = 1;
|
||||
send_anim_info(FALSE);
|
||||
}
|
||||
else if (llList2String(data, 1) == "<< Softer")
|
||||
{
|
||||
--speed_index;
|
||||
if (speed_index < -1)
|
||||
speed_index = -1;
|
||||
send_anim_info(FALSE);
|
||||
}
|
||||
}
|
||||
else if (num == 90201)
|
||||
{
|
||||
has_RLV = FALSE;
|
||||
}
|
||||
else if (num == 90202)
|
||||
{
|
||||
has_RLV = (integer)msg;
|
||||
}
|
||||
else if (one == SCRIPT_CHANNEL)
|
||||
{
|
||||
list data = llParseStringKeepNulls(id, ["|"], []);
|
||||
integer index = llListFindList(MENU_LIST, [llList2String(data, 0)]);
|
||||
if (!~index)
|
||||
{
|
||||
index = llListFindList(MENU_LIST, ["P:" + llList2String(data, 0)]);
|
||||
}
|
||||
if (num == 90299)
|
||||
{
|
||||
MENU_LIST = (DATA_LIST = (POS_ROT_LIST = []));
|
||||
}
|
||||
else if (num == 90070)
|
||||
{
|
||||
CONTROLLER = (MY_SITTER = id);
|
||||
menu_page = 0;
|
||||
current_menu = -1;
|
||||
menu_channel = ((integer)llFrand(2147483646) + 1) * -1;
|
||||
llListenRemove(menu_handle);
|
||||
}
|
||||
else if (num == 90065 && sender == llGetLinkNumber())
|
||||
{
|
||||
CONTROLLER = (MY_SITTER = "");
|
||||
llListenRemove(menu_handle);
|
||||
}
|
||||
else if (num == 90300)
|
||||
{
|
||||
integer place_to_add = llGetListLength(MENU_LIST);
|
||||
if (llGetListLength(data) > 2)
|
||||
{
|
||||
place_to_add = current_menu;
|
||||
while (place_to_add < llGetListLength(MENU_LIST) && llSubStringIndex(llList2String(MENU_LIST, place_to_add + 1), "M:"))
|
||||
{
|
||||
++place_to_add;
|
||||
}
|
||||
if (!llSubStringIndex(llList2String(MENU_LIST, place_to_add + 1), "M:"))
|
||||
{
|
||||
++place_to_add;
|
||||
}
|
||||
}
|
||||
MENU_LIST = llListInsertList(MENU_LIST, [llList2String(data, 0)], place_to_add);
|
||||
DATA_LIST = llListInsertList(DATA_LIST, [llList2String(data, 1)], place_to_add);
|
||||
POS_ROT_LIST = llListInsertList(POS_ROT_LIST, [0, 0], place_to_add * 2);
|
||||
if (llGetListLength(data) == 4)
|
||||
{
|
||||
if (!~FIRST_INDEX)
|
||||
{
|
||||
FIRST_INDEX = place_to_add;
|
||||
}
|
||||
if (~index)
|
||||
{
|
||||
place_to_add = index;
|
||||
}
|
||||
POS_ROT_LIST = llListReplaceList(POS_ROT_LIST, [(vector)llList2String(data, 2), (vector)llList2String(data, 3)], place_to_add * 2, place_to_add * 2 + 1);
|
||||
ANIM_INDEX = place_to_add;
|
||||
send_anim_info(TRUE);
|
||||
memory();
|
||||
}
|
||||
}
|
||||
else if (num == 90301)
|
||||
{
|
||||
if (~index)
|
||||
{
|
||||
POS_ROT_LIST = llListReplaceList(POS_ROT_LIST, [(vector)llList2String(data, 1), (vector)llList2String(data, 2)], index * 2, index * 2 + 1);
|
||||
if (llGetListLength(data) != 3)
|
||||
{
|
||||
send_anim_info(FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (num == 90302)
|
||||
{
|
||||
number_of_sitters = (integer)llList2String(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);
|
||||
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);
|
||||
RLVDesignations = llList2String(data, 13);
|
||||
onSit = llList2String(data, 14);
|
||||
memory();
|
||||
}
|
||||
else 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], "|"));
|
||||
integer i = -1;
|
||||
while (++i < (MENU_LIST != []))
|
||||
{
|
||||
llSleep(0.5);
|
||||
Readout_Say("S:" + llList2String(MENU_LIST, i) + "|" + llList2String(DATA_LIST, i));
|
||||
}
|
||||
i = -1;
|
||||
while (++i < (MENU_LIST != []))
|
||||
{
|
||||
if (llList2Vector(POS_ROT_LIST, i * 2))
|
||||
{
|
||||
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, 90021, (string)SCRIPT_CHANNEL, "");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
302
AVsitter2/avsitter2_link_message_reference.md
Normal file
302
AVsitter2/avsitter2_link_message_reference.md
Normal file
|
@ -0,0 +1,302 @@
|
|||
# AVsitter2™ Developer Link Message Reference
|
||||
|
||||
The following [link messages](http://wiki.secondlife.com/wiki/Link_message) are used in AVsitter2.
|
||||
|
||||
This list is not intended for the casual user. Public API info for general users can be found [here](https://avsitter.github.io/avsitter2.html).
|
||||
|
||||
This page may provide additional info if the purpose of a link message is not initially clear.
|
||||
|
||||
**AVsitter2 uses link messages in the range 90000-90500.**
|
||||
|
||||
### 90000
|
||||
Play an animation defined in AVpos notecard.
|
||||
|
||||
lMessageLinked(LINK_THIS,90000,<POSE_NAME>,<CUSTOM>);
|
||||
|
||||
Where for <CUSTOM>:
|
||||
"" = try to play the pose for all SITTERS.
|
||||
UUID = try to play the pose to avatar by UUID.
|
||||
integer = apply the pose to a sitter e.g. SITTER 0.
|
||||
|
||||
### 90001
|
||||
Play an overlay animation ([AV]adjuster, [AV]faces).
|
||||
|
||||
llMessageLinked(LINK_THIS,90001,<ANIMATION_FILE>,<AVATAR_UUID>);
|
||||
|
||||
### 90002
|
||||
Stop an additional animation ([AV]adjuster, [AV]faces).
|
||||
|
||||
llMessageLinked(LINK_THIS,90002,<ANIMATION_FILE>,<AVATAR_UUID>);
|
||||
|
||||
### 90003
|
||||
Same as 90000 but ignored by [AV]sequence script to prevent from stopping sequences when [AV]sequence itself plays poses.
|
||||
|
||||
### 90004
|
||||
Same as 90005 but returns to top level of the menu (used by [AV]root-RLV when press [MENU]).
|
||||
|
||||
### 90005
|
||||
Give the menu. Optionally set controller avatar and submenu.
|
||||
|
||||
llMessageLinked(LINK_SET,90005,"",<AVATAR_UUID>);
|
||||
llMessageLinked(LINK_SET,90005,<TOMENU>,[<AVATAR_UUID>|<CONTROLLER_UUID>]);
|
||||
|
||||
TOMENU=-1 ensures when sitters first sit they will get [AV]select menu if the [AV]seclect] script is present
|
||||
|
||||
### 90006
|
||||
Register touch or sit to [AV]root-security script from [AV]sitA after permissions granted.
|
||||
|
||||
llMessageLinked(LINK_SET,90006,"",<AVATAR_UUID>);
|
||||
llMessageLinked(LINK_SET,90006,<FUNCTION>,<AVATAR_UUID>); // for AVselect!
|
||||
|
||||
FUNCTION=-1 ensures when sitters first sit they will get [AV]select menu if the [AV]seclect] script is present
|
||||
|
||||
### 90007
|
||||
[AV]root-security passes touch to [AV]root-control.
|
||||
|
||||
llMessageLinked(LINK_SET,90007,"",<CONTROLLER_UUID>);
|
||||
|
||||
### 90009
|
||||
Bring up [AV]select menu, sent by [AV]sitB.
|
||||
|
||||
llMessageLinked(LINK_SET,90009,"",<AVATAR_UUID>);
|
||||
|
||||
### 90010
|
||||
Same as 90000 but ignores ETYPE.
|
||||
|
||||
### 90011
|
||||
[AV]adjuster tells [AV]sitA scripts to set the llSetLinkCamera().
|
||||
|
||||
### 90012
|
||||
[AV]root-security passes touch or sit to [AV]root-RLV.
|
||||
|
||||
llMessageLinked(LINK_THIS, 90012,<ACTIVE_PRIM>,<CONTROLLER_UUID>);
|
||||
|
||||
### 90014
|
||||
[AV]root-RLV notifies user scripts of the controlling avatar & captive avatars.
|
||||
|
||||
llMessageLinked(LINK_SET,90014,llDumpList2String([CONTROLLER_UUID,llDumpList2String(CAPTIVES,",")],"|"),"");
|
||||
|
||||
### 90020
|
||||
Tells a script to [DUMP] settings.
|
||||
|
||||
llMessageLinked(LINK_THIS,90020,<SITTER>,<SCRIPT_NAME>);
|
||||
|
||||
### 90021
|
||||
Tells [AV]adjuster to ask the next script to [DUMP] settings.
|
||||
|
||||
llMessageLinked(LINK_THIS,90021,<SITTER#>,<SCRIPT_NAME>);
|
||||
|
||||
### 90022
|
||||
Tell [AV]adjuster a read out settings [DUMP] line.
|
||||
|
||||
llMessageLinked(LINK_THIS,90022,<TEXT>,<SITTER#>);
|
||||
|
||||
### 90030
|
||||
Tell [AV]sit scripts and [AV]adjuster to [SWAP] between two sitters.
|
||||
|
||||
llMessageLinked(LINK_THIS,90030,<SITTER#>,<SITTER#>);
|
||||
|
||||
### 90033
|
||||
[AV]control tells listeners in [AV]sit & [AV]root-security scripts to reset after capture to prevent captive using an open menu, and when someone "takes control of menu".
|
||||
|
||||
llMessageLinked(LINK_SET,90033,"","");
|
||||
|
||||
### 90045
|
||||
[AV]sitA gives info about the pose just played. Received by many scripts.
|
||||
|
||||
link_message(integer sender, integer num, string msg, key id){
|
||||
if(num==90045){
|
||||
|
||||
// The avatar UUID
|
||||
key AVATAR_UUID = id;
|
||||
|
||||
// Extract the data into a list
|
||||
list data = llParseStringKeepNulls(msg,["|"],[]);
|
||||
|
||||
// The SITTER# the pose is playing for
|
||||
integer SITTER_NUMBER = (integer)llList2String(data,0);
|
||||
|
||||
// The name of the pose
|
||||
string POSE_NAME = llList2String(data,1);
|
||||
|
||||
// The animation file
|
||||
string ANIM_FILE = llList2String(data,2);
|
||||
|
||||
// The SET#
|
||||
integer SET = (integer)llList2String(data,3);
|
||||
|
||||
// A list of UUIDs of all sitting avatars separated by the ( @ ) character
|
||||
list ALL_SITTERS = llParseStringKeepNulls(llList2String(data,4),["@"],[]);
|
||||
|
||||
// The name the SYNC pose the avatar is leaving
|
||||
string OLD_SYNC_NAME = llList2String(data,5);
|
||||
|
||||
// TRUE if the pose is a SYNC pose
|
||||
integer IS_SYNC = (integer)llList2String(data,6);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
### 90050
|
||||
A pose is selected from the menu
|
||||
|
||||
default{
|
||||
link_message(integer sender, integer num, string msg, key id){
|
||||
if(num==90050){
|
||||
key AVATAR_UUID = id;
|
||||
list data = llParseStringKeepNulls(msg,["|"],[]);
|
||||
string SITTER_NUMBER = llList2String(data,0);
|
||||
string POSE_NAME = llList2String(data,1);
|
||||
string SET = llList2String(data,2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
### 90051
|
||||
Same as 90050 but when a TOMENU is selected from the menu.
|
||||
|
||||
### 90055
|
||||
[AV]sitB sends anim info to other scripts.
|
||||
|
||||
llMessageLinked(LINK_THIS,90055,<SITTER#>,<POSE_NAME,ANIMATION_FILE,POSITION,ROTATION,BROADCAST>);
|
||||
|
||||
Where <BROADCAST> is if we want to send a 90045 in response.
|
||||
|
||||
### 90056
|
||||
Same as 90055 but sent from [AV]sitA when an avatar sits (so helper sticks know where to go).
|
||||
|
||||
### 90057
|
||||
Sent by [AV]adjuster when helper moves, so [AV]sitA can update position.
|
||||
|
||||
llMessageLinked(LINK_THIS,90057,<SITTER#>,<POSITION,ROTATION>);
|
||||
|
||||
### 90060
|
||||
Welcome new sitter!
|
||||
|
||||
llMessageLinked(LINK_SET,90060,"",<AVATAR_UUID>);
|
||||
|
||||
### 90065
|
||||
Goodbye Sitter! Received by several scripts.
|
||||
|
||||
llMessageLinked(LINK_SET,90065,<SITTER#>,<AVATAR_UUID>);
|
||||
|
||||
### 90070
|
||||
Update list of SITTERS in various scripts after permissions granted. Received by several scripts.
|
||||
|
||||
llMessageLinked(LINK_THIS,90070,<SITTER#>,<AVATAR_UUID>);
|
||||
|
||||
### 90075
|
||||
Used by oldschool HELPER 1 method - ask to animate.
|
||||
|
||||
### 90076
|
||||
Used by oldschool HELPER 1 method - stop animate.
|
||||
|
||||
### 90100
|
||||
Menu choice from [AV]sitA. Also sent by [AV]sitB for [RLV] button and by [AV]root-RLV-extra for [BACK]
|
||||
|
||||
### 90101
|
||||
Menu choice. Sent and received by several scripts.
|
||||
|
||||
llMessageLinked(LINK_SET,90101,<SITTER#,MSG,CONTROLLER_UUID>,<AVATAR_UUID>);
|
||||
|
||||
### 90150
|
||||
[AV]sitA for SITTER 0 requests all [AV]sitA scripts re-place their sittarget.
|
||||
|
||||
### 90171
|
||||
[AV]adjuster add PROP line to [AV]prop.
|
||||
|
||||
### 90172
|
||||
[AV]adjuster add ANIM line to [AV]faces.
|
||||
|
||||
### 90173
|
||||
[AV]menu add PROP line to [AV]prop.
|
||||
|
||||
### 90174
|
||||
[AV]adjuster add CAMERA line to [AV]camera.
|
||||
|
||||
### 90200
|
||||
Default integer for a BUTTON line in the AVpos notecard. Used to rez props. If UUID is specified, menu is returned to that avatar. A second UUID can be specified to rez the prop for one avatar, but return the menu to another.
|
||||
|
||||
### 90220
|
||||
Same as 90200 but no menu is returned.
|
||||
|
||||
### 90201
|
||||
[AV]sitA asks for info about what plugins are available.
|
||||
|
||||
### 90202
|
||||
Reply that script exists in root: [AV]root-security (and [AV]root-RLV).
|
||||
|
||||
### 90203 (not used)
|
||||
Reply that script exists in root: [AV]texture.
|
||||
|
||||
### 90204 (not used)
|
||||
Reply that script exists in root: [AV]color.
|
||||
|
||||
### 90205
|
||||
Toggle sound in the [AV]sequence script.
|
||||
|
||||
### 90206
|
||||
[AV]root-RLV sends information to [AV]control.
|
||||
|
||||
### 90207
|
||||
RLV sends hovertext details.
|
||||
|
||||
### 90208
|
||||
[AV]root-RLV tells [AV]root-RLV-extra to open "Un/Dress" menu.
|
||||
|
||||
### 90209
|
||||
[AV]root-RLV tells [AV]root-RLV-extra to open "Restrict" menu.
|
||||
|
||||
### 90210
|
||||
Default integer for a SEQUENCE line in the AVpos notecard. Used by [AV]sequence.
|
||||
|
||||
### 90211
|
||||
[AV]control sends [CAPTURE] message to [AV]root-RLV.
|
||||
|
||||
llMessageLinked(LINK_THIS,90211,"",<CONTROLLER_UUID>);
|
||||
|
||||
### 90230
|
||||
Control [AV]camera with BUTTON or link message.
|
||||
|
||||
llMessageLinked(LINK_THIS,90230,<CAMERA_NAME>,<AVATAR_UUID>);
|
||||
|
||||
### 90298
|
||||
[AV]djuster tells [AV]sitA to show SitTargets (/5 targets).
|
||||
|
||||
### 90299
|
||||
[AV]sitA resets [AV]sitB
|
||||
|
||||
llMessageLinked(LINK_THIS,90299,<SITTER#>,"");
|
||||
|
||||
### 90300
|
||||
[AV]sitA, [AV]adjuster updates [AV]sitB.
|
||||
|
||||
### 90301
|
||||
More [AV]sitA, [AV]adjuster updates to [AV]sitB.
|
||||
|
||||
### 90302
|
||||
[AV]sitA sends initial notecard settings data to [AV]sitB.
|
||||
|
||||
### 90500
|
||||
[AV]prop reports on prop events (ATTACHED,DETACHED,REZ,DEREZ).
|
||||
|
||||
default{
|
||||
link_message(integer sender, integer num, string msg, key id){
|
||||
if(num==90500){
|
||||
list data = llParseStringKeepNulls(msg,["|"],[]);
|
||||
key AVATAR_UUID = id;
|
||||
string EVENT = llList2String(data,0);
|
||||
string SITTER_NUMBER = llList2String(data,1);
|
||||
string PROP_NAME = llList2String(data,2);
|
||||
string PROP_OBJECT = llList2String(data,3);
|
||||
string PROP_GROUP = llList2String(data,4);
|
||||
string PROP_UUID = llList2String(data,5);
|
||||
llOwnerSay(llDumpList2String([EVENT, SITTER_NUMBER, PROP_NAME, PROP_OBJECT, PROP_GROUP, PROP_UUID, AVATAR_UUID],","));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue