• 0

    posted a message on Lua engine
    Does anyone know the differences between Lua engine used in wow and the standard Lua distribution?

    I've had in incident recently.. my addon is running a heavy calculation using tons of short strings that takes a few seconds to finish. I pretty much copied the code to an standard Lua engine (with the same input), and it took forever to finish. More interestingly, the memory consumption went up to like 500MB in the process, and when I inserted garbage collection in the loop it took roughly a minute on each pass. I switched from short strings to large integers (not sure why I was using strings in the first place), and it worked a lot quicker, but still slower than wow IIRC. What kind of miracles are they employing?

    Also, is the taint mechanism implemented via a modification to the engine?
    Posted in: Lua Code Discussion
  • 0

    posted a message on Addon author's reward program
    Mine just came in 2 days ago, guess they got some issues this month. I already stopped checking and figured I was late (submitted it on 28th).

    Btw random question, why can't I log in through the forum, and have to go back to the front page (wowace.com) and log in there? Forum says my login/password are incorrect.
    Posted in: General Chat
  • 0

    posted a message on Addon author's reward program
    Sorry for bothering again, when is the last day to order for this month? If I replace my order with a larger one tomorrow (missing 90 points currently), will I miss out on this month's cutoff?
    Posted in: General Chat
  • 0

    posted a message on Addon author's reward program
    Ooh wish I knew that, I only got enough points for second order on 4th and thought I'd make it.
    The first part still arrived on 4th though, unless you're based somewhere far east:

    Date:
    Oct 4, 2013
    Time:
    09:06:19 PDT
    Posted in: General Chat
  • 0

    posted a message on Addon author's reward program
    Why did the payout happen on 4th this month? I placed an order yesterday evening, only to find out I missed the payout by 2 hours..
    Posted in: General Chat
  • 0

    posted a message on New item upgrades
    Anyone knows the new upgrade IDs for asian items? The EU client does have a path that goes to +16, but its probably unused and different from the one asian clients use, just like last patch.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Repo authorization
    I'm not sure if it was changed recently or my memory deceives me..
    Why are usernames case-sensitive AND converted to lowercase? I've been trying to do commit for like half an hour using my username with the first letter capitalized, as it should be.

    Also, how exactly does it decide whether I'm trying to package a release, beta or alpha build? It would make sense if there was a dropdown when tagging a repository, but apparently it determines that from the tag itself? Like, everything that starts with 'r' is alpha, everything that ends with a digit is release, everything else is beta? Or am I not understanding the way it works at all?
    Posted in: General Chat
  • 0

    posted a message on Removing WoW escape sequences from a string
    Ideally, strings should be parsed sequentially (as they probably are in the client) to avoid all corner cases, but the code for that would be longer.

    Lookbehinds won't really help, either, because "|||r" should become "||". Replacing "||" with "|!" seems like it should work, if you want to stick with patterns.

    Just a point of contention, here: Lua has pattern matching, not regular expressions. In fact, the code for regular expressions is larger than that of Lua itself!

    PCRE are technically not regular expressions, either, as they define a much broader family than regular languages. A classic regular expression implementation can easily fit in under 1k lines, while lua 5.2 is over 20k total.
    Posted in: Lua Code Discussion
  • 0

    posted a message on date leakage...
    Couldn't you force a garbage collect cycle in the first case to prevent memory fluctuation?
    Posted in: Lua Code Discussion
  • 0

    posted a message on BattlegroundTargets
    Gotta add this after line 296 of BattlegroundTargets.lua:
        elseif bgID == 754 then bgMaps[localizedName] = {bgSize = 15, flagBG = 1} -- Deepwind Gorge
    Posted in: General AddOns
  • 0

    posted a message on Lua api binding
    Yeah I thought that was obvious too, and I figured that would be hard(er) to ensure if api used weak metadata because then you can't convert a pointer back into a lua object.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Lua api binding
    Actually, the last point probably does matter. If you call something like GetParent, it should give you the table corresponding to the object's parent - but will you always end up with the same table?
    Anyway, I'm making an addon "simulator" of sorts; I figured the best way to do that would be to store the objects themselves as full userdata (so lua api acts like a heap) and store the reference to the table in uservalue/env for that userdata.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Lua api binding
    Is there any info on how exactly lua objects are bound to api objects?
    So apparently UIObjects are table with 0 field storing userdata with the actual object. Is there any way to find out if it uses full userdata that stores all data, or just a light pointer?
    Another question is, are api objects always associated with exactly one lua object? I suppose you can't have two lua tables for the same frame?
    Posted in: Lua Code Discussion
  • 0

    posted a message on Dancing steel source GUID
    I don't know if its the case with all RPPM enchants (probably not because dancing steel is the only one that's meant to stack), but dancing steel isn't applied by the player according to combat log. I thought the actual source GUID could be used to tell if its a MH or OH proc.

    After some experimenting, it appears the proc source does depend on the weapon, but its not MH/OH, but rather the actual item it procced from. Has anyone encountered this before, and is there any way to associate a GUID with an item without having to unequip the other weapon?
    Posted in: Lua Code Discussion
  • 0

    posted a message on Item upgrade formulas
    Anyone figured out the formulas used to upgrade items? Wowhead seems to display them correctly, though they might just store upgrade info for every item.

    My problem is that GetItemStats doesn't work correctly for upgraded items, and I have to compensate. I don't like the idea of parsing tooltips, either. What I did was get a table of spell powers on casters weapons for all item levels, and scale items proportionally. From my testing, the stats are usually off by 1 due to rounding, so there's still room for improvement. Maybe there's just a table in game data for this purpose?

    Here's my replacement code:
    local spTable = {
      [458] = 4914,
      [463] = 5152,
      [466] = 5293,
      [470] = 5496,
      [471] = 5550,
      [474] = 5704,
      [476] = 5812,
      [478] = 5920,
      [480] = 6032,
      [483] = 6206,
      [484] = 6261,
      [487] = 6441,
      [489] = 6564,
      [490] = 6628,
      [491] = 6685,
      [493] = 6812,
      [494] = 6879,
      [496] = 7007,
      [497] = 7071,
      [498] = 7140,
      [500] = 7272,
      [501] = 7337,
      [502] = 7408,
      [503] = 7478,
      [504] = 7548,
      [505] = 7619,
      [506] = 7688,
      [507] = 7761,
      [508] = 7836,
      [509] = 7907,
      [510] = 7980,
      [511] = 8054,
      [512] = 8132,
      [513] = 8206,
      [514] = 8286,
      [515] = 8364,
      [516] = 8441,
      [517] = 8518,
      [518] = 8603,
      [519] = 8680,
      [520] = 8761,
      [521] = 8841,
      [524] = 9093,
      [525] = 9179,
      [528] = 9439,
      [532] = 9797,
    }
    local upTable = {
      [445] =  0, -- 0/2
      [446] =  4, -- 1/2
      [447] =  8, -- 2/2
      [451] =  0, -- 0/1
      [452] =  8, -- 1/1
      [453] =  0, -- 0/2
      [454] =  4, -- 1/2
      [455] =  8, -- 2/2
      [456] =  0, -- 0/1
      [457] =  8, -- 1/1
      [458] =  0, -- 0/4
      [459] =  4, -- 1/4
      [460] =  8, -- 2/4
      [461] = 12, -- 3/4
      [462] = 16, -- 4/4
    }
    function GetItemStatsUp(link, table)
      local result = GetItemStats(link, table)
      if not result then
        return result
      end
      local id = tonumber (link:match ("item:%d+:%d+:%d+:%d+:%d+:%d+:%-?%d+:%-?%d+:%d+:%d+:(%d+)"))
      local _, _, _, iLvl = GetItemInfo(link)
      iLvl = iLvl or 0
      if iLvl >= 458 and upTable[id] then
        local iLvl2 = iLvl + upTable[id]
        if iLvl2 > iLvl and spTable[iLvl] and spTable[iLvl2] then
          for k, v in pairs(result) do
            if tonumber(v) then
              result[k] = math.floor(tonumber(v) * spTable[iLvl2] / spTable[iLvl] + 0.5)
            end
          end
        end
      end
      return result
    end
    
    Posted in: Lua Code Discussion
  • To post a comment, please or register a new account.