diff options
Diffstat (limited to '')
-rw-r--r-- | 1AOor2.lsl | 77 |
1 files changed, 70 insertions, 7 deletions
@@ -45,6 +45,8 @@ integer lSUBSTITUTE = -7; | |||
45 | integer lSUBSTITUTE_DONE = -8; | 45 | integer lSUBSTITUTE_DONE = -8; |
46 | integer lNEXT_WORD = -9; | 46 | integer lNEXT_WORD = -9; |
47 | integer lNEXT_WORD_DONE = -10; | 47 | integer lNEXT_WORD_DONE = -10; |
48 | integer lCHECK = -11; | ||
49 | integer lCHECK_DONE = -12; | ||
48 | integer lCONTROL = -13; | 50 | integer lCONTROL = -13; |
49 | integer lCONTROL_DONE = -14; | 51 | integer lCONTROL_DONE = -14; |
50 | integer lCMD = -15; | 52 | integer lCMD = -15; |
@@ -64,6 +66,7 @@ d(string m) {if (DEBUG) llInstantMessage(Owner, llGetScriptName() + ": " + m);} | |||
64 | D(string m) {llRegionSay(DEBUG_CHANNEL, llGetScriptName() + ": " + m);} | 66 | D(string m) {llRegionSay(DEBUG_CHANNEL, llGetScriptName() + ": " + m);} |
65 | s(string m) {s(Owner, m);} | 67 | s(string m) {s(Owner, m);} |
66 | s(key id, string m) {if (id == Owner) llOwnerSay(m); else llInstantMessage(id, m);} | 68 | s(key id, string m) {if (id == Owner) llOwnerSay(m); else llInstantMessage(id, m);} |
69 | S(string m) {llInstantMessage(Owner, llGetScriptName() + ": " + m);} | ||
67 | sendScript(integer cmd, list args) {sendScript(LibraryKey, cmd, ScriptName, args);} | 70 | sendScript(integer cmd, list args) {sendScript(LibraryKey, cmd, ScriptName, args);} |
68 | sendScript(key them, integer cmd, list args) {sendScript(them, cmd, inKey2Name(them), args);} | 71 | sendScript(key them, integer cmd, list args) {sendScript(them, cmd, inKey2Name(them), args);} |
69 | sendScript(integer cmd, string name, list args) {sendScript(LibraryKey, cmd, name, args);} | 72 | sendScript(integer cmd, string name, list args) {sendScript(LibraryKey, cmd, name, args);} |
@@ -71,9 +74,16 @@ sendScript(key them, integer cmd, string name, list args) | |||
71 | { | 74 | { |
72 | llMessageLinked(LINK_SET, cmd, llDumpList2String([ScriptKey, name] + args, lSEP), them); | 75 | llMessageLinked(LINK_SET, cmd, llDumpList2String([ScriptKey, name] + args, lSEP), them); |
73 | } | 76 | } |
77 | integer pingPrim(key k) | ||
78 | { | ||
79 | if (NULL_KEY != k) | ||
80 | return (0 != llGetListLength(llGetObjectDetails(k, [OBJECT_DESC]))); | ||
81 | return FALSE; | ||
82 | } | ||
74 | sendPrim(key them, string cmd, list args) | 83 | sendPrim(key them, string cmd, list args) |
75 | { | 84 | { |
76 | osMessageObject(them, llDumpList2String([ScriptName, cmd] + args, lSEP)); | 85 | if (pingPrim(them)) |
86 | osMessageObject(them, llDumpList2String([ScriptName, cmd] + args, lSEP)); | ||
77 | } | 87 | } |
78 | addEvent(float delay, string cmds) | 88 | addEvent(float delay, string cmds) |
79 | { | 89 | { |
@@ -188,7 +198,11 @@ list readCard(string card) | |||
188 | 198 | ||
189 | dynamicMenu(key id, string menu, string name, string title, string entries, string command) | 199 | dynamicMenu(key id, string menu, string name, string title, string entries, string command) |
190 | { | 200 | { |
191 | sendScript(lDYNAMIC, [id, menu, name, title, entries, command]); | 201 | dynamicMenu(id, menu, name, title, entries, command, 1); |
202 | } | ||
203 | dynamicMenu(key id, string menu, string name, string title, string entries, string command, integer ret) | ||
204 | { | ||
205 | sendScript(lDYNAMIC, [id, menu, name, title, entries, command, ret]); | ||
192 | } | 206 | } |
193 | 207 | ||
194 | integer Chosen; | 208 | integer Chosen; |
@@ -206,16 +220,27 @@ linky(integer num, string message, key id) | |||
206 | key them = llList2Key(input, 0); | 220 | key them = llList2Key(input, 0); |
207 | string fr = llList2Key(input, 1); | 221 | string fr = llList2Key(input, 1); |
208 | //d("linky " + num + " " + message); | 222 | //d("linky " + num + " " + message); |
209 | if (lCMD == num) | 223 | if ((lCHECK == num) || (lCMD == num)) |
210 | { | 224 | { |
211 | //d("link CHAT " + llDumpList2String(input, " ~ ")); | ||
212 | if ((fr == (ScriptName + ".")) || (fr == "*.")) | 225 | if ((fr == (ScriptName + ".")) || (fr == "*.")) |
213 | { | 226 | { |
214 | key a = llList2Key(input, 3); | 227 | key a = llList2Key(input, 3); |
215 | string button = llList2String(input, 4); | 228 | string button = llList2String(input, 4); |
216 | integer r = doThing(a, button, fr, | 229 | integer r; |
230 | if (lCHECK == num) | ||
231 | { | ||
232 | //d("link CHECK " + llDumpList2String(input, " ~ ")); | ||
233 | r = checkThing(a, button, fr, | ||
217 | llList2String(input, 5), llList2String(input, 6), llList2Integer(input, 2)); | 234 | llList2String(input, 5), llList2String(input, 6), llList2Integer(input, 2)); |
218 | sendScript(lCMD_DONE, [button, a, r]); | 235 | sendScript(num - 1, [llList2String(input, 6), a, r]); |
236 | } | ||
237 | else | ||
238 | { | ||
239 | //d("link CHAT " + llDumpList2String(input, " ~ ")); | ||
240 | r = doThing(a, button, fr, | ||
241 | llList2String(input, 5), llList2String(input, 6), llList2Integer(input, 2)); | ||
242 | sendScript(num - 1, [button, a, r]); | ||
243 | } | ||
219 | } | 244 | } |
220 | } | 245 | } |
221 | else if (lRESET_DONE == num) | 246 | else if (lRESET_DONE == num) |
@@ -237,6 +262,44 @@ d("linky RESET_DONE"); | |||
237 | } | 262 | } |
238 | // END boilerplate, mostly. | 263 | // END boilerplate, mostly. |
239 | 264 | ||
265 | integer checkThing(key id, string button, string fr, string cmd, string data, integer source) | ||
266 | { | ||
267 | if ((fr != (ScriptName + ".") && ("*." != fr))) return TRUE; | ||
268 | if (("POSE" == cmd) || ("SINGLE_POSE" == cmd)) | ||
269 | { | ||
270 | //d("CHECKING " + data); | ||
271 | // POSE piggyback,~,piggyback-sit | ||
272 | list p = llParseStringKeepNulls(llGetSubString(data, 5, -1), [",", "|"], []); | ||
273 | string name = llList2String(p, 0); | ||
274 | integer l = llGetListLength(p); | ||
275 | integer i; | ||
276 | |||
277 | p = llListReplaceList(p, [], 0, 0); | ||
278 | l--; | ||
279 | for (i = 0; i < l; i++) | ||
280 | { | ||
281 | string a = llList2String(p, i); | ||
282 | integer e = FALSE; | ||
283 | integer f = FALSE; | ||
284 | list ae = splitEmote(a); | ||
285 | string an = llList2String(ae, 0); | ||
286 | |||
287 | // Coz LSL doesn't short circuit, and we don't want to checkAnim("~") | ||
288 | if ("~" == an) | ||
289 | e = TRUE; | ||
290 | else if (!checkAnim(an, TRUE)) | ||
291 | e = TRUE; | ||
292 | if (e) | ||
293 | { | ||
294 | p = llListReplaceList(p, [], i, i); | ||
295 | i--; l--; | ||
296 | } | ||
297 | } | ||
298 | savePose(name, llDumpList2String(p, "|"), "", ""); | ||
299 | } | ||
300 | return TRUE; | ||
301 | } | ||
302 | |||
240 | integer doThing(key id, string button, string fr, string cmd, string data, integer source) | 303 | integer doThing(key id, string button, string fr, string cmd, string data, integer source) |
241 | { | 304 | { |
242 | integer set = -1; | 305 | integer set = -1; |
@@ -375,7 +438,7 @@ integer doThing(key id, string button, string fr, string cmd, string data, integ | |||
375 | keys += "|COUPLE_WITH " + llList2String(b, i); | 438 | keys += "|COUPLE_WITH " + llList2String(b, i); |
376 | names += "|" + llList2String(b, i + 2); | 439 | names += "|" + llList2String(b, i + 2); |
377 | } | 440 | } |
378 | dynamicMenu(Owner, "couples", What, " Pick someone to '" + What + "' with -", | 441 | dynamicMenu(Owner, menu, What, " Pick someone to '" + What + "' with -", |
379 | llGetSubString(names, 1, -1), llGetSubString(keys, 1, -1)); | 442 | llGetSubString(names, 1, -1), llGetSubString(keys, 1, -1)); |
380 | PIN = (integer) llFrand(DEBUG_CHANNEL - 2) + 2; | 443 | PIN = (integer) llFrand(DEBUG_CHANNEL - 2) + 2; |
381 | vector RefPos = llGetPos(); | 444 | vector RefPos = llGetPos(); |