07/06/14, 06:47 PM | #21 | |
Lua Code:
Lua Code:
Is there such a big difference to cause crash to desktop? |
||
07/06/14, 09:16 PM | #22 |
|
Ha! Well, no, definitely not, if that's really the only difference between the ESO 1.1.2 and 1.2.3 versions of the function.
But if that's the only difference, then I'm amazed, because these different results seem to have occurred: ESO 1.1.2
ESO 1.2.3
If your code excerpts are accurate, perhaps the difference I'm seeing in the results is not because of the parselink function, but instead because of some library changing, and/or new limitations being imposed, or some other factor. Edit: Changed numbers for calls (missed fairly important step in calculation). Last edited by YelloDello : 07/06/14 at 09:40 PM. |
07/06/14, 10:03 PM | #23 |
|
The code Garkin posted (before patch) is identical to what I have in source dated 19 Aug 2013 (yes 11 months old).
You seem to be misunderstanding what ZO_LinkHandler_ParseLink returns, and how # operator works. ZO_LinkHandler_ParseLink has always returned multiple values. Not a table. The first returned value is the text contained at the end of the link (between |h tags). # operator returns the length of its argument - its single argument. When you use a list of values (such as that returned from ZO_LinkHandler_ParseLink) in scalar context, Lua uses only the first value from the list. So, #ZO_LinkHandler_ParseLink(link) returns the length of the text (throwing away the rest of returned values). Since after the patch they stripped the text, the length is 0. Now, if you want to know how many values ZO_LinkHandler_ParseLink returns, you can either put the results in a table and then use # operator to get its size: Lua Code:
Lua Code:
I don't think you're completely wrong with the performance issues, though. I noticed something evil right after Craglorn patch. Back then I only had 1 addon, SpentSkillPoints, and an old version of that which did no caching at all. After the patch, every time I opened my skills, there was a very noticeable delay before the window actually opened. The delay was much shorter before that patch, and it went away once I updated the addon. But something must've changed, perhaps they're throttling Lua instructions per timespan, I don't know. |
07/06/14, 11:07 PM | #24 | ||
|
Given what Garkin wrote, I interpreted that with the old 1.1.2 link style, #ZO_LinkHandler_ParseLink should have returned a 0 or nil, which was confusing because it had actually returned a nonzero integer. Now I see that it returns the character length of the string that is the first argument. Returning the length of that string would explain everything I've been seeing.
|
||
07/09/14, 05:12 AM | #25 |
|
|
07/13/14, 03:01 PM | #26 | |
edit: But then again .. this link works fine
edit3: Aha, looks like the discrepancies are because it has stored it twice. Once under account [""] and once under ["@Xrystal"]. Guess a bit more investigation to do to find out which to keep and which to discard. Sigh, Looks like I will be re-writing XrysGatherer big time again .. the link data I have stored away is now corrupt because it has the name stored in it. As per the history screen showing the link that should be clickable to show the tooltip but as the screenshot shows, now shows an error. And this of course is the existing link stored. Lua Code:
Scratch goes the idea of storing the link for later display, if they do something like this. I was considering using the uniqueID ( 30166 ) as the key and just storing the link for extracting the rest of the information. I'm not quite sure how this can be rectified short of ignoring the link altogether and storing everything else and thus taking up more space, which has already found to be a problem with saved variables. I'm currently in the process of writing a set of addons to convert and utilise a more compact set of data, and this has now put a spanner in the works. Last edited by Xrystal : 07/13/14 at 03:26 PM. |
||
07/13/14, 03:46 PM | #27 |
You can refactor all your old links to the new link style quite easily
Lua Code:
Just replace color H2DC50E with H1 (brackets) or H0 (no brackets) and (optionally) remove the text between |h tags Lua Code:
|
|
07/13/14, 03:55 PM | #28 | |
Lua Code:
edit: D'oh .. must have been re-using the color value which, although was printing out as 0 must still be using it as the original color value. Changed it to |H1 and then the for loop and all is well. edit2: Thanks for the tip with H0 and H1 for the different types.. Decided to change the H0 ones to H1 as well. A Much better display for links rofl. Lua Code:
Last edited by Xrystal : 07/13/14 at 04:34 PM. |
||
07/13/14, 05:34 PM | #29 |
|
I find your replacement code quite convoluted Try this:
Lua Code:
edit: oops, somehow I dropped one x from the pattern. fixed Last edited by merlight : 07/13/14 at 05:39 PM. |
07/13/14, 06:12 PM | #30 | |
Lua Code:
|
||
07/13/14, 06:58 PM | #31 |
|
Probably the only thing I like about Lua's regular expressions is that they traded power for simplicity, so they're easy to learn. And the added benefit of learning things like this is you get better understanding of other people's code. I've had to learn myself, never used Lua and still don't like it as a language
Another shortcut: Lua Code:
|
07/14/14, 09:47 AM | #32 |
|
Also table.concat is more efficient than joining a bunch of strings with concatenation operators (..).
When you combine a string using "abcd" .. "e", it'll copy it all into a new longer string rather than just appending. As such, adding a little bit on for each step of a loop incurs a lot of overhead from copying over and over in memory (and overhead from the garbage collector too). For the table, it just grabs a little more memory each time, and does the copying once when you combine it at the end with table.concat() |
07/14/14, 02:18 PM | #33 | |
And yes, true, I am always up for learning and I do try using the table and string functions where I can but some of the more complex ones I always forget months down the line. If this was professional it would be a different kettle of fish, but this is for a game and just for a data conversion tool and not a use all the time addon But seeing as the release of this is a ways off you never know, I may rethink things and include these suggestions. So thanks again for pointing them out and especially for explaining the gsub statement. |
||
07/27/14, 12:37 PM | #34 | |
Join Date: Apr 2014
Posts: 1
|
Tested it on PTS and skill procs like Crystal Shards still do not proc in the new version.
Also, there has been some reports of lag with new version... love this addon and keep up the great work! |
|
ESOUI » Developer Discussions » General Authoring Discussion » V1.2.3 API Patch Notes & Change Log |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Linear Mode |
Switch to Hybrid Mode |
Switch to Threaded Mode |
|
|