corrade-lsl-templates – Diff between revs 6 and 29
?pathlinks?
Rev 6 | Rev 29 | |||
---|---|---|---|---|
Line 1... | Line 1... | |||
1 | /////////////////////////////////////////////////////////////////////////// |
1 | /////////////////////////////////////////////////////////////////////////// |
|
2 | // Copyright (C) Wizardry and Steamworks 2014 - License: GNU GPLv3 // |
2 | // Copyright (C) Wizardry and Steamworks 2014 - License: CC BY 2.0 // |
|
3 | /////////////////////////////////////////////////////////////////////////// |
3 | /////////////////////////////////////////////////////////////////////////// |
|
4 | // |
4 | // |
|
5 | // This is an automated hunt system template that illustrates various |
5 | // This is an automated hunt system template that illustrates various |
|
6 | // Corrade commands. You can find out more about the Corrade bot by |
6 | // Corrade commands. You can find out more about the Corrade bot by |
|
7 | // following the URL: http://was.fm/secondlife/scripted_agents/corrade |
7 | // following the URL: http://was.fm/secondlife/scripted_agents/corrade |
|
Line 29... | Line 29... | |||
29 | // Kira Komarov in-world directly. |
29 | // Kira Komarov in-world directly. |
|
30 | // |
30 | // |
|
31 | // This script works together with a "configuration" notecard that must be |
31 | // This script works together with a "configuration" notecard that must be |
|
32 | // placed in the same primitive as this script. The purpose of this script |
32 | // placed in the same primitive as this script. The purpose of this script |
|
33 | // to demonstrate an automated hunt system using Corrade and you are free |
33 | // to demonstrate an automated hunt system using Corrade and you are free |
|
34 | // to use, change, and commercialize it under the GNU/GPLv3 license at: |
34 | // to use, change, and commercialize it under the CC BY 2.0 license at: |
|
35 | // http://www.gnu.org/licenses/gpl.html |
35 | // https://creativecommons.org/licenses/by/2.0 |
|
36 | // |
36 | // |
|
37 | /////////////////////////////////////////////////////////////////////////// |
37 | /////////////////////////////////////////////////////////////////////////// |
|
Line 38... | Line 38... | |||
38 | |
38 | |
|
39 | /////////////////////////////////////////////////////////////////////////// |
39 | /////////////////////////////////////////////////////////////////////////// |
|
40 | // Copyright (C) 2014 Wizardry and Steamworks - License: GNU GPLv3 // |
40 | // Copyright (C) 2014 Wizardry and Steamworks - License: CC BY 2.0 // |
|
41 | /////////////////////////////////////////////////////////////////////////// |
41 | /////////////////////////////////////////////////////////////////////////// |
|
42 | string wasKeyValueGet(string k, string data) { |
42 | string wasKeyValueGet(string k, string data) { |
|
43 | if(llStringLength(data) == 0) return ""; |
43 | if(llStringLength(data) == 0) return ""; |
|
44 | if(llStringLength(k) == 0) return ""; |
44 | if(llStringLength(k) == 0) return ""; |
|
Line 47... | Line 47... | |||
47 | if(i != -1) return llList2String(a, i+1); |
47 | if(i != -1) return llList2String(a, i+1); |
|
48 | return ""; |
48 | return ""; |
|
49 | } |
49 | } |
|
Line 50... | Line 50... | |||
50 | |
50 | |
|
51 | /////////////////////////////////////////////////////////////////////////// |
51 | /////////////////////////////////////////////////////////////////////////// |
|
52 | // Copyright (C) 2013 Wizardry and Steamworks - License: GNU GPLv3 // |
52 | // Copyright (C) 2013 Wizardry and Steamworks - License: CC BY 2.0 // |
|
53 | /////////////////////////////////////////////////////////////////////////// |
53 | /////////////////////////////////////////////////////////////////////////// |
|
54 | string wasKeyValueEncode(list data) { |
54 | string wasKeyValueEncode(list data) { |
|
55 | list k = llList2ListStrided(data, 0, -1, 2); |
55 | list k = llList2ListStrided(data, 0, -1, 2); |
|
56 | list v = llList2ListStrided(llDeleteSubList(data, 0, 0), 0, -1, 2); |
56 | list v = llList2ListStrided(llDeleteSubList(data, 0, 0), 0, -1, 2); |
|
Line 62... | Line 62... | |||
62 | } while(llGetListLength(k) != 0); |
62 | } while(llGetListLength(k) != 0); |
|
63 | return llDumpList2String(data, "&"); |
63 | return llDumpList2String(data, "&"); |
|
64 | } |
64 | } |
|
Line 65... | Line 65... | |||
65 | |
65 | |
|
66 | /////////////////////////////////////////////////////////////////////////// |
66 | /////////////////////////////////////////////////////////////////////////// |
|
67 | // Copyright (C) 2013 Wizardry and Steamworks - License: GNU GPLv3 // |
67 | // Copyright (C) 2013 Wizardry and Steamworks - License: CC BY 2.0 // |
|
68 | /////////////////////////////////////////////////////////////////////////// |
68 | /////////////////////////////////////////////////////////////////////////// |
|
69 | integer wasListCountExclude(list input, list exclude) { |
69 | integer wasListCountExclude(list input, list exclude) { |
|
70 | if(llGetListLength(input) == 0) return 0; |
70 | if(llGetListLength(input) == 0) return 0; |
|
71 | if(llListFindList(exclude, (list)llList2String(input, 0)) == -1) |
71 | if(llListFindList(exclude, (list)llList2String(input, 0)) == -1) |
|
72 | return 1 + wasListCountExclude(llDeleteSubList(input, 0, 0), exclude); |
72 | return 1 + wasListCountExclude(llDeleteSubList(input, 0, 0), exclude); |
|
73 | return wasListCountExclude(llDeleteSubList(input, 0, 0), exclude); |
73 | return wasListCountExclude(llDeleteSubList(input, 0, 0), exclude); |
|
Line 74... | Line 74... | |||
74 | } |
74 | } |
|
75 | |
75 | |
|
76 | /////////////////////////////////////////////////////////////////////////// |
76 | /////////////////////////////////////////////////////////////////////////// |
|
77 | // Copyright (C) 2015 Wizardry and Steamworks - License: GNU GPLv3 // |
77 | // Copyright (C) 2015 Wizardry and Steamworks - License: CC BY 2.0 // |
|
78 | /////////////////////////////////////////////////////////////////////////// |
78 | /////////////////////////////////////////////////////////////////////////// |
|
79 | // escapes a string in conformance with RFC1738 |
79 | // escapes a string in conformance with RFC1738 |
|
80 | string wasURLEscape(string i) { |
80 | string wasURLEscape(string i) { |
|
Line 96... | Line 96... | |||
96 | } while(i != ""); |
96 | } while(i != ""); |
|
97 | return o; |
97 | return o; |
|
98 | } |
98 | } |
|
Line 99... | Line 99... | |||
99 | |
99 | |
|
100 | /////////////////////////////////////////////////////////////////////////// |
100 | /////////////////////////////////////////////////////////////////////////// |
|
101 | // Copyright (C) 2015 Wizardry and Steamworks - License: GNU GPLv3 // |
101 | // Copyright (C) 2015 Wizardry and Steamworks - License: CC BY 2.0 // |
|
102 | /////////////////////////////////////////////////////////////////////////// |
102 | /////////////////////////////////////////////////////////////////////////// |
|
103 | // unescapes a string in conformance with RFC1738 |
103 | // unescapes a string in conformance with RFC1738 |
|
104 | string wasURLUnescape(string i) { |
104 | string wasURLUnescape(string i) { |
|
105 | return llUnescapeURL( |
105 | return llUnescapeURL( |
|
Line 120... | Line 120... | |||
120 | ) |
120 | ) |
|
121 | ); |
121 | ); |
|
122 | } |
122 | } |
|
Line 123... | Line 123... | |||
123 | |
123 | |
|
124 | /////////////////////////////////////////////////////////////////////////// |
124 | /////////////////////////////////////////////////////////////////////////// |
|
125 | // Copyright (C) 2015 Wizardry and Steamworks - License: GNU GPLv3 // |
125 | // Copyright (C) 2015 Wizardry and Steamworks - License: CC BY 2.0 // |
|
126 | /////////////////////////////////////////////////////////////////////////// |
126 | /////////////////////////////////////////////////////////////////////////// |
|
127 | string wasListToCSV(list l) { |
127 | string wasListToCSV(list l) { |
|
128 | list v = []; |
128 | list v = []; |
|
129 | do { |
129 | do { |
|
Line 149... | Line 149... | |||
149 | } while(l != []); |
149 | } while(l != []); |
|
150 | return llDumpList2String(v, ","); |
150 | return llDumpList2String(v, ","); |
|
151 | } |
151 | } |
|
Line 152... | Line 152... | |||
152 | |
152 | |
|
153 | /////////////////////////////////////////////////////////////////////////// |
153 | /////////////////////////////////////////////////////////////////////////// |
|
154 | // Copyright (C) 2015 Wizardry and Steamworks - License: GNU GPLv3 // |
154 | // Copyright (C) 2015 Wizardry and Steamworks - License: CC BY 2.0 // |
|
155 | /////////////////////////////////////////////////////////////////////////// |
155 | /////////////////////////////////////////////////////////////////////////// |
|
156 | list wasCSVToList(string csv) { |
156 | list wasCSVToList(string csv) { |
|
157 | list l = []; |
157 | list l = []; |
|
158 | list s = []; |
158 | list s = []; |