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 menu selector for the Corrade bot that is capable of replying |
5 | // This is a menu selector for the Corrade bot that is capable of replying |
|
6 | // to dialog requests while supporting several nested levels of menus. You |
6 | // to dialog requests while supporting several nested levels of menus. You |
|
7 | // can find out more about the Corrade bot by following the URL: |
7 | // can find out more about the Corrade bot by following the URL: |
|
8 | // http://was.fm/secondlife/scripted_agents/corrade |
8 | // http://was.fm/secondlife/scripted_agents/corrade |
|
9 | // |
9 | // |
|
10 | // The sit script works together with a "configuration" notecard that must |
10 | // The sit script works together with a "configuration" notecard that must |
|
11 | // be placed in the same primitive as this script. The purpose of this |
11 | // be placed in the same primitive as this script. The purpose of this |
|
12 | // script is to demonstrate answering dialogs with Corrade and you are free |
12 | // script is to demonstrate answering dialogs with Corrade and you are free |
|
13 | // to use, change, and commercialize it under the GNU/GPLv3 license at: |
13 | // to use, change, and commercialize it under the CC BY 2.0 license at: |
|
14 | // http://www.gnu.org/licenses/gpl.html |
14 | // https://creativecommons.org/licenses/by/2.0 |
|
15 | // |
15 | // |
|
16 | /////////////////////////////////////////////////////////////////////////// |
16 | /////////////////////////////////////////////////////////////////////////// |
|
Line 17... | Line 17... | |||
17 | |
17 | |
|
18 | /////////////////////////////////////////////////////////////////////////// |
18 | /////////////////////////////////////////////////////////////////////////// |
|
19 | // Copyright (C) 2014 Wizardry and Steamworks - License: GNU GPLv3 // |
19 | // Copyright (C) 2014 Wizardry and Steamworks - License: CC BY 2.0 // |
|
20 | /////////////////////////////////////////////////////////////////////////// |
20 | /////////////////////////////////////////////////////////////////////////// |
|
21 | string wasKeyValueGet(string k, string data) { |
21 | string wasKeyValueGet(string k, string data) { |
|
22 | if(llStringLength(data) == 0) return ""; |
22 | if(llStringLength(data) == 0) return ""; |
|
23 | if(llStringLength(k) == 0) return ""; |
23 | if(llStringLength(k) == 0) return ""; |
|
Line 26... | Line 26... | |||
26 | if(i != -1) return llList2String(a, i+1); |
26 | if(i != -1) return llList2String(a, i+1); |
|
27 | return ""; |
27 | return ""; |
|
28 | } |
28 | } |
|
Line 29... | Line 29... | |||
29 | |
29 | |
|
30 | /////////////////////////////////////////////////////////////////////////// |
30 | /////////////////////////////////////////////////////////////////////////// |
|
31 | // Copyright (C) 2013 Wizardry and Steamworks - License: GNU GPLv3 // |
31 | // Copyright (C) 2013 Wizardry and Steamworks - License: CC BY 2.0 // |
|
32 | /////////////////////////////////////////////////////////////////////////// |
32 | /////////////////////////////////////////////////////////////////////////// |
|
33 | string wasKeyValueEncode(list data) { |
33 | string wasKeyValueEncode(list data) { |
|
34 | list k = llList2ListStrided(data, 0, -1, 2); |
34 | list k = llList2ListStrided(data, 0, -1, 2); |
|
35 | list v = llList2ListStrided(llDeleteSubList(data, 0, 0), 0, -1, 2); |
35 | list v = llList2ListStrided(llDeleteSubList(data, 0, 0), 0, -1, 2); |
|
Line 41... | Line 41... | |||
41 | } while(llGetListLength(k) != 0); |
41 | } while(llGetListLength(k) != 0); |
|
42 | return llDumpList2String(data, "&"); |
42 | return llDumpList2String(data, "&"); |
|
43 | } |
43 | } |
|
Line 44... | Line 44... | |||
44 | |
44 | |
|
45 | /////////////////////////////////////////////////////////////////////////// |
45 | /////////////////////////////////////////////////////////////////////////// |
|
46 | // Copyright (C) 2013 Wizardry and Steamworks - License: GNU GPLv3 // |
46 | // Copyright (C) 2013 Wizardry and Steamworks - License: CC BY 2.0 // |
|
47 | /////////////////////////////////////////////////////////////////////////// |
47 | /////////////////////////////////////////////////////////////////////////// |
|
48 | integer wasListCountExclude(list input, list exclude) { |
48 | integer wasListCountExclude(list input, list exclude) { |
|
49 | if(llGetListLength(input) == 0) return 0; |
49 | if(llGetListLength(input) == 0) return 0; |
|
50 | if(llListFindList(exclude, (list)llList2String(input, 0)) == -1) |
50 | if(llListFindList(exclude, (list)llList2String(input, 0)) == -1) |