• 0

    posted a message on [Bison] should any 'drunken state' show as a buff/debuff?
    There is no aura associated with levels of intoxication. It's probably possible to create a semi-accurate faux aura for them, but unless an addon explicitly does it then it won't exist.
    Posted in: AddOn HELP!
  • 0

    posted a message on Getting data into and out of the game (without reloading!)
    I still can't see any truly exploitative behavior coming from this. Unintended, certainly, but nothing malicious or against the spirit of the game (...yet).

    Not that I'm opposed to limiting their used to prevent this, of course. I'm apathetic on the issue. Seems like a lot of hub-bub for a little something though. :)
    Posted in: Lua Code Discussion
  • 0

    posted a message on Hooking, again
    -- saved the original function
    local origFunc = UnitFrameHealthBar_OnValueChanged
    -- override the function
    UnitFrameHealthBar_OnValueChanged = function(self, value)
         -- new code
    
         -- call the original function
         origFunc(self, value)
    end
    You can also hook the OnValueChanged of the frame itself, rather than the generic handler (I'd probably do this) -

    <Name of unit frame health bar>:HookScript('OnValueChanged', function(self, value)
         -- add new code, old code is called automatically.
    end)
    Posted in: Lua Code Discussion
  • 0

    posted a message on Wintergrasp quests cooldown timer
    Prior to 3.2 the quest would reset based on when you accepted them, rather than based on a static period. I haven't done Wintergrasp since, so admittedly it may have changed considering the rather large changes to the system in 3.2.
    Posted in: Addon Ideas
  • 0

    posted a message on Need some direction relating to timers
    Quote from lilsparky
    dunno know much about the dalaran books, so you'd need to figure out how to detect when a book has spawned. might be a system chat message event...


    No chat message event for them. Once read they're active for 5 minutes, then they despawn for (iirc) 2 hours, so the only way to have a reliable timer for them is to have previously seen it. I don't believe there's an event for opening a book, but you could probably hook the frame's :Show() function or similar (assuming the frame is reused, which it likely is).
    Posted in: Addon Ideas
  • 0

    posted a message on Need some direction relating to timers
    Use an OnUpdate frame.

    local f = CreateFrame('Frame')
    local last, throttle = 0, 1
    f:SetScript('OnUpdate', function(self, elapsed)
         -- OnUpdate scripts fire on every frame redraw. We can throttle this to a duration
         -- in seconds to make a faux timer.
         last = last + elapsed
         if last > throttle then
              -- This fires approx. every 1 second (throttle time)
    
              last = 0 -- fixed!
         end
    end)
    Then you can create a FontString and decrement the time remaining in the OnUpdate script. A statusbar isn't really much more difficult. Instead of creating a FontString object just create a StatusBar object.
    Posted in: Addon Ideas
  • 0

    posted a message on Regular Expressions
    Quote from mrbones
    Oh also, is it possible to create a table where an index is a pattern matched string.
    like
    MyTable = {
    ["%a?hat"] = "Fedora",
    }

    so that indexing in to MyTable using any string that is a letter followed by hat will return fedora? e.g. chat, phat, hat etc


    Your index is just a string, you can't access the index in your table and expect a strfind result. The way you're doing it now would require iterating over your table with pairs:

    for pattern, result in pairs(MyTable) do
     if strfind(Message, pattern) then
      print(result) -- Fedora
     end
    end
    Posted in: Lua Code Discussion
  • 0

    posted a message on Get raid icon without unit?
    Wait, you were doing this for a mob marker? Target polling. :/
    Posted in: Lua Code Discussion
  • 0

    posted a message on ButtonFacade coding
    local LBF = LibStub('LibButtonFacade', true)
    if LBF then
        -- Replace skinName with the default skin for your addon, or the selected skin from your SVs
        LBF:Group('MyAddon'):Skin(skinName)
    
        -- Create some frame
    
        LBF:Group('MyAddon'):AddButton(frame)
    end
    Posted in: Lua Code Discussion
  • 0

    posted a message on Disable MiniMap ping.
    Override the Minimap's OnMouseUp script.

        Minimap:SetScript("OnMouseUp", function(self, button)
            if button=="LeftButton" then
               Minimap_OnClick(self)
            end
        end)
    Posted in: Lua Code Discussion
  • 0

    posted a message on Pre-3.2 player name auto-completion
    Not sure if jerry's code will work but as an alternative Gello came up with this:


    [B]OldMailAutoComplete.toc[/B] 
    ## Interface: 30200 
    ## Title: OldMailAutoComplete 
    ## Notes: Returns SendTo autocomplete to pre-3.2 behavior 
    OldMailAutoComplete.lua 
    
    [B]OldMailAutoComplete.lua[/B] 
    local e=SendMailNameEditBox 
    e:SetScript("OnTextChanged",nil) 
    e:SetScript("OnChar",function(s) 
    local n,g,t=s:GetText(),GetAutoCompleteResults 
    t=strlen(n)>0 and (g(n,36,0,1) or g(n,34,0,1) or g(n,4,0,1) or g(n,2,0,1)) 
    if t then 
    n=s:GetCursorPosition() 
    s:SetText(t) 
    s:HighlightText(n,strlen(t)) 
    end 
    end)


    In a proper addon, 36,34,4,2 and 0 should be bit.bor(AUTOCOMPLETE_FLAG_FRIEND,AUTOCOMPLETE_FLAG_ONLINE), bit.bor(AUTOCOMPLETE_FLAG_IN_GUILD,AUTOCOMPLETE_FLAG_ONLINE), AUTOCOMPLETE_FLAG_FRIEND, AUTOCOMPLETE_FLAG_IN_GUILD and AUTOCOMPLETE_FLAG_NONE respectively.


    The editbox for the calendar is CalendarCreateEventInviteEdit
    Posted in: Addon Ideas
  • 0

    posted a message on Detecting all Debuff types
    Quote from Tekkub
    If you're simply after if the player has lost control I do believe there's API for that. But things like bleed and snare you'd have to compile a list of debuffs to check for.


    Correct: http://wowprogramming.com/docs/api/HasFullControl
    Posted in: Lua Code Discussion
  • 0

    posted a message on Chef's Hat swapper
    TradeSkillFrame:HookScript('OnShow', function() if TradeSkillFrameTitleText:GetText() == 'Cooking' then EquipItemByName('Chef's Hat') end end)


    Then you can do some voodoo with OnHide for unequipping and finding the previous item that I can't write atm.
    Posted in: Addon Ideas
  • 0

    posted a message on Detecting all Debuff types
    LoseControl has a comprehensive list of these abilities classified by type, if you still want to do this without manually compiling it yourself.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Fragile
    That addon doesn't use the 'new' combat log or threat system. It uses the Banzai libraries which scans targets of available party/raid unitIDs, which should be just as reliable as day 1 it was created. What is the problem with it currently?
    Posted in: Addon Ideas
  • To post a comment, please or register a new account.