Jump to content

irihapeti

Resident
  • Posts

    1,689
  • Joined

  • Last visited

Everything posted by irihapeti

  1. yes scripted good then is pretty much perfect for what OP wants to do
  2. dunno if is appropriate to post but is a box. Inside the box (parent) is a copy of the box (child) the parent box rez/spawn the child. The parent gives the child a copy of itself (baby). The child is now a parent am not going to post the codes how to do this tho bc many children can have many babies. Is not hard to code this up. Is just that you kinda on your own when go down this path. [ETA] if you mess it up in testing then can upset LL
  3. your understanding of the publishing rules for crediting sources is on the same level as your understanding of the ToS
  4. LepreKhaun wrote: irihapeti wrote: LepreKhaun wrote: We've already shown that I "invented" nothing that you're making use of in your code. the last example in the test codes clearly shows how your invention is used Where you're relying on return r + enU((enB & 0xFF) + 0x8800); Which is YOUR OWN, original code. I had suggested an entirely different approach, for an entirely different program you'd written and my suggestion was merely what any intermediate programmer that was familiar with the subject and the literature of those that had worked within it would see as obvious. As Nexii Malthus did FIVE YEARS AGO. "My invention", sheesh! Next you'll be crediting me with inventing the Marketplace. I can't help you get your facts straight but that credit you give IS inappropriate, and I have no idea why you can't see it. that I changed the map location dont negate the design. No more than me changing the codes I get of Strife from << & to & << does. [ETA} and removing Becky's code from deU and changing it to a >> & mod to show symmetry seems to me that your main objection is to the test code examples. From which you seem to be extrapolating everything else. I made a mod to these to better show your design contribution for which you been properly credited
  5. LepreKhaun wrote: We've already shown that I "invented" nothing that you're making use of in your code. the last example in the test codes clearly shows how your invention is used
  6. LepreKhaun wrote: You're working on key compression using what is known as a "Base 32768 Scheme". Basically this means splitting the 128 bits of a UUID key into 8 groups of 16 bits each and then encoding 9 UTF16 characters within the Unicode BMP (Basic Multilingual Plane) from them. This work apparently was started from a (somewhat off-topic) discussion in March of 2009 found here starting with "Stephen Psaltery 2009-03-27 13:40:06-04" that includes Kelly Linden's response (which compressed a key to 22 characters) through Doran Zemlja's first compression to 9 UTF16 characters. Doran's implementation was later tweaked by their coding partner, Adam Wozniak, and Haravikk Mistral then included that version in a collection of compression schemes they had assembled (many of which were their own). At the same time, Becky Pippen was also working on compression schemes that also (early on) used llUnescapeURL() to form UTC code points. Their work (here, here and primarily here) gives the best definition of the problem and (more importantly) gives the links to the reference material to properly understand both the problem as well as the offered solutions. What is of note is that these early solutions all relied on llUnescapeURL() to obtain the final result and it was Strife Onizuka who made the radical suggestion in Jan of 2010 to use llBase64ToString(llIntegerToBase64()), which was based upon their work of the Combined Library, dating from 2008. This approach was proven to be superior in both time and memory usage (a rare combination, it's usually one or the other). And that's about the sum of it- some great coders figured out this algorithm after untold hours of study and experimentations, published their results for the rest of us to use and Strife directed these early studies in the direction which you finally chose to modify. You might notice the lack of my name in this list and for good reason: I not only had not yet joined Second Life at that point, I'll always be several ranks below the coding ability of any of those mentioned. In other words, I'm not only not in the same league as these coders, I wasn't even playing when they took to the field and worked all this out. I have never knowingly nor willingly made any contribution towards any of your efforts that you could use my name without permission after the fact. Including my name with such as these coding greats is not flattering, nor is it appropriate. In fact, it is an embarrassment that I humbly beg you to forgo your stubborn, contrary arguments and simply remove the inappropriate credit from your code. PLEASE! if I am being stubborn (and I am actual not) is bc of the credit/citation publishing rules + in all the previous LSL literature and works on encoding LSL keys to UTF-16 compatible chars is no mention anywhere to map the end buffer character to a different BMP section to enable llSubStringIndex to find UTF-16 compatible encoded keys in a string table without cross-boundary conflict/collision. Maybe someone somewhere else maybe did already think of it, but is not in the literature. You put it into the public domain literature [ETA] in a convo we were having about it elsewhere. So you get cited in this LSL published works for this invention LepreKhaun you either invented this or you didnt. Is nothing in the prior literature or in what you have said to suggest that you didnt. So you get cited as the design inventor of the end buffer character mapping if you (or anyone reading) can show somebody else who prior publish a LSL work with this end coding design invention or prior made such a suggestion in any LSL forums then I will change the citation/credit to them as is proper. I am not going to change the citation without this. bc is a code submission to the LL LSL library. Is not just some codes I pasted to some random forum chat + aww gosh imma not that great !!! is not grounds for a non-citation in a published work. bc credit/citation publishing rules. Nobody gets to choose which of these rules applies to them just bc of how they feel if I did remove the citation then I would have to remove the script bc of the rules. I am not going to remove the script just bc awww! gosh so either come up with another person as the design inventor to get yourself off the credit/citation list or your name stays as it must by the rules
  7. that a person may choose to implement their own use case with a extra visual cue delimiter for their own copypasta purposes dont negate the importance of the design change for those users who will implement string tables natively i can no more not acknowledge your design contribution to the algo than I can not acknowledge people like Horst Feistel in other works I might publish. Would be unprofessional for me to not acknowledge. you, him or anyone else
  8. changing the end character encoding doesnt mean that the pipeset is only now redundant. It was always redundant bc fixed length of 9 chars for (i == 0; i < lenset; i += 9) k = UTF2Key(llGetSubString(set, i, i + 8)); is the same code that would be used for both old and new end encodings + it maybe that you had a impression that the first iteration was returning variable length codes. It wasnt, they were always 9 char lengths for all + Pipe sets was a use case raised in the first convo. Why the user chose to do that may simply have been so that when copypasta they got a visual cue that they did have the number of keys intended. At some loss of storage space copypasta can have visual side effects depending on OS and fonts installed which can be visually confusing sometimes. Inserting an extra delimiter like | or ~ or , etc can be a aid to helping with this (at some loss of storage space) i just coded this into the test to show how pipe/delimited sets may be encoded and decoded for that particular use case raised in the convo + is also true for old and new that with pipesets then this works also for (i == 0; i < lenset; i += 10) k = UTF2Key(llGetSubString(set, i, i + 8)); + if you wish to rewrite the test codes or even mod the whole thing as a help to intending users/readers then you are free to do this
  9. they examples of how it can be used the string table example shows how to read and write native sets the pipeset example shows how to format for that use case
  10. i give you credit bc of the change to the end buffer character mapping. Is a really signicant change this. It allow multiple keys (self-terminating) to be stored in strings without cross-boundary conflict/collision this change is a design change and a reallly good one can see that I remapped to range 0x8800..0x88FF so that can be encoded/decoded using the same conversion code. But without your design change suggestion it wouldnt have happened in this codes good design is what I think is all about Adam and Zoran get credits bc of their design pioneering works in this field. Becky get a credit for advancing those designs and pioneering works herself. And bc CCby3 license, in the case of Combined Library. Assume Becky also CCby3 bc unspecified I changed their designs to encode right-to-left instead of left-to-right to enable simpler decoding. Strife suggest to change the design to eliminate using int2hex in the encoding. You LepreKhaun suggest to change the design to enable self-terminating encoded keys So like the others mentioned you deserve a credit for your contribution to the design. Is a design credit this. Is fully justified this and one I will always give you I made a small change to the script credits text to reflect this a little bit better
  11. sometimes you might want a "random" arrangement (sequence) of unique numbers from some large ordinal set that cant fit in a list or string. "random" as in pseudorandom this script can help with this. Is a script I done about 2 years ago now. I just tidy it up a bit for to post here + I do just for fun really these kinda things. I quite like solving puzzles. How many how few how fast how high how low. stuff like that. I just like to know bc nosey (: anyways. If want more reading on how feistel network and galois lfsr work then: http://en.wikipedia.org/wiki/Feistel_network http://en.wikipedia.org/wiki/Linear_feedback_shift_register + the codes // example pseudorandom arrangement of a ordinal set // Public Domain May 2014 by elizabeth (irihapeti)(16) // credits: Horst Feistel, Evariste Galois // can mod and use as you like // // makes a "random" arrangement) of the set[0 < magnitude] // where magnitude in [1..0x7FFFFFFE] // see test codes at bottom for usage // // notes // - the same magnitude and seed (raM + raS) will always // return the same arrangement as wrote // - cannot return all arrangements of a set. use a knuth // shuffle algo if you need that // initial defaults. are changed in the codes integer raM = 1; // magnitude of arrangement. not less than 1 integer raS = 1; // seed for arrangement. cannot be 0 integer raL = 1; // lo factor of magnitude integer raH = 1; // hi factor of magnitude integer raR = 8; // count of mixing rounds integer raI = 0; // current position in arrangement // galois lfsr pseudorandom number generator integer raN; // state generated by rnD integer raD(integer m) { raN = (raN >> 1) ^ (-(raN & 0x1) & 0xD0000001); return (raN & 0x7FFFFFFF) % m; } // brute factor magnitude raF() { raL = (integer)llSqrt(raM); integer n = 1 + (raM & 0x1); raL -= ((!(raL & 0x1)) && (n == 2)); for (; (raL > 2) && (raM % raL); raL -= n); raH = raM / raL; } // get next number in arrangement // will roll over when arrangement is exhausted // arithmetic feistel network integer raNext() { raN = raS; raI++; if (raI == raM) raI = 0; integer n = raI; integer i; for (i = 0; i < raR; i++) { integer m = n ^ raD(raM); if (m < raM) n = m; integer a = n % raL; integer b = n / raL; m = b % raL; a = (a + (m * m) + raD(raH)) % raL; m = a % raH; b = (b + (m * m) + raD(raL)) % raH; n = (a * raH) + b; } return n; } // call this to initialise raInit(integer m) { // set the magnitude. should not be > 0x7FFFFFFE else overflow // should always be at least 1 element in arrangement if ((m < 1) || (m > 0x7FFFFFFE)) m = 1; // factor when m changes raM if (m != raM) { raM = m; raF(); } // seed with some value. set raS to a constant value to produce // same arrangement for same magnitude // raS = yourseed; raS = (integer)llFrand(0x10000) << 16 | (integer)llFrand(0x10000); // uses galois lfsr so raS should never be 0 if (raS == 0) raS = 1; // seed the rnd raN = raS; // pick either 7 or 8 rounds. comment out if happy with 8 raR = 8 - raD(2); // pick a place to start in the arrangement raI = raD(raM); } // --- some test code --- default { touch_start(integer total_number) { llOwnerSay("begin... arrange 0..9"); integer mag = 10; raInit(mag); integer i; for (i = 0; i < mag; i++) llOwnerSay((string)i + " : " + (string)raNext()); llOwnerSay("...end"); llOwnerSay("begin... arrange 0..0x7FFFFFFD"); mag = 0x7FFFFFFE; raInit(mag); for (i = 0; i < 10; i++) llOwnerSay((string)i + " : " + (string)raNext()); llOwnerSay("...end"); } }
  12. this the latest iteration of encoding and decoding keys stored in UTF16 strings. Is called oranges encoder it started as a convo on sluniverse. The convo moved to here LSL Library forum. Then to LSL Scripting forum. Thru the convo was 4 iterations of this based on feedback and eagle eyes and ideas of other scripters so thanks to all them who contributed to it and also thanks to the earlier works by other scripters on the lsl wiki portal (: They all named in the script and bc their contributions are mostly CCby3 then if publish/post/distribute then you need maintain their credits ok. For mine credits then dont worry about it bc I just put anything I do in public domain bc I dont publish/write much public code anyways + just about CCby3 credits. Why scripters do this mostly is bc they do scripting/programming for a living in whole or part. Is the whole giving back thing also which people do as well, but credits helps them to get their name out there which helps them get paid work and feed themself and family. So just do it ok + ETA: changes to credit texts in the script to reflect contributiions better. See convo below ++ ETA again: Have modded to this version 1b. functions enU() and deU() to make more clear which bits are being encoded to UTF. The mod to deU also shows better the symmetry between encoding and decoding. the codes produced by version 1b are compatible with 1a +++ ETA again. changes to test code examples and change the words "design contributions" to "design credits". See convo below + ok here is // example key encoder decoder // version: oranges 1b // public domain May 2014 by elizabeth (irihapeti) // a mod of works (CCby0 and CCby3) by: Adam Wozniak, Doran Zemlja, // Becky Pippen, Combined Library // design credits: All named above plus Strife Onizuka, LepreKhaun // with mentions for exacts in the codes // also with new test code examples // // encodes a key (uuid) into a string of 9 UTF16 chars. 18 bytes // str = Key2UTF(key) // key = UTF2Key(str) // // UTF16 codes produced are copypasta into scripts and notecards in // SL viewers // 3.7.3 (287491) Mar 4 2014 05:01:31 to // 3.7.7 (289405) Apr 21 2014 20:25:08 // on Windows 8.1. Default USA english // dunno about earlier/later versions, LSL Editor or TPVs or other OS // just need be careful when copypasta as // - some UTF glyphs may not be visible but are in the string // - some of them may show as the same glyph. but they are decodeable // so best to Say wrapped in "" for copypasta purposes // // warninkkks !!! is no error trapping !!! if you need that then mod // important !!! codes produced by this version 1b are compatible // with version 1a. Neither version 1a or 1b are compatible with // earlier unversioned iterations of this encoder that were written by // me, due to a encoding change of the end buffer character // // also is wrote this way to show the algos. can mod to inline for own // purposes as you like // -- encoder --- integer enB; string enU(integer n) { // credit: Strife return llBase64ToString(llIntegerToBase64(0xE0808000 | ((n & 0xF000) << 12) | ((n & 0x0FC0) << 10) | ((n & 0x003F) << 8) )); } string enP(integer n) { enB = (enB << 2) | (n & 0x3); return enU(((n >> 2) & 0x7FFF) + 0x800) + enU(((n >> 17) & 0x7FFF) + 0x800); } string Key2UTF(key k) { string s = (string)k; string r = enP((integer)("0x" + llGetSubString(s, 28, 35))) + enP((integer)("0x" + llGetSubString(s, 19, 22) + llGetSubString(s, 24, 27))) + enP((integer)("0x" + llGetSubString(s, 9, 12) + llGetSubString(s, 14, 17))) + enP((integer)("0x" + llGetSubString(s, 0, 7))); return r + enU((enB & 0xFF) + 0x8800); // credit: LepreKhaun } // --- end encoder --- // --- decoder --- integer deB; list deH = ["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"]; integer deU(string s) { integer n = llBase64ToInteger(llStringToBase64(s)); return ((n >> 12) & 0xF000) | ((n >> 10) & 0x0FC0) | ((n >> 8) & 0x003F); } string deP(string s) { integer n = ((deU(llGetSubString(s, 1, 1)) - 0x800) << 17) | ((deU(llGetSubString(s, 0, 0)) - 0x800) << 2) | (deB & 0x3); deB = deB >> 2; return llList2String(deH, (n >> 28) & 0xF) + llList2String(deH, (n >> 24) & 0xF) + llList2String(deH, (n >> 20) & 0xF) + llList2String(deH, (n >> 16) & 0xF) + llList2String(deH, (n >> 12) & 0xF) + llList2String(deH, (n >> 8) & 0xF) + llList2String(deH, (n >> 4) & 0xF) + llList2String(deH, n & 0xF); } key UTF2Key(string s) { deB = deU(llGetSubString(s, 8, 8)) - 0x8800; return (key)( deP(llGetSubString(s, 6, 7)) + "-" + llInsertString(deP(llGetSubString(s, 4, 5)), 4, "-") + "-" + llInsertString(deP(llGetSubString(s, 2, 3)), 4, "-") + deP(llGetSubString(s, 0, 1))); } // --- end decoder --- // --- some test code --- list keys = [ "ffffffff-ffff-ffff-ffff-ffffffffffff", "77777777-7777-7777-8888-888888888888", "88888888-8888-8888-7777-777777777777", "88888888-8888-8888-8888-888888888888", "77777777-7777-7777-7777-777777777777", "01234567-8901-2345-6789-012345678901", "01234567-89ab-cdef-fedc-ba9876543210", "abcdeffe-dcba-abcd-effe-dcbaabcdeffe", "c9012a38-3f29-6ef3-fc21-4380aecd5927", "00000000-0000-0000-0000-000000000000", "77777777-7777-7777-7777-777777777777" // dup test ]; string utft = "蟿蟿蟿蟿蟿蟿蟿蟿裿⨢䱄⨢䱄旝䎻旝䎻裰旝䎻旝䎻⨢䱄⨢䱄蠏⨢䱄⨢䱄⨢䱄⨢䱄蠀旝䎻旝䎻旝䎻旝䎻裿橀⪳䡈㯄僑䲀奙࢑裝ᒄ䌪㚦蝮筻䳕奙࢑裰菿左㼮翿㋳癝菿左袚幉彦壠蘐掼➔劎沀蠳ࠀࠀࠀࠀࠀࠀࠀࠀ蠀"; string utfp = "蟿蟿蟿蟿蟿蟿蟿蟿裿|⨢䱄⨢䱄旝䎻旝䎻裰|旝䎻旝䎻⨢䱄⨢䱄蠏|⨢䱄⨢䱄⨢䱄⨢䱄蠀|旝䎻旝䎻旝䎻旝䎻裿|橀⪳䡈㯄僑䲀奙࢑裝|ᒄ䌪㚦蝮筻䳕奙࢑裰|菿左㼮翿㋳癝菿左袚|幉彦壠蘐掼➔劎沀蠳|ࠀࠀࠀࠀࠀࠀࠀࠀ蠀"; default { touch_end(integer total_number) { key k; key d; list ukeys; string s; string table; integer i; integer x; integer len; // key encode/decode check. read from list keys llOwnerSay("begin... encode/decode check"); len = llGetListLength(keys); for (i = 0; i < len; i++) { k = llList2Key(keys, i); s = Key2UTF(k); d = UTF2Key(s); llOwnerSay("key= " + (string)k + " : \"" + s + "\" : " + (string)d); } llOwnerSay("...end"); // create a string table. adding only unique keys llOwnerSay("begin... add unique keys to string table"); table = ""; len = llGetListLength(keys); for (i = 0; i < len; i++) { k = llList2Key(keys, i); s = Key2UTF(k); if (llSubStringIndex(table, s) >= 0) llOwnerSay("found= \"" + s + "\" : " + (string)k); else table += s; k = llGenerateKey(); s = Key2UTF(k); if (llSubStringIndex(table, s) >= 0) llOwnerSay("found= \"" + s + "\" : " + (string)k); else table += s; } llOwnerSay("...end"); // return position of key in table llOwnerSay("begin... return position of key in table"); len = llGetListLength(keys); for (i = 0; i < len; i++) { k = llList2Key(keys, i); s = Key2UTF(k); x = llSubStringIndex(table, s); llOwnerSay("pos= " + (string)x + " : " + (string)k); } llOwnerSay("...end"); // extract key from table by position llOwnerSay("begin... extract key by position"); len = llStringLength(table); for (x = 0; x < len; x += 9) { s = llGetSubString(table, x, x + 8); k = UTF2Key(s); llOwnerSay("pos= " + (string)x + " : " + (string)k); } llOwnerSay("...end"); // return index of key in table where index in ordinal set [0,1,2,..n] llOwnerSay("begin... return index of key in table"); len = llGetListLength(keys); for (i = 0; i < len; i++) { k = llList2Key(keys, i); s = Key2UTF(k); x = llSubStringIndex(table, s) / 9; llOwnerSay("idx= " + (string)x + " : " + (string)k); } llOwnerSay("...end"); // extract key from table by index llOwnerSay("begin... extract key by index"); len = llStringLength(table) / 9; for (x = 0; x < len; x++) { s = llGetSubString(table, x * 9, (x * 9) + 8); k = UTF2Key(s); llOwnerSay("idx= " + (string)x + " : " + (string)k); } llOwnerSay("...end"); // create table enclosed in "" from list llOwnerSay("begin... create table from list"); len = llGetListLength(keys) - 1; // skip dup test s = "\""; for (i = 0; i < len; i++) { k = llList2Key(keys, i); s += Key2UTF(k); } s += "\""; llOwnerSay(s); llOwnerSay("...end"); // decode to list a table (utft) copypasta into this script llOwnerSay("begin... decode table to list"); ukeys = []; len = llStringLength(utft); for (x = 0; x < len; x += 9) { s = llGetSubString(utft, x, x + 8); ukeys += UTF2Key(s); k = llList2Key(ukeys, -1); llOwnerSay("key= " + (string)k); } llOwnerSay("...end"); // create a pipeset from list at the cost of 1 extra char per key // for visual cue purposes if visual cue needed llOwnerSay("begin... create pipeset separated by |"); len = llGetListLength(keys) - 1; // skip dup test s = "\""; for (i = 0; i < (len - 1); i++) { k = llList2Key(keys, i); s += Key2UTF(k) + "|"; } k = llList2Key(keys, i); s += Key2UTF(k) + "\""; llOwnerSay(s); llOwnerSay("...end"); // decode to list a pipeset (utfp) copypasta into this script llOwnerSay("begin... decode pipeset separated by | to list"); ukeys = []; len = llStringLength(utfp); for (x = 0; x < len; x += 10) { s = llGetSubString(utfp, x, x + 8); ukeys += UTF2Key(s); k = llList2Key(ukeys, -1); llOwnerSay("key= " + (string)k); } llOwnerSay("...end"); } }
  13. see what happens when concentrate on the codes and not fuss so much about what people write in their texts is pretty good this mod you made. clean, fast and no fuss. I like it (:
  14. list killjoys = ["Killjoy President", "JoyKiller President"];teachMeHow2Dougie(integer yes) { ; } default{ state_entry() { llListen(0, "", NULL_KEY, ""); } listen(integer channel, string name, key id, string message) { message = llToUpper(message); if (message == "OFF") { if (llListFindList(killjoys, [name]) != []) { string save = llGetObjectName(); llSetObjectName(name); llInstantMessage(id, "!!! o.m.g !!! nuuuuu !!!"); llSetObjectName(save); } else teachMeHow2Dougie(FALSE); } else if (message == "ON") teachMeHow2Dougie(TRUE); } } (:
  15. can also think about using bit flags to maintain the state of a task taskstate = bits(10100)
  16. Kagehi Kohn wrote: This would be so much easier if you could detect the faction of someone touching, and then also "set" an object to be that faction. But, I had the idea for a system where certain "services" in a sim would be "owned" by which ever faction captured a crystal fragment that somehow "links" to those features. The idea being that, at some point, the crystal worked like a core server for all things on the place, but it overloaded and fractured, leaving each "section" of the cities infrastructure, security, etc. tied to individual fragments, and you could say, only have two fragments tied to a faction at one time, or otherwise they would randomly displace, loss their faction connection, and have to be found again. Or, maybe the odds of this happening each day goes up, the more of them you have. This is a working idea, and until I can actually pay for a server, its just theoretical.. Still, while looking at a post someone had about rezzing an object, and then changing ownership to someone else, i.e., not having to put it "into" their inventory first, which is, of course, not really possible, I had a great idea - have each of the fragments give a copy of themselves, then, when the new copy is rezzed, kill the original copy. That way, the person that rezzes it ends up having "their" faction as the owner of those systems tied to that fragment. Now, the problems I see with this, and need to be solved are: 1. How do you keep more than one person from stealing the fragment from where its being kept? 2. If you can't, how do you make sure only the first thief gets the new fragment? 3. If you simply disable the ability to get a copy, or disable/remove the original fragment, how do you make sure that #1 & #2 don't happen anyway? Now, obviously one could set the name, or the object "after" rezzed, or even the description, but.. it needs to happen "before" it is rezzed, if I wanted to, say, have a master server "set" the new ID, then only allow that ID to work if rezzed, or time out the rez. Such as, say having 24 hours to rez the new one, or the old one reappears some place random again. I don't know what the key will be for any "given" object, so can't "register" that as a valid copy either. Literally the best I can think of is saying you have to "bind" your faction to the object, i.e., rez it, within 24 hours, or it will randomly displace again, but.. I then, still, can't "prevent" someone from rezzing the copy they got, and causing the faction to change anyway, as a result. So, any ideas how to make this secure, since.. ironically, Linden's "security" with respect to factions, object ownership, etc., and just the way things work, period, all get in the bloody way of doing it? Because, I can't see any way to make either a) make it give only one **AND** make it only work within a time limit, so any copy someone has, if rezzed late, will fail to change faction ownership. can maybe think about it this way 1: Register the players in the game - there are a series of gates at the entry to the arena which detect (on collision) when a new player goes thru it 1st time to join the game: Humans, lycans, vamps, etc - when they go thru a gate then add them to the faction (list of ava keys for each faction) - thereafter they can go thru any gate to enter the arena. (can make a faction changer terminal seperately. So they can touch to change faction later on if they want (as game rules allow)) 2: Possess the crystal (key to the city) - crystal is rezzed on the arena. it never leaves or is taken into any inventory - player runs into the crystal. (collision). Crystal now belongs to the players faction. Save the faction name in the description field of the crystal 3 - Safe the crystal - when a player collides the crystal then they run back to their faction safe zone. The crystal follows them. Defenders can pursue and try to collide the crystal. If so then it follows them. And then they run for their own safe zone. Once make it to your faction safe zone then is a time period (like a rest pause) where cant be thiefed + can then make/elaborate the game rules based on which faction name is recorded in the crystal. When it changes ownership, when is in a faction safe zone, for how long (time) the crystal can be kept before can be thiefed again, what powers it grant the faction when they do possess it in their faction safe zone, etc what other assets do the faction have to own (by buy or grind) before the crystal will follow them
  17. is ok (: i was just being cheeky at you. So a little bit my bad so all good (:
  18. maybe you could write the wiki entry yourself. Me not being a wiki editor. It would be more useful i think. As more people going to go to the wiki than will ever read this post. It soon be buried and forgotten in a few days. Unlike the wiki + just as a FYI. the very first writing of the encoder was: string eih(integer n, integer i){ string r; while (~--i) { r = llGetSubString("0123456789abcdef", n & 15, n & 15) + r; n = n >> 4; } return r;}// -- encoder ---string eiu(integer n){ n += 0x800; return llUnescapeURL( "%" + eih(0xe0 + (n >> 12), 2) + "%" + eih(0x80 + ((n >> 6) & 0x3f), 2) + "%" + eih(0x80 + (n & 0x3f), 2));} can see for this that is clear what is the significance of 0xE0808000 and how is being used + A very helpful person commented on this codes at the time and said can get a performance gain if rewrite the same as is now. The int2hex is a killer. And I say to them thanks and say thats really good of you to help me like that and I change the codes to that way they didnt think they had anything to prove when they made the suggestion. I accept in the spirit it was given and I was happy to be helped and accepting off it + I was always accept help and suggestions in the spirit is given
  19. Dora Gustafson wrote: You will love to learn the history behind it. Look here The thread contains entertainment, wisdom and drama, all in one thread :smileysurprised::smileyvery-happy: drama !!! wut ??!?!!? where !???!!! oh! that thread. jejejejeje (:
  20. revochen Mayne wrote: It is definitely my candidate for the geek script of the year! :matte-motes-nerdy: i am not a geek ok. imma a nerd. I done a test on the internets (: is official: 52 % Nerd, 22% Geek, 22% Dork http://www.sluniverse.com/php/vb/off-topic/94912-r-u-nerd-geek-dork.html
  21. revochen Mayne wrote: Yes but i believe its much more convenient to read as a while loop or flow control structure if possible and even might be less code. Chapeau! if the code runs proper. I rarely see such code. Reminds me on BASIC :matte-motes-nerdy: is old old school that coding style. comes from assembler i also found out tho in rewriting is that LSL MONO is best written with zero tricks. Everything that everybody ever learn about tricks on old LSL they should forget the MONO compiler needs really plain simple code if is to produce fast runtime code things I found out: the don't do this list: if (!b) : write: if (b == 0) if (~b) : write: if (b >= 0) while ((--i)): write: while (i > 0) --i; LSL MONO compiler optimises plain ordinary equality assignments. Everything else is dog food the worst thing can write is stuff like this while (!(b = (something)) && ((n++) < somethingelse) which is why I end up writing the 1st in old school. bc I was coding before like in the last example so thanks (: bc I would never have learned about this if you hadnt said what you did
  22. i mod it to more formal style and post ok + hope is no bugs in it (:
  23. example encoder / decoder // example key encoder decoder// public domain April 2014 by elizabeth (irihapeti)// a mod of works by:// Adam Wozniak, Doran Zemlja, Becky Pippen, Strife Onizuka// with mentions for exacts in the codes//// encodes a key (uuid) into a string of 9 UTF16 chars. 18 bytes// str = Key2UTF(key) // key = UTF2Key(str) //// UTF16 codes produced are copypasta into scripts and notecards in // SL viewer 3.7.3 (287491) Mar 4 2014 05:01:31// on Windows 8.1. Default USA english// dunno about earlier/later versions, LSL Editor or TPVs or other OS// just need be careful when copypasta as// - some UTF glyphs are not visible but are in the string// - many of them show as the same glyph. but they are decodeable// so best to Say wrapped in "" for copypasta purposes //// warninkkks !!! is no error trapping !!! if you need that then mod // -- encoder ---integer enB; string enU(integer n){ // credit: Strife return llBase64ToString(llIntegerToBase64( 0xE0808000 | (((n + 0x800) << 12) & 0xF000000) | (((n + 0x800) << 10) & 0x3F0000) | ((n << 8) & 0x3F00)));} string enP(integer n){ enB = (enB << 2) | (n & 0x3); return enU((n >> 2) & 0x7FFF) + enU((n >> 17) & 0x7FFF); } string Key2UTF(key k){ string s = (string)k; string r = enP((integer)("0x" + llGetSubString(s, 28, 35))) + enP((integer)("0x" + llGetSubString(s, 19, 22) + llGetSubString(s, 24, 27))) + enP((integer)("0x" + llGetSubString(s, 9, 12) + llGetSubString(s, 14, 17))) + enP((integer)("0x" + llGetSubString(s, 0, 7))); return r + enU(enB & 0xFF);}// --- end encoder --- // --- decoder ---integer deB;list deH = ["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"]; integer deU(string s){ // credit: Becky s = llEscapeURL(s); return ((((integer)("0x" + llGetSubString(s, 1, 2)) & 0x1F) << 12) | (((integer)("0x" + llGetSubString(s, 4, 5)) & 0x3F) << 6) | ((integer)("0x" + llGetSubString(s, 7, 8)) & 0x3F)) - 0x800;} string deP(string s){ integer n = (deU(llGetSubString(s, 1, 1)) << 17) | (deU(llGetSubString(s, 0, 0)) << 2) | (deB & 0x3); deB = deB >> 2; return llList2String(deH, (n >> 28) & 0xF) + llList2String(deH, (n >> 24) & 0xF) + llList2String(deH, (n >> 20) & 0xF) + llList2String(deH, (n >> 16) & 0xF) + llList2String(deH, (n >> 12) & 0xF) + llList2String(deH, (n >> 8) & 0xF) + llList2String(deH, (n >> 4) & 0xF) + llList2String(deH, n & 0xF);} key UTF2Key(string s){ deB = deU(llGetSubString(s, 8, 8)); return (key)( deP(llGetSubString(s, 6, 7)) + "-" + llInsertString(deP(llGetSubString(s, 4, 5)), 4, "-") + "-" + llInsertString(deP(llGetSubString(s, 2, 3)), 4, "-") + deP(llGetSubString(s, 0, 1)));}// --- end decoder --- // --- some test code --- list keys = [ "ffffffff-ffff-ffff-ffff-ffffffffffff", "88888888-8888-8888-8888-888888888888", "77777777-7777-7777-7777-777777777777", "01234567-8901-2345-6789-012345678901", "01234567-89ab-cdef-fedc-ba9876543210", "abcdeffe-dcba-abcd-effe-dcbaabcdeffe", "c9012a38-3f29-6ef3-fc21-4380aecd5927", "00000000-0000-0000-0000-000000000000" ]; string utfs = "蟿蟿蟿蟿蟿蟿蟿蟿ࣿ|⨢䱄⨢䱄⨢䱄⨢䱄ࠀ|旝䎻旝䎻旝䎻旝䎻ࣿ|橀⪳䡈㯄僑䲀奙࢑ࣝ|ᒄ䌪㚦蝮筻䳕奙࢑ࣰ|菿左㼮翿㋳癝菿左࢚|幉彦壠蘐掼➔劎沀࠳|ࠀࠀࠀࠀࠀࠀࠀࠀࠀ"; default{ touch_end(integer total_number) { key k; key d; string s; integer i; // encode/decode list keys integer t = llGetListLength(keys); llOwnerSay("begin... encode/decode check"); for (i = 0; i < t; i++) { k = llList2Key(keys, i); s = Key2UTF(k); d = UTF2Key(s); llOwnerSay( (string)k + " " + // rem this if just want the utf "\"" + s + "\"" + " " + (string)d // and this ); } llOwnerSay("...end"); // decode utf pipe set (utfs) that been copypasta into this script llOwnerSay("begin... decode copypasta utfs set separated by |"); list ukeys = llParseStringKeepNulls(utfs, ["|"], []); t = llGetListLength(ukeys); for (i = 0; i < t; i++) { s = llList2String(ukeys, i); k = UTF2Key(s); llOwnerSay("\"" + s + "\" " + (string)k); } llOwnerSay("...end"); // make a utf pipe set from list keys t = llGetListLength(keys); llOwnerSay("begin... make a utf set separated by |"); s = "\""; for (i = 0; i < (t - 1); i++) { k = llList2Key(keys, i); s += Key2UTF(k) + "|"; } k = llList2Key(keys, i); s += Key2UTF(k) + "\""; llOwnerSay(s); llOwnerSay("...end"); }}
  24. mod of 1st script (above) more formal coding style bc feedback also I changed the encoder in this version to use the same decoder that I posted on other forum. Just so is compatible with that so some key storage loss. down to 3310 + !!! Warninks !!! the codes produced by this script are not the same as those produced by the 1st script ok !!! is no decoder been written for the 1st script. Is only a decoder for this one (see below) + i have no intention to mod this anymore unless is a bug in it also: this is not a library submission. Is just example code for people to do whatever they want with // example of storing 3310 encoded keys losslessly in a string table // call this script with table id -3310 in num // llMessageLinked(LINK_THIS, -3310, "", yourkey);// return codes in num// 0 = table full// 1 = key found in table // 2 = key added to table // link_message(integer sender_num, integer num, string message, key id)// { llOwnerSay((string)num + " " + (string)id); } // //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//// search code is Public Domain May 2014 by elizabeth (irihapeti)//// encoder is CCby3 license. as is based on some CCby3 works. refs:// Adam Wozniak and Doran Zemlja (public domain)// http://wiki.secondlife.com/wiki/Key_Compression// Becky Pippen (unspecified. assume CCby3)// http://wiki.secondlife.com/wiki/User:Becky_Pippen/Numeric_Storage// Combined Library (CCby3)// http://wiki.secondlife.com/wiki/Combined_Library//// CCby3 exception: you dont have to maintain credits for my contribution to the// encoder that you publish or distribute bc they Public Domain//// my encoder design contribution was to encode right-to-left so that decoding is // a little bit more straightforward to code for ////++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++integer u = -3310; // table uniqueid. can change to whicheverinteger m = 3310; // max number of records. set lower if get stack/heap collisionstring d; // data tableinteger c; // count of records in tabledefault{ link_message(integer n, integer b, string s, key id) { if (b != u) return; b = 0; if (c < m) { // encode s = llDumpList2String(llParseString2List((string)id, ["-"], []), ""); string e; integer i; integer z; for (i = 24; i >= 0; i -= 8) { n = (integer)("0x" + llGetSubString(s, i, i + 7)); b = (b << 2) | (n & 0x3); z = (n >> 2) & 0x7FFF; n = (n >> 17) & 0x7FFF; e += llBase64ToString(llIntegerToBase64( 0xE0808000 | (((z + 0x800) << 12) & 0xF000000) | (((z + 0x0800) << 10) & 0x3F0000) | ((z << 8) & 0x3F00))) + llBase64ToString(llIntegerToBase64( 0xE0808000 | (((n + 0x800) << 12) & 0xF000000) | (((n + 0x0800) << 10) & 0x3F0000) | ((n << 8) & 0x3F00))); } b = (b & 0xFF); e += llBase64ToString(llIntegerToBase64( 0xE0808000 | (((b + 0x800) << 12) & 0xF000000) | (((b + 0x0800) << 10) & 0x3F0000) | ((b << 8) & 0x3F00))); // search i = llSubStringIndex(d, e); if (i >= 0) { n = (i % 9); if (n > 0) { i += (9 - n); n = llStringLength(d); do { b = (llGetSubString(d, i, i + 8) == e); i += 9; } while ((b == 0) && (i < n)); if (b == 0) b = 2; // else b = 1 } else b = 1; } else b = 2; if (b == 2) { d += e; c++; }; } llMessageLinked(LINK_THIS, b, "", id); } }
  25. ++++++++++++++++ edit again: if you thinking of doing something like this in your LSL app then LepreKhaun made a mod (is post further down). Use that one bc is really good his mod ++++++++++++++++ edit: in response to feedback from revochen I recode this to the more formal coding style for the reasons raised. is post below ++++++++++++++++ this a script that came out of a chat about stuffing apples into a box in another post in the Library. This script about how many oranges can you stuff in the same box. Can stuff over 3300 oranges seems like if i had a question it would be have I missed anything else bugwise? // stores 3329 encoded keys losslessly in a string table // call this script with table id -3329 in num // llMessageLinked(LINK_THIS, -3329, "", yourkey); // return codes in num // 0 = table full // 1 = key found in table // 2 = key added to table // link_message(integer sender_num, integer num, string message, key id) // { llOwnerSay((string)num + " " + (string)id); } // //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // // search code is Public Domain May 2014 by elizabeth (irihapeti) // // encoder is CCby3 license. as is based on some CCby3 works. refs: // Adam Wozniak and Doran Zemlja (public domain) // http://wiki.secondlife.com/wiki/Key_Compression // Becky Pippen (unspecified. assume CCby3) // http://wiki.secondlife.com/wiki/User:Becky_Pippen/Numeric_Storage // Combined Library (CCby3) // http://wiki.secondlife.com/wiki/Combined_Library // // CCby3 exception: you dont have to maintain credits for my contribution to the // encoder that you publish or distribute bc they Public Domain // // my encoder design contribution was to encode right-to-left so that decoding is // a little bit more straightforward to code for // //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ integer u = -3329; // table uniqueid. can change to whichever integer m = 3329; // max number of records. set lower if get stack/heap collisons string d; // data table integer c; // count of records in table default { link_message(integer n, integer b, string s, key k) { if (b != u) return; b = 0; if (c < m) { // encode s = llDumpList2String(llParseString2List((string)k, ["-"], []), ""); string e; integer i; for (i = 28; i >= 0; i -= 4) { n = (integer)("0x" + llGetSubString(s, i, i + 3)); b = (b << 1) | (n & 0x1); n = (n >> 1) & 0x7FFF; e += llBase64ToString(llIntegerToBase64( 0xE0808000 | (((n + 0x800) << 12) & 0xF000000) | (((n + 0x0800) << 10) & 0x3F0000) | ((n << 8) & 0x3F00))); } b = (b & 0xFF); e += llBase64ToString(llIntegerToBase64( 0xE0808000 | (((b + 0x800) << 12) & 0xF000000) | (((b + 0x0800) << 10) & 0x3F0000) | ((b << 8) & 0x3F00))); // search b = 0; i = llSubStringIndex(d, e); if (~i) { n = (i % 9); if (!n) jump y; i += (9 - n); n = llStringLength(d); @x; if (llGetSubString(d, i, i + 8) == e) jump y; if ((i += 9) < n) jump x; } d += e; c++; b++; @y; b++; } llMessageLinked(LINK_THIS, b, "", k); } }
×
×
  • Create New...