aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/1ring.lsl
diff options
context:
space:
mode:
authoronefang2021-09-06 21:15:36 +1000
committeronefang2021-09-06 21:15:36 +1000
commit10e2f77d57ecc5e306900b112d70c2600f941ae4 (patch)
treee634b6ac7d20886b9fe256b8c69696a011e4e0b6 /1ring.lsl
parentOops, left this out of the OhSilly sit commit. (diff)
download1ring-10e2f77d57ecc5e306900b112d70c2600f941ae4.zip
1ring-10e2f77d57ecc5e306900b112d70c2600f941ae4.tar.gz
1ring-10e2f77d57ecc5e306900b112d70c2600f941ae4.tar.bz2
1ring-10e2f77d57ecc5e306900b112d70c2600f941ae4.tar.xz
Various common tweaks.
New instant message logger. Check if a prim still exists before sending it a message. New dynamic menu return option. Check menu commands at startup.
Diffstat (limited to '1ring.lsl')
-rw-r--r--1ring.lsl50
1 files changed, 40 insertions, 10 deletions
diff --git a/1ring.lsl b/1ring.lsl
index 59db460..f8bacdf 100644
--- a/1ring.lsl
+++ b/1ring.lsl
@@ -45,6 +45,8 @@ integer lSUBSTITUTE = -7;
45integer lSUBSTITUTE_DONE = -8; 45integer lSUBSTITUTE_DONE = -8;
46integer lNEXT_WORD = -9; 46integer lNEXT_WORD = -9;
47integer lNEXT_WORD_DONE = -10; 47integer lNEXT_WORD_DONE = -10;
48integer lCHECK = -11;
49integer lCHECK_DONE = -12;
48integer lCONTROL = -13; 50integer lCONTROL = -13;
49integer lCONTROL_DONE = -14; 51integer lCONTROL_DONE = -14;
50integer lCMD = -15; 52integer lCMD = -15;
@@ -62,6 +64,7 @@ d(string m) {if (DEBUG) llInstantMessage(Owner, llGetScriptName() + ": " + m);}
62D(string m) {llRegionSay(DEBUG_CHANNEL, llGetScriptName() + ": " + m);} 64D(string m) {llRegionSay(DEBUG_CHANNEL, llGetScriptName() + ": " + m);}
63s(string m) {s(Owner, m);} 65s(string m) {s(Owner, m);}
64s(key id, string m) {if (id == Owner) llOwnerSay(m); else llInstantMessage(id, m);} 66s(key id, string m) {if (id == Owner) llOwnerSay(m); else llInstantMessage(id, m);}
67S(string m) {llInstantMessage(Owner, llGetScriptName() + ": " + m);}
65sendScript(integer cmd, list args) {sendScript(LibraryKey, cmd, ScriptName, args);} 68sendScript(integer cmd, list args) {sendScript(LibraryKey, cmd, ScriptName, args);}
66sendScript(key them, integer cmd, list args) {sendScript(them, cmd, inKey2Name(them), args);} 69sendScript(key them, integer cmd, list args) {sendScript(them, cmd, inKey2Name(them), args);}
67sendScript(integer cmd, string name, list args) {sendScript(LibraryKey, cmd, name, args);} 70sendScript(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}
75integer pingPrim(key k)
76{
77 if (NULL_KEY != k)
78 return (0 != llGetListLength(llGetObjectDetails(k, [OBJECT_DESC])));
79 return FALSE;
80}
72sendPrim(key them, string cmd, list args) 81sendPrim(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}
76addEvent(float delay, string cmds) 86addEvent(float delay, string cmds)
77{ 87{
@@ -199,7 +209,11 @@ doSettings(key id, list settings)
199 209
200dynamicMenu(key id, string menu, string name, string title, string entries, string command) 210dynamicMenu(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}
214dynamicMenu(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
205linky(integer num, string message, key id) 219linky(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
431integer 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
407integer doThing(key id, string button, string fr, string cmd, string data, integer source) 437integer 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