• 0

    posted a message on Bartender4 keybind issue.
    If ALT+T is defined as a global hotkey by some program in Windows, it might block WoW from receiving that combination.
    Posted in: AddOn HELP!
  • 0

    posted a message on Threat plates and Pally Seals
    I had a look on my Paladin and I don't see anything like the options that Druids get for forms that would apply to seals.

    /shrug
    Posted in: AddOn HELP!
  • 0

    posted a message on GetAchievementInfo not returning expected result
    Historical data? I wonder if a character who got the old First Sergeant achievement (long ago) and then got the new one would have both marked as complete...
    Posted in: Lua Code Discussion
  • 0

    posted a message on Grid — compact party/raid unit frames
    I don't know how it could log an aura application as a critical... I guess there could be a heal-type event that fires alongside the aura event. Testing...

    Here's the event sequence:
    UNIT_SPELLCAST_SENT
    COMBAT_LOG_EVENT_UNFILTERED<SPELL_AURA_APPLIED>
    UNIT_ABSORB_AMOUNT_CHANGED
    UNIT_POWER
    UNIT_SPELLCAST_SUCCEEDED
    COMBAT_LOG_EVENT_UNFILTERED<SPELL_CAST_SUCCESS>
    UNIT_AURA


    SPELL_AURA_APPLIED has auraType and amount as the custom parameters and their values were "BUFF" and the doubled absorb value. SPELL_CAST_SUCCESS has no custom parameters.

    So yeah. Value checking.
    Posted in: Grid & Grid2
  • 0

    posted a message on Grid — compact party/raid unit frames
    Re: critical Power Word: Shield

    It turns out they just implemented it as a double-valued absorb under the same aura. I guess you'd have to ... detect when your PW:S is applied to someone and determine what its value should be, given current conditions, and then compare it to the one that actually went up. I guess that's not that bad.
    Posted in: Grid & Grid2
  • 0

    posted a message on Grid — compact party/raid unit frames
    Quote from Phanx
    I think priests are the only class who have any reason to care about absorption shields on other people, but even then it seems like you'd only care "is the shield up?" and not "exactly how much damage will the shield absorb?"


    I think that's accurate. There's no useful action that you can take if you know the absorb amount outside of prioritizing heals based on who has less of a shield left? That seems horribly ... distracting. Though, I suppose you could have an indicator that changes color as the shield is depleted. Green to Yellow to Red or something. That might be useful information, actually, in that form.

    As an aside, 5.3 will add critical shields. I was thinking they might implement them as crits, but that doesn't make sense for what kind of thing a PW:S is. Also, I can't see them changing API to support the notion of a "critical" aura. So, either it's going to proc a second buff with an absorb amount equal to the first OR it will just be twice as big.

    If it's the latter, how on earth will we know it happened? The reason that particular knowledge is desirable is Rapture. If the shield that was cast to get the next Rapture proc after the ICD has run out ends up being a critical shield, it's possible the absorb won't run out before it fades which will delay your next Rapture proc.
    Posted in: Grid & Grid2
  • 0

    posted a message on Help with ReforgeLite
    I had a look; the only command is /reforge. It doesn't look like the position of the window is being saved in my layout-cache.txt, so unless yours is, that's probably not it either.

    Does it still not show up if it's the only addon running?
    Posted in: AddOn HELP!
  • 0

    posted a message on Notepad++
    One of my favorite Visual Studio/Resharper features is how it re-tabs and re-indents everything in a block when I delete and re-type the "}". I use it probably 60% for normalizing tabs in code that many hands have been in (yeah, yeah ... that should happen automatically when it's committed to source control; I'm not even sure the stupid one we're using can even do it) and the rest for easily fixing indentation that has gotten off somehow.
    Posted in: General Chat
  • 0

    posted a message on Addon Template
    No problems being solved. Just making sure I understand. A small learning binge.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Addon Template
    Ah, missed it by a nose. I can appreciate the spaces inside the curly braces, thanks for that too.

    Is there any other way to capture an arbitrary set of return values than to wrap them in a table? The only thing I could think of is the vararg thing, but I don't think that's something that can just be created outside of a function definition nor do I think you could assign to it.

    ...researching...

    According to this, there's another problem with my code:

    Unfortunately, it misses a nil return value since nil are not explicitly storable in tables , and particularly {...} does not preserve information about trailing nils.


    So, it wasn't going to work, anyway. That page goes into some ways to deal with it. Before I read that, I was thinking of something like this:

    function hooksecurefunc(containingTable, functionToHook, functionToCall)
        local currentFunction = containingTable[functionToHook]
        containingTable[functionToHook] = function(...)
            local callCaptureWrapper = function()
                functionToCall(...)
            end
            local unpackEliminator = function(callWrapper, ...)
                callWrapper()
                return ...
            end
            return unpackEliminator(callCaptureWrapper, currentFunction(...))
        end
    end


    That's very similar to the CPS-style example on that page. The problem with this scenario is that we have to call functionToCall, passing it the vararg from the surrounding function rather than just returning the vararg that was passed in from the return of calling the original function.

    I thought I'd figured that out by attempting to close on the outer vararg in the non-vararg function, but ... a little test in WoW tells me that vararg is too special to work like that and reminded me what "first class" actually means. Apparently the "..." in a function is only ever "for" the function it's contained in, and if the function doesn't have a vararg parameter, it's invalid to use it in the body.

    So, it seems like one of the other routes is how this would have to be written anyway, given the requirements of this particular hook.

    I have to say, though, as an aside, that this is sexy as hell:

    function Memoise(fn)
        return setmetatable(
            {},
            {
                __index = function(t, k)
                    local val = fn(k); t[k] = val; return val
                end,
                __call  = function(t, k)
                    return t[k]
                end
            }
        )
    end
    Posted in: Lua Code Discussion
  • 0

    posted a message on Addon Template
    Yeah, I've read over all the relevant pages a few times each, at least; those pages are where some of these questions came from. I just hadn't gotten the terminology straight in my head yet, I guess.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Addon Template
    Okay, I was wondering if I had the terminology wrong there. Insecure. Secure. And when those cross, the path is tainted.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Cant get Tell me when to work
    There's a ton of information on the project page for TellMeWhen, here:
    http://wow.curseforge.com/addons/tellmewhen/

    If it's not listed there, Cybeloras is very active in the comment replies on Curse:
    http://www.curse.com/addons/wow/tellmewhen

    That is, assuming nobody here can help you :).
    Posted in: AddOn HELP!
  • 0

    posted a message on Addon Template
    Quote from Phanx
    "%d" matches any digit, and is included so you can use things like "%0.2f" in your format string.


    Ohhh, I see. It's like /%[dfqsx\d]/ -- character class shorthand. I suppose I should've grokked that.

    Quote from Farmbuyer »
    The changes to the interpreter itself have been relatively minimal, centering around tracing the memory/execution taint that happens when player scripts interact with Blizzard scripts.


    That makes sense. The secure execution thing is really a cool idea, I've always thought. Can any of you think of analogues for that in other applications/languages -- situations where something like this was created/is part of a language/is used elsewhere?

    I wonder what the code for that looks like. How can the C-side of a Lua program tell "where" in Lua space the call originates from? Are all of the "protected" functions implemented in C?

    Moving to taint... is all user code tainted by default, or can a user write code (just code, not to hooking yet) that isn't tainted?

    The hooksecurefunc API is described as...
    The API replaces the original global function with its own secure hook function that calls the original function, saves its return values away, and then calls your hook function with the same arguments as the original function (any return values from your hook function are thrown away) and then it returns the return values from the original.


    So, is that like this, if it were written on the Lua side? (ignoring the default-to-global behavior of calling it with two parameters)

    function hooksecurefunc(containingTable, functionToHook, functionToCall)
        local currentFunction = containingTable[functionToHook]
        containingTable[functionToHook] = function(...)
            local returns = {currentFunction(...)}
            functionToCall(...)
            return returns
        end
    end
    Posted in: Lua Code Discussion
  • 0

    posted a message on Aura duration
    GetTime appears return seconds. Also, expire is usually "after" now, so you could just reorder those. This works ... just pick a buff you can cast for the aura:
    /run local _, _, _, _, _, _, e = UnitBuff("player", "Mark of the Wild") print(format("%.2f", (e - GetTime()) / 60))

    I'm getting the minutes plus fraction of a minute to two decimal places of duration from that.
    Posted in: Lua Code Discussion
  • To post a comment, please or register a new account.