corrade-lsl-templates – Diff between revs 29 and 39

Subversion Repositories:
Rev:
Show entire fileIgnore whitespace
Rev 29 Rev 39
Line 1... Line 1...
1 /////////////////////////////////////////////////////////////////////////// 1 ///////////////////////////////////////////////////////////////////////////
2 // Copyright (C) Wizardry and Steamworks 2014 - License: CC BY 2.0 // 2 // Copyright (C) Wizardry and Steamworks 2014 - License: CC BY 2.0 //
3 /////////////////////////////////////////////////////////////////////////// 3 ///////////////////////////////////////////////////////////////////////////
4 // -  
5 // This project makes Corrade, the Second Life / OpenSim bot track all the -  
6 // visitors on a region and record information to the group database. More -  
7 // information on the Corrade Second Life / OpenSim scripted agent can be -  
8 // found at the URL: http://grimore.org/secondlife/scripted_agents/corrade -  
9 // -  
10 // The script works in combination with a "configuration" notecard that -  
11 // must be placed in the same primitive as this script. The purpose of this -  
12 // script is to illustrate the Corrade built-in group database features -  
13 // and you are free to use, change, and commercialize it under the terms -  
14 // of the CC BY 2.0 license at: https://creativecommons.org/licenses/by/2.0 -  
15 // -  
16 /////////////////////////////////////////////////////////////////////////// -  
Line 17... Line 4...
17   4  
18 /////////////////////////////////////////////////////////////////////////// 5 ///////////////////////////////////////////////////////////////////////////
19 // Copyright (C) 2014 Wizardry and Steamworks - License: CC BY 2.0 // 6 // Copyright (C) 2015 Wizardry and Steamworks - License: CC BY 2.0 //
20 /////////////////////////////////////////////////////////////////////////// 7 ///////////////////////////////////////////////////////////////////////////
21 string wasKeyValueGet(string k, string data) { 8 string wasKeyValueGet(string k, string data) {
22 if(llStringLength(data) == 0) return ""; 9 if(llStringLength(data) == 0) return "";
23 if(llStringLength(k) == 0) return ""; 10 if(llStringLength(k) == 0) return "";
24 list a = llParseString2List(data, ["&", "="], []); 11 list a = llParseStringKeepNulls(data, ["&", "="], []);
25 integer i = llListFindList(a, [ k ]); 12 integer i = llListFindList(llList2ListStrided(a, 0, -1, 2), [ k ]);
26 if(i != -1) return llList2String(a, i+1); 13 if(i != -1) return llList2String(a, 2*i+1);
27 return ""; 14 return "";
Line 28... Line 15...
28 } 15 }
29 16