corrade-lsl-templates – Diff between revs 5 and 29
?pathlinks?
Rev 5 | 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 a script that uses Corrade to change the texture on the |
5 | // This is a script that uses Corrade to change the texture on the |
|
6 | // available faces of the primitie. It requires that you have a Corrade bot |
6 | // available faces of the primitie. It requires that you have a Corrade bot |
|
7 | // with the following permissions enabled for the group specified in the |
7 | // with the following permissions enabled for the group specified in the |
|
Line 16... | Line 16... | |||
16 | // Contact -> Friends -> [ Bot ] -> Friend can edit, delete, take objects. |
16 | // Contact -> Friends -> [ Bot ] -> Friend can edit, delete, take objects. |
|
17 | // |
17 | // |
|
18 | // The sit script works together with a "configuration" notecard that must |
18 | // The sit script works together with a "configuration" notecard that must |
|
19 | // be placed in the same primitive as this script. The purpose of this |
19 | // be placed in the same primitive as this script. The purpose of this |
|
20 | // script is to demonstrate changing textures with Corrade and you are free |
20 | // script is to demonstrate changing textures with Corrade and you are free |
|
21 | // to use, change, and commercialize it under the GNU/GPLv3 license at: |
21 | // to use, change, and commercialize it under the CC BY 2.0 license at: |
|
22 | // http://www.gnu.org/licenses/gpl.html |
22 | // https://creativecommons.org/licenses/by/2.0 |
|
23 | // |
23 | // |
|
24 | /////////////////////////////////////////////////////////////////////////// |
24 | /////////////////////////////////////////////////////////////////////////// |
|
Line 25... | Line 25... | |||
25 | |
25 | |
|
26 | /////////////////////////////////////////////////////////////////////////// |
26 | /////////////////////////////////////////////////////////////////////////// |
|
27 | // Copyright (C) 2015 Wizardry and Steamworks - License: GNU GPLv3 // |
27 | // Copyright (C) 2015 Wizardry and Steamworks - License: CC BY 2.0 // |
|
28 | /////////////////////////////////////////////////////////////////////////// |
28 | /////////////////////////////////////////////////////////////////////////// |
|
29 | string wasKeyValueGet(string k, string data) { |
29 | string wasKeyValueGet(string k, string data) { |
|
30 | if(llStringLength(data) == 0) return ""; |
30 | if(llStringLength(data) == 0) return ""; |
|
31 | if(llStringLength(k) == 0) return ""; |
31 | if(llStringLength(k) == 0) return ""; |
|
Line 34... | Line 34... | |||
34 | if(i != -1) return llList2String(a, 2*i+1); |
34 | if(i != -1) return llList2String(a, 2*i+1); |
|
35 | return ""; |
35 | return ""; |
|
36 | } |
36 | } |
|
Line 37... | Line 37... | |||
37 | |
37 | |
|
38 | /////////////////////////////////////////////////////////////////////////// |
38 | /////////////////////////////////////////////////////////////////////////// |
|
39 | // Copyright (C) 2013 Wizardry and Steamworks - License: GNU GPLv3 // |
39 | // Copyright (C) 2013 Wizardry and Steamworks - License: CC BY 2.0 // |
|
40 | /////////////////////////////////////////////////////////////////////////// |
40 | /////////////////////////////////////////////////////////////////////////// |
|
41 | string wasKeyValueEncode(list data) { |
41 | string wasKeyValueEncode(list data) { |
|
42 | list k = llList2ListStrided(data, 0, -1, 2); |
42 | list k = llList2ListStrided(data, 0, -1, 2); |
|
43 | list v = llList2ListStrided(llDeleteSubList(data, 0, 0), 0, -1, 2); |
43 | list v = llList2ListStrided(llDeleteSubList(data, 0, 0), 0, -1, 2); |
|
Line 49... | Line 49... | |||
49 | } while(llGetListLength(k) != 0); |
49 | } while(llGetListLength(k) != 0); |
|
50 | return llDumpList2String(data, "&"); |
50 | return llDumpList2String(data, "&"); |
|
51 | } |
51 | } |
|
Line 52... | Line 52... | |||
52 | |
52 | |
|
53 | /////////////////////////////////////////////////////////////////////////// |
53 | /////////////////////////////////////////////////////////////////////////// |
|
54 | // Copyright (C) 2011 Wizardry and Steamworks - License: GNU GPLv3 // |
54 | // Copyright (C) 2011 Wizardry and Steamworks - License: CC BY 2.0 // |
|
55 | /////////////////////////////////////////////////////////////////////////// |
55 | /////////////////////////////////////////////////////////////////////////// |
|
56 | vector wasCirclePoint(float radius) { |
56 | vector wasCirclePoint(float radius) { |
|
57 | float x = llPow(-1, 1 + (integer) llFrand(2)) * llFrand(radius*2); |
57 | float x = llPow(-1, 1 + (integer) llFrand(2)) * llFrand(radius*2); |
|
58 | float y = llPow(-1, 1 + (integer) llFrand(2)) * llFrand(radius*2); |
58 | float y = llPow(-1, 1 + (integer) llFrand(2)) * llFrand(radius*2); |
|
59 | if(llPow(x,2) + llPow(y,2) <= llPow(radius,2)) |
59 | if(llPow(x,2) + llPow(y,2) <= llPow(radius,2)) |
|
60 | return <x, y, 0>; |
60 | return <x, y, 0>; |
|
61 | return wasCirclePoint(radius); |
61 | return wasCirclePoint(radius); |
|
Line 62... | Line 62... | |||
62 | } |
62 | } |
|
63 | |
63 | |
|
64 | /////////////////////////////////////////////////////////////////////////// |
64 | /////////////////////////////////////////////////////////////////////////// |
|
65 | // Copyright (C) 2015 Wizardry and Steamworks - License: GNU GPLv3 // |
65 | // Copyright (C) 2015 Wizardry and Steamworks - License: CC BY 2.0 // |
|
66 | /////////////////////////////////////////////////////////////////////////// |
66 | /////////////////////////////////////////////////////////////////////////// |
|
67 | // escapes a string in conformance with RFC1738 |
67 | // escapes a string in conformance with RFC1738 |
|
68 | string wasURLEscape(string i) { |
68 | string wasURLEscape(string i) { |
|
Line 84... | Line 84... | |||
84 | } while(i != ""); |
84 | } while(i != ""); |
|
85 | return o; |
85 | return o; |
|
86 | } |
86 | } |
|
Line 87... | Line 87... | |||
87 | |
87 | |
|
88 | /////////////////////////////////////////////////////////////////////////// |
88 | /////////////////////////////////////////////////////////////////////////// |
|
89 | // Copyright (C) 2015 Wizardry and Steamworks - License: GNU GPLv3 // |
89 | // Copyright (C) 2015 Wizardry and Steamworks - License: CC BY 2.0 // |
|
90 | /////////////////////////////////////////////////////////////////////////// |
90 | /////////////////////////////////////////////////////////////////////////// |
|
91 | // unescapes a string in conformance with RFC1738 |
91 | // unescapes a string in conformance with RFC1738 |
|
92 | string wasURLUnescape(string i) { |
92 | string wasURLUnescape(string i) { |
|
93 | return llUnescapeURL( |
93 | return llUnescapeURL( |
|
Line 108... | Line 108... | |||
108 | ) |
108 | ) |
|
109 | ); |
109 | ); |
|
110 | } |
110 | } |
|
Line 111... | Line 111... | |||
111 | |
111 | |
|
112 | /////////////////////////////////////////////////////////////////////////// |
112 | /////////////////////////////////////////////////////////////////////////// |
|
113 | // Copyright (C) 2015 Wizardry and Steamworks - License: GNU GPLv3 // |
113 | // Copyright (C) 2015 Wizardry and Steamworks - License: CC BY 2.0 // |
|
114 | /////////////////////////////////////////////////////////////////////////// |
114 | /////////////////////////////////////////////////////////////////////////// |
|
115 | list wasCSVToList(string csv) { |
115 | list wasCSVToList(string csv) { |
|
116 | list l = []; |
116 | list l = []; |
|
117 | list s = []; |
117 | list s = []; |
|
Line 147... | Line 147... | |||
147 | // postcondition: length(s) = 0 |
147 | // postcondition: length(s) = 0 |
|
148 | return l + m; |
148 | return l + m; |
|
149 | } |
149 | } |
|
Line 150... | Line 150... | |||
150 | |
150 | |
|
151 | /////////////////////////////////////////////////////////////////////////// |
151 | /////////////////////////////////////////////////////////////////////////// |
|
152 | // Copyright (C) 2015 Wizardry and Steamworks - License: GNU GPLv3 // |
152 | // Copyright (C) 2015 Wizardry and Steamworks - License: CC BY 2.0 // |
|
153 | /////////////////////////////////////////////////////////////////////////// |
153 | /////////////////////////////////////////////////////////////////////////// |
|
154 | string wasListToCSV(list l) { |
154 | string wasListToCSV(list l) { |
|
155 | list v = []; |
155 | list v = []; |
|
156 | do { |
156 | do { |