diff options
-rw-r--r-- | 1AOor2.lsl | 77 | ||||
-rw-r--r-- | 1chatter.lsl | 73 | ||||
-rw-r--r-- | 1ring.lsl | 50 |
3 files changed, 173 insertions, 27 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(); |
diff --git a/1chatter.lsl b/1chatter.lsl index 9970462..b41df53 100644 --- a/1chatter.lsl +++ b/1chatter.lsl | |||
@@ -38,6 +38,8 @@ integer lSUBSTITUTE = -7; | |||
38 | integer lSUBSTITUTE_DONE = -8; | 38 | integer lSUBSTITUTE_DONE = -8; |
39 | integer lNEXT_WORD = -9; | 39 | integer lNEXT_WORD = -9; |
40 | integer lNEXT_WORD_DONE = -10; | 40 | integer lNEXT_WORD_DONE = -10; |
41 | integer lCHECK = -11; | ||
42 | integer lCHECK_DONE = -12; | ||
41 | integer lCONTROL = -13; | 43 | integer lCONTROL = -13; |
42 | integer lCONTROL_DONE = -14; | 44 | integer lCONTROL_DONE = -14; |
43 | integer lCMD = -15; | 45 | integer lCMD = -15; |
@@ -52,6 +54,7 @@ d(string m) {if (DEBUG) llInstantMessage(Owner, llGetScriptName() + ": " + m);} | |||
52 | D(string m) {llRegionSay(DEBUG_CHANNEL, llGetScriptName() + ": " + m);} | 54 | D(string m) {llRegionSay(DEBUG_CHANNEL, llGetScriptName() + ": " + m);} |
53 | s(string m) {s(Owner, m);} | 55 | s(string m) {s(Owner, m);} |
54 | s(key id, string m) {if (id == Owner) llOwnerSay(m); else llInstantMessage(id, m);} | 56 | s(key id, string m) {if (id == Owner) llOwnerSay(m); else llInstantMessage(id, m);} |
57 | S(string m) {llInstantMessage(Owner, llGetScriptName() + ": " + m);} | ||
55 | sendScript(integer cmd, list args) {sendScript(LibraryKey, cmd, ScriptName, args);} | 58 | sendScript(integer cmd, list args) {sendScript(LibraryKey, cmd, ScriptName, args);} |
56 | sendScript(key them, integer cmd, list args) {sendScript(them, cmd, inKey2Name(them), args);} | 59 | sendScript(key them, integer cmd, list args) {sendScript(them, cmd, inKey2Name(them), args);} |
57 | sendScript(integer cmd, string name, list args) {sendScript(LibraryKey, cmd, name, args);} | 60 | sendScript(integer cmd, string name, list args) {sendScript(LibraryKey, cmd, name, args);} |
@@ -59,7 +62,12 @@ sendScript(key them, integer cmd, string name, list args) | |||
59 | { | 62 | { |
60 | llMessageLinked(LINK_SET, cmd, llDumpList2String([ScriptKey, name] + args, lSEP), them); | 63 | llMessageLinked(LINK_SET, cmd, llDumpList2String([ScriptKey, name] + args, lSEP), them); |
61 | } | 64 | } |
62 | sendPrim(key them, string cmd, list args) {osMessageObject(them, llDumpList2String([ScriptName] + args, lSEP));} | 65 | integer pingPrim(key k) |
66 | { | ||
67 | if (NULL_KEY != k) return (0 != llGetListLength(llGetObjectDetails(k, [OBJECT_DESC]))); | ||
68 | return FALSE; | ||
69 | } | ||
70 | sendPrim(key them, string cmd, list args) {if (pingPrim(them)) osMessageObject(them, llDumpList2String([ScriptName] + args, lSEP));} | ||
63 | 71 | ||
64 | string inKey2Name(key k) | 72 | string inKey2Name(key k) |
65 | { | 73 | { |
@@ -596,16 +604,47 @@ addMenuItem(string fr, string menu, string cmd, list args) | |||
596 | e += getToggle(fr, llList2String(args, 0)); | 604 | e += getToggle(fr, llList2String(args, 0)); |
597 | else | 605 | else |
598 | e += llList2String(args, 0); | 606 | e += llList2String(args, 0); |
599 | if ("TOMENU" == cmd) e += "…"; | 607 | if ("TOMENU" == cmd) |
608 | e += "…"; | ||
609 | else if ("TOGGLE" == cmd) | ||
610 | { | ||
611 | string cm = llList2String(args, 0); | ||
612 | if (-1 == listFindString(Settings, fr + llToUpper(cm), sSTRIDE)) | ||
613 | d("ERROR! Not found setting " + fr + cm + "!"); | ||
614 | } | ||
615 | else if ("BUTTON" == cmd) | ||
616 | { | ||
617 | string cm = llList2String(args, 1); | ||
618 | |||
619 | if (-1 == listFindString(Commands, fr + llToUpper(cm), cSTRIDE)) | ||
620 | d("ERROR! Not found command " + fr + " " + cm + "!"); | ||
621 | else | ||
622 | { | ||
623 | sendScript(getSetting(fr + "SCRIPTKEY"), lCHECK, fr, | ||
624 | [fCARD, LibraryKey, menu, cm, | ||
625 | llDumpList2String(llListReplaceList(args, [], 0, 1), "|")]); | ||
626 | } | ||
627 | } | ||
628 | else | ||
629 | { | ||
630 | if (-1 == listFindString(Commands, fr + llToUpper(cmd), cSTRIDE)) | ||
631 | d("ERROR! Not found command " + fr + cmd + "!"); | ||
632 | else | ||
633 | { | ||
634 | sendScript(getSetting(fr + "SCRIPTKEY"), lCHECK, fr, | ||
635 | [fCARD, LibraryKey, menu, cmd, | ||
636 | llDumpList2String(llListReplaceList(args, [], 0, 0), "|")]); | ||
637 | } | ||
638 | } | ||
600 | c += llDumpList2String(llListReplaceList(args, [], 0, 0), " "); | 639 | c += llDumpList2String(llListReplaceList(args, [], 0, 0), " "); |
601 | saveMenu(menu, llList2String(Menus, f + mTITLE), llList2Integer(Menus, f + mAUTH), e, c, llList2Integer(Menus, f + mDYN)); | 640 | saveMenu(menu, llList2String(Menus, f + mTITLE), llList2Integer(Menus, f + mAUTH), e, c, llList2Integer(Menus, f + mDYN)); |
602 | } | 641 | } |
603 | } | 642 | } |
604 | 643 | ||
605 | dynamicMenu(key id, string menu, string name, string title, string entries, string command) | 644 | dynamicMenu(key id, string menu, string name, string title, string entries, string command, integer ret) |
606 | { | 645 | { |
607 | //d("dynamicMenu " + menu + " -> " + name + "\n" + id + "@" + name); | 646 | //d("dynamicMenu " + menu + " -> " + name + "\n" + id + "@" + name); |
608 | saveMenu(id + "@" + name, title, aALL, entries, command, TRUE); | 647 | saveMenu(id + "@" + name, title, aALL, entries, command, ret); |
609 | saveMuser(id, id + "@" + name, entries, -1, menu); | 648 | saveMuser(id, id + "@" + name, entries, -1, menu); |
610 | showMenu(id); | 649 | showMenu(id); |
611 | } | 650 | } |
@@ -785,7 +824,7 @@ showMenu(key id) | |||
785 | integer l = llGetListLength(entries); | 824 | integer l = llGetListLength(entries); |
786 | integer n; | 825 | integer n; |
787 | 826 | ||
788 | if (llList2Integer(Menus, m + mDYN)) | 827 | if (dM) |
789 | { | 828 | { |
790 | for (; n < l; ++n) | 829 | for (; n < l; ++n) |
791 | { | 830 | { |
@@ -912,10 +951,11 @@ integer handleMenu(integer f, key id, string button) | |||
912 | list lst; | 951 | list lst; |
913 | integer page = llList2Integer(Musers, f + uPAGE); | 952 | integer page = llList2Integer(Musers, f + uPAGE); |
914 | integer m = findMenu(menu); // This was already checked before it was stuffed into Musers. | 953 | integer m = findMenu(menu); // This was already checked before it was stuffed into Musers. |
954 | integer dm = llList2Integer(Menus, m + mDYN); | ||
915 | integer e = 0; | 955 | integer e = 0; |
916 | 956 | ||
917 | //d("handleMenu(" + llKey2Name(id) + "," + button + ") " + menu + " -> " + cmd); | 957 | //d("handleMenu(" + llKey2Name(id) + "," + button + ") " + menu + " -> " + cmd); |
918 | if (llList2Integer(Menus, m + mDYN)) | 958 | if (dm) |
919 | dM = menu; | 959 | dM = menu; |
920 | // Find the corresponding command for this button. | 960 | // Find the corresponding command for this button. |
921 | lst = llParseStringKeepNulls(llList2String(Menus, m + mCMDS), ["|"], []); | 961 | lst = llParseStringKeepNulls(llList2String(Menus, m + mCMDS), ["|"], []); |
@@ -1023,7 +1063,7 @@ d("handleMenu(" + llKey2Name(id) + "," + button + ") " + menu + " -> " + fr + cm | |||
1023 | f = listFindString(Commands, fr + cmd, cSTRIDE); | 1063 | f = listFindString(Commands, fr + cmd, cSTRIDE); |
1024 | if (-1 != f) | 1064 | if (-1 != f) |
1025 | i = doThing(id, menu + "->" + button, fr, cmd, data, fMENU); | 1065 | i = doThing(id, menu + "->" + button, fr, cmd, data, fMENU); |
1026 | if ("" != dM) | 1066 | if ((dm != 2) && ("" != dM)) |
1027 | lastMenu(id, dM); | 1067 | lastMenu(id, dM); |
1028 | return i; | 1068 | return i; |
1029 | } | 1069 | } |
@@ -1031,6 +1071,12 @@ d("handleMenu(" + llKey2Name(id) + "," + button + ") " + menu + " -> " + fr + cm | |||
1031 | return TRUE; | 1071 | return TRUE; |
1032 | } | 1072 | } |
1033 | 1073 | ||
1074 | integer checkThing(key id, string button, string fr, string cmd, string data, integer source) | ||
1075 | { | ||
1076 | if ((fr != (ScriptName + ".") && ("*." != fr))) return FALSE; | ||
1077 | return TRUE; | ||
1078 | } | ||
1079 | |||
1034 | integer doThing(key id, string command, string fr, string cmd, string data, integer source) | 1080 | integer doThing(key id, string command, string fr, string cmd, string data, integer source) |
1035 | { | 1081 | { |
1036 | if ("*.." == fr) return TRUE; | 1082 | if ("*.." == fr) return TRUE; |
@@ -1386,6 +1432,12 @@ fr="1AOor2"; | |||
1386 | } | 1432 | } |
1387 | } | 1433 | } |
1388 | } | 1434 | } |
1435 | else if (lCHECK_DONE == num) | ||
1436 | { | ||
1437 | //d("lCHECK_DONE " + llKey2Name(llList2Key(input, 3)) + " -> " + llList2String(input, 2) + "| returned " + llList2String(input, 4)); | ||
1438 | if (!llList2Integer(input, 4)) | ||
1439 | S("ERROR - Invalid command for " + llList2String(input, 2)); | ||
1440 | } | ||
1389 | else if (lCMD == num) | 1441 | else if (lCMD == num) |
1390 | { | 1442 | { |
1391 | doThing(llList2Key(input, 3), llList2String(input, 4), fr + ".", | 1443 | doThing(llList2Key(input, 3), llList2String(input, 4), fr + ".", |
@@ -1400,10 +1452,11 @@ fr="1AOor2"; | |||
1400 | else if (lDYNAMIC == num) | 1452 | else if (lDYNAMIC == num) |
1401 | { | 1453 | { |
1402 | string menu = llList2String(input, 3); | 1454 | string menu = llList2String(input, 3); |
1403 | if ("" != menu) | 1455 | integer f = llSubStringIndex(menu, "."); |
1456 | if (("" != menu) && (-1 == f)) | ||
1404 | menu = fr + "." + menu; | 1457 | menu = fr + "." + menu; |
1405 | dynamicMenu(llList2Key(input, 2), menu, fr + "." + llList2String(input, 4), | 1458 | dynamicMenu(llList2Key(input, 2), menu, fr + "." + llList2String(input, 4), |
1406 | llList2String(input, 5), llList2String(input, 6), llList2String(input, 7)); | 1459 | llList2String(input, 5), llList2String(input, 6), llList2String(input, 7), llList2Integer(input, 8)); |
1407 | } | 1460 | } |
1408 | else if (lMENU == num) | 1461 | else if (lMENU == num) |
1409 | { | 1462 | { |
@@ -1527,7 +1580,7 @@ d("listen 1ring.CHANNEL " + message + " -> " + button + " " + cmd + " " + data); | |||
1527 | llSensor("", NULL_KEY, llList2Integer(Scanners, nTYPE), 100.0, PI); | 1580 | llSensor("", NULL_KEY, llList2Integer(Scanners, nTYPE), 100.0, PI); |
1528 | dynamicMenu(id, menu, menu, | 1581 | dynamicMenu(id, menu, menu, |
1529 | llList2String(Scanners, nTITLE), | 1582 | llList2String(Scanners, nTITLE), |
1530 | llDumpList2String(items, "|"), llDumpList2String(keys, "|")); | 1583 | llDumpList2String(items, "|"), llDumpList2String(keys, "|"), 2); |
1531 | } | 1584 | } |
1532 | } | 1585 | } |
1533 | 1586 | ||
@@ -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; |
@@ -62,6 +64,7 @@ d(string m) {if (DEBUG) llInstantMessage(Owner, llGetScriptName() + ": " + m);} | |||
62 | D(string m) {llRegionSay(DEBUG_CHANNEL, llGetScriptName() + ": " + m);} | 64 | D(string m) {llRegionSay(DEBUG_CHANNEL, llGetScriptName() + ": " + m);} |
63 | s(string m) {s(Owner, m);} | 65 | s(string m) {s(Owner, m);} |
64 | s(key id, string m) {if (id == Owner) llOwnerSay(m); else llInstantMessage(id, m);} | 66 | s(key id, string m) {if (id == Owner) llOwnerSay(m); else llInstantMessage(id, m);} |
67 | S(string m) {llInstantMessage(Owner, llGetScriptName() + ": " + m);} | ||
65 | sendScript(integer cmd, list args) {sendScript(LibraryKey, cmd, ScriptName, args);} | 68 | sendScript(integer cmd, list args) {sendScript(LibraryKey, cmd, ScriptName, args);} |
66 | sendScript(key them, integer cmd, list args) {sendScript(them, cmd, inKey2Name(them), args);} | 69 | sendScript(key them, integer cmd, list args) {sendScript(them, cmd, inKey2Name(them), args);} |
67 | sendScript(integer cmd, string name, list args) {sendScript(LibraryKey, cmd, name, args);} | 70 | sendScript(integer cmd, string name, list args) {sendScript(LibraryKey, cmd, name, args);} |
@@ -69,9 +72,16 @@ sendScript(key them, integer cmd, string name, list args) | |||
69 | { | 72 | { |
70 | llMessageLinked(LINK_SET, cmd, llDumpList2String([ScriptKey, name] + args, lSEP), them); | 73 | llMessageLinked(LINK_SET, cmd, llDumpList2String([ScriptKey, name] + args, lSEP), them); |
71 | } | 74 | } |
75 | integer pingPrim(key k) | ||
76 | { | ||
77 | if (NULL_KEY != k) | ||
78 | return (0 != llGetListLength(llGetObjectDetails(k, [OBJECT_DESC]))); | ||
79 | return FALSE; | ||
80 | } | ||
72 | sendPrim(key them, string cmd, list args) | 81 | sendPrim(key them, string cmd, list args) |
73 | { | 82 | { |
74 | osMessageObject(them, llDumpList2String([ScriptName, cmd] + args, lSEP)); | 83 | if (pingPrim(them)) |
84 | osMessageObject(them, llDumpList2String([ScriptName, cmd] + args, lSEP)); | ||
75 | } | 85 | } |
76 | addEvent(float delay, string cmds) | 86 | addEvent(float delay, string cmds) |
77 | { | 87 | { |
@@ -199,7 +209,11 @@ doSettings(key id, list settings) | |||
199 | 209 | ||
200 | dynamicMenu(key id, string menu, string name, string title, string entries, string command) | 210 | dynamicMenu(key id, string menu, string name, string title, string entries, string command) |
201 | { | 211 | { |
202 | sendScript(lDYNAMIC, [id, menu, name, title, entries, command]); | 212 | dynamicMenu(id, menu, name, title, entries, command, 1); |
213 | } | ||
214 | dynamicMenu(key id, string menu, string name, string title, string entries, string command, integer ret) | ||
215 | { | ||
216 | sendScript(lDYNAMIC, [id, menu, name, title, entries, command, ret]); | ||
203 | } | 217 | } |
204 | 218 | ||
205 | linky(integer num, string message, key id) | 219 | linky(integer num, string message, key id) |
@@ -213,16 +227,26 @@ linky(integer num, string message, key id) | |||
213 | key them = llList2Key(input, 0); | 227 | key them = llList2Key(input, 0); |
214 | string fr = llList2Key(input, 1); | 228 | string fr = llList2Key(input, 1); |
215 | //d("linky " + num + " " + message); | 229 | //d("linky " + num + " " + message); |
216 | if (lCMD == num) | 230 | if ((lCHECK == num) || (lCMD == num)) |
217 | { | 231 | { |
218 | //d("linky lCMD " + llDumpList2String(input, " ~ ")); | ||
219 | if ((fr == (ScriptName + ".")) || (fr == "*.")) | 232 | if ((fr == (ScriptName + ".")) || (fr == "*.")) |
220 | { | 233 | { |
221 | key a = llList2Key(input, 3); | 234 | key a = llList2Key(input, 3); |
222 | string button = llList2String(input, 4); | 235 | string button = llList2String(input, 4); |
223 | integer r = doThing(a, button, fr, | 236 | integer r; |
237 | if (lCHECK == num) | ||
238 | { | ||
239 | //d("link CHECK " + llDumpList2String(input, " ~ ")); | ||
240 | r = checkThing(a, button, fr, | ||
241 | llList2String(input, 5), llList2String(input, 6), llList2Integer(input, 2)); | ||
242 | } | ||
243 | else | ||
244 | { | ||
245 | //d("link CHAT " + llDumpList2String(input, " ~ ")); | ||
246 | r = doThing(a, button, fr, | ||
224 | llList2String(input, 5), llList2String(input, 6), llList2Integer(input, 2)); | 247 | llList2String(input, 5), llList2String(input, 6), llList2Integer(input, 2)); |
225 | sendScript(lCMD_DONE, [button, a, r]); | 248 | } |
249 | sendScript(num - 1, [button, a, r]); | ||
226 | } | 250 | } |
227 | } | 251 | } |
228 | else if (lRESET_DONE == num) | 252 | else if (lRESET_DONE == num) |
@@ -404,6 +428,12 @@ integer changeAccess(key id, string cmd, key person, integer source) | |||
404 | return FALSE; | 428 | return FALSE; |
405 | } | 429 | } |
406 | 430 | ||
431 | integer checkThing(key id, string button, string fr, string cmd, string data, integer source) | ||
432 | { | ||
433 | if ((fr != (ScriptName + ".") && ("*." != fr))) return FALSE; | ||
434 | return TRUE; | ||
435 | } | ||
436 | |||
407 | integer doThing(key id, string button, string fr, string cmd, string data, integer source) | 437 | integer doThing(key id, string button, string fr, string cmd, string data, integer source) |
408 | { | 438 | { |
409 | integer set = -1; | 439 | integer set = -1; |
@@ -1405,7 +1435,7 @@ d("HEY leashy! " + URL); | |||
1405 | } while(++channel < 42); | 1435 | } while(++channel < 42); |
1406 | 1436 | ||
1407 | dynamicMenu(someBoss, "clothes", "DETACH", "Please select the attachment to detach", | 1437 | dynamicMenu(someBoss, "clothes", "DETACH", "Please select the attachment to detach", |
1408 | llDumpList2String(items, "|"), "DETACH"); | 1438 | llDumpList2String(items, "|"), "DETACH", 2); |
1409 | } | 1439 | } |
1410 | else if ("getoutfit" == rlv) | 1440 | else if ("getoutfit" == rlv) |
1411 | { | 1441 | { |
@@ -1416,7 +1446,7 @@ d("HEY leashy! " + URL); | |||
1416 | } while(++channel < 20); | 1446 | } while(++channel < 20); |
1417 | 1447 | ||
1418 | dynamicMenu(someBoss, "clothes", "TAKEOFF", "Please select the clothes to take off", | 1448 | dynamicMenu(someBoss, "clothes", "TAKEOFF", "Please select the clothes to take off", |
1419 | llDumpList2String(items, "|"), "TAKEOFF"); | 1449 | llDumpList2String(items, "|"), "TAKEOFF", 2); |
1420 | } | 1450 | } |
1421 | else if ("getinv" == rlv) | 1451 | else if ("getinv" == rlv) |
1422 | { | 1452 | { |
@@ -1429,8 +1459,8 @@ d("HEY leashy! " + URL); | |||
1429 | string folder = llList2String(folders, i); | 1459 | string folder = llList2String(folders, i); |
1430 | items += [folder, "+ " + folder, "- " + folder]; | 1460 | items += [folder, "+ " + folder, "- " + folder]; |
1431 | } | 1461 | } |
1432 | dynamicMenu(someBoss, "clothes", "PUTON", "Please select the outfit to put on", | 1462 | dynamicMenu(someBoss, "clothes", "PUTON", "Please select the outfit to put on", |
1433 | llDumpList2String(items, "|"), "PUTON"); | 1463 | llDumpList2String(items, "|"), "PUTON", 2); |
1434 | } | 1464 | } |
1435 | } | 1465 | } |
1436 | 1466 | ||