• 0

    posted a message on Pattern Matching (yet again?)
    Quote from sylvanaar
    AnyNamePattern = "%f[%a\192-\255]([%a\192-\255]+)%f[^%a\128-\255]"


    If you don't mind, what is the significance of %f in the above?
    Posted in: Lua Code Discussion
  • 0

    posted a message on Globals vs Locals newbie question
    I see; thank you for your replies.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Globals vs Locals newbie question
    Quote from Xinhuan
    The first is of a magnitude faster than the second. Hash table lookups ARE SLOW and are NOT CONSTANT TIME. The larger the table, the more time it takes to find it.


    Could you please elaborate? People normally use hashtables for their constant lookup times, and we typically think of them as being more effective as the data set grows larger (compared to a sequential data structure). This seems counter-intuitive to me, but perhaps Lua does things differently.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Globals vs Locals newbie question
    Quote from airscape
    Oh I see now, thanks. But I'm still not convinced why local variables are better than globals, how exactly are they "faster" than globals?


    You might take a look at: http://www.lua.org/gems/sample.pdf There's an explanation on page 17.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Countdown
    What wasn't working with it? Were you not using a repeating timer, possibly? Or maybe you weren't creating a new timer on every call?
    Posted in: Lua Code Discussion
  • 0

    posted a message on /afk and /dnd
    Duh! Why, thank you :D
    Posted in: Lua Code Discussion
  • 0

    posted a message on /afk and /dnd
    Is there a way to toggle your AFK or DND status programmatically? I couldn't seem to find a function on the WoWWiki API page.

    Thanks in advance!
    Posted in: Lua Code Discussion
  • 0

    posted a message on Countdown
    You could get the value of time() when a button is pushed, then in OnUpdate() check the difference between the current time() and the original value. I believe the OnUpdate call also passed in the amount of time elapsed since the last update as described here http://www.wowwiki.com/Using_OnUpdate_correctly. Or you could use AceTimer, I suppose.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Curse.com favorites email notification
    I've noticed favorites subscriptions/unsubscriptions have taken up to a week or longer to take effect.
    Posted in: General Chat
  • 0

    posted a message on Looting from objects instead of mobs?
    Reading the tooltip is risky because looting object is not instantaneous, meaning the tooltip might have changed at the time the loot window is opened. What you should do instead is watch for a successful spell cast and register for the loot window opened event only if the spell cast was one you were interested in. For chest, the English spell name is "Opening".

    I implement such functionality in my add-ons TB Artisan and TB Raid Helper. Take a look if you'd like.
    Posted in: Lua Code Discussion
  • 0

    posted a message on AceComm-3.0 and loopback?
    Hello,

    I have noticed that AceComm-3.0 no longer prevents loopback when sending a a comm message to a broad distribution such as "PARTY" or "RAID". If you are the originator, you get your own messages, which in some cases can prove problematic. I suppose this is caused by the underlying Blizzard API function SendAddOnMessage which sends to everyone in the distribution, including yourself.

    Of course it is possible to work around it in my addons themselves by checking if sender ~= UnitName("player") but I was curious if it was an intended design choice in AceComm-3.0 or an oversight. In the latter case, is there any plan to prevent loopbacks? Or is it already there and I'm missing something? I know AceComm-2.0 used to prevent loopbacks, which prompted my question.

    Thanks in advance.
    Posted in: Ace3
  • To post a comment, please or register a new account.