diff options
author | onefang | 2019-07-04 02:02:34 +1000 |
---|---|---|
committer | onefang | 2019-07-04 02:02:34 +1000 |
commit | 740466e367af3afc39e9ca199207dc52c78f27cb (patch) | |
tree | 0fcdbe0092aef4b6d048e8e6cf95fa9d1a959a8d /1ring.lsl | |
parent | Bump version to 0.12 test (diff) | |
download | 1ring-740466e367af3afc39e9ca199207dc52c78f27cb.zip 1ring-740466e367af3afc39e9ca199207dc52c78f27cb.tar.gz 1ring-740466e367af3afc39e9ca199207dc52c78f27cb.tar.bz2 1ring-740466e367af3afc39e9ca199207dc52c78f27cb.tar.xz |
New OhSilly Threat level detector, and actually use it.
Tries to work in all case.
Diffstat (limited to '')
-rw-r--r-- | 1ring.lsl | 42 |
1 files changed, 12 insertions, 30 deletions
@@ -56,20 +56,7 @@ integer lDYNAMIC = -20; | |||
56 | integer lMENU = -21; | 56 | integer lMENU = -21; |
57 | 57 | ||
58 | // OhSillyThreat detector | 58 | // OhSillyThreat detector |
59 | list OhSillyThreats = []; | 59 | integer doSpeed = FALSE; |
60 | list OhSillyTreats = // OpenSim threat level. | ||
61 | [ | ||
62 | "osKey2Name", // low | ||
63 | // "osGetAvatarList", // none | ||
64 | // "osGetNotecard", // very high (describes what they where when making this decision) | ||
65 | // "osMakeNotecard", // high (describes what they where when making this decision) | ||
66 | // "osGetRezzingObject", // none | ||
67 | "osMessageObject", // low | ||
68 | // "osAvatarPlayAnimation", // very high | ||
69 | // "osAvatarStopAnimation", // very high | ||
70 | // "osForceOtherSit", // very high | ||
71 | "osSetSpeed" // moderate | ||
72 | ]; | ||
73 | 60 | ||
74 | d(string m) {if (DEBUG) llInstantMessage(Owner, llGetScriptName() + ": " + m);} | 61 | d(string m) {if (DEBUG) llInstantMessage(Owner, llGetScriptName() + ": " + m);} |
75 | D(string m) {llRegionSay(DEBUG_CHANNEL, llGetScriptName() + ": " + m);} | 62 | D(string m) {llRegionSay(DEBUG_CHANNEL, llGetScriptName() + ": " + m);} |
@@ -103,6 +90,8 @@ string inKey2Name(key k) | |||
103 | return k; | 90 | return k; |
104 | } | 91 | } |
105 | 92 | ||
93 | speed(key u, float s){if (doSpeed) osSetSpeed(u, s);} | ||
94 | |||
106 | integer listFindString(list lst, string name, integer stride) | 95 | integer listFindString(list lst, string name, integer stride) |
107 | { | 96 | { |
108 | integer f = llListFindList(lst, [name]); | 97 | integer f = llListFindList(lst, [name]); |
@@ -215,6 +204,10 @@ dynamicMenu(key id, string menu, string name, string title, string entries, stri | |||
215 | 204 | ||
216 | linky(integer num, string message, key id) | 205 | linky(integer num, string message, key id) |
217 | { | 206 | { |
207 | if (DEBUG_CHANNEL == num) | ||
208 | { | ||
209 | if ("osSetSpeed" == message) doSpeed = (integer) id; | ||
210 | } | ||
218 | if ((id != ScriptKey) && (id != NULL_KEY)) return; | 211 | if ((id != ScriptKey) && (id != NULL_KEY)) return; |
219 | list input = llParseStringKeepNulls(message, [lSEP], []); | 212 | list input = llParseStringKeepNulls(message, [lSEP], []); |
220 | key them = llList2Key(input, 0); | 213 | key them = llList2Key(input, 0); |
@@ -266,19 +259,6 @@ d("linky RESET_DONE"); | |||
266 | laterInit(); | 259 | laterInit(); |
267 | s("Finished starting up " + getSetting("VERSION") + " in " + (string) (llGetTimeOfDay() - Start)); | 260 | s("Finished starting up " + getSetting("VERSION") + " in " + (string) (llGetTimeOfDay() - Start)); |
268 | } | 261 | } |
269 | else if (DEBUG_CHANNEL == num) | ||
270 | { | ||
271 | key root = llList2Key(llGetObjectDetails(id, [OBJECT_ROOT]), 0); | ||
272 | integer f = llListFindList(OhSillyThreats, [message]); | ||
273 | |||
274 | if (-1 == f) | ||
275 | OhSillyThreats += [message]; | ||
276 | else | ||
277 | d("OhSillyThreats detected the function " + message + "() again!" ); | ||
278 | s("Oh Silly threat system prevented " + message + "()" | ||
279 | + "\n in " + id + " \t" + llKey2Name(id) | ||
280 | + "\n part of " + root + " \t" + llKey2Name(root)); | ||
281 | } | ||
282 | } | 262 | } |
283 | // END boilerplate, mostly. | 263 | // END boilerplate, mostly. |
284 | 264 | ||
@@ -629,6 +609,8 @@ s("YAY! Freeeeeee at last!!!!!"); | |||
629 | osMessageObject(LeashKey, "URL|" + data); | 609 | osMessageObject(LeashKey, "URL|" + data); |
630 | d("New URL " + URL); | 610 | d("New URL " + URL); |
631 | } | 611 | } |
612 | else if ("OHSILLYPROBE" == cmd) | ||
613 | llMessageLinked(LINK_SET, DEBUG_CHANNEL, "OHSILLYPROBE", llGetKey()); | ||
632 | else if ("▲" == cmd) | 614 | else if ("▲" == cmd) |
633 | ; | 615 | ; |
634 | else if (-1 == listFindString(Settings, fr + cmd, sSTRIDE)) | 616 | else if (-1 == listFindString(Settings, fr + cmd, sSTRIDE)) |
@@ -853,9 +835,9 @@ goto(key this) | |||
853 | if (dist > (RANGE + bb)) | 835 | if (dist > (RANGE + bb)) |
854 | { | 836 | { |
855 | if (dist > (2.0 * (RANGE + bb))) | 837 | if (dist > (2.0 * (RANGE + bb))) |
856 | osSetSpeed(Owner, 2.0); | 838 | speed(Owner, 2.0); |
857 | else | 839 | else |
858 | osSetSpeed(Owner, 1.0); | 840 | speed(Owner, 1.0); |
859 | 841 | ||
860 | llStopMoveToTarget(); | 842 | llStopMoveToTarget(); |
861 | if (0 != tid) | 843 | if (0 != tid) |
@@ -899,7 +881,7 @@ stopGoto(integer all) | |||
899 | llTargetRemove(tid); | 881 | llTargetRemove(tid); |
900 | tid = 0; | 882 | tid = 0; |
901 | } | 883 | } |
902 | osSetSpeed(Owner, 1.0); | 884 | speed(Owner, 1.0); |
903 | if (all) | 885 | if (all) |
904 | { | 886 | { |
905 | Stalkee = NULL_KEY; | 887 | Stalkee = NULL_KEY; |