• 0

    posted a message on GetNumMacroIcons() missing
    Anyone knows if using the ? icon texture will provide the same functionality that we had using the old ? icon (old index 1) ?
    Posted in: Need Help?
  • 0

    posted a message on ElkBuffBars v2 (finally Ace3 version)
    Line 118 is :
    local inf = 1/0


    So the question is, what change in 4.3 made this invalid.

    For now, you can probably change the line for
    local inf = 9223372036854775807

    just to see if the rest work.
    Posted in: General AddOns
  • 0

    posted a message on ElkBuffBars v2 (finally Ace3 version)
    Quote from Ssitri
    doesn't work :(

    Message: Interface\AddOns\ElkBuffBars\EBB_Bar.lua:625: attempt to call method 'FormatDurationCondensed' (a nil value)


    This is a function from LibAbacus-3.0. Any message about the library not loading properly? Or maybe you use the no-embed version of EBB and forgot the library?
    Posted in: General AddOns
  • 0

    posted a message on Need some help with regex
    Why not use a if statement or a short-circuit opperator?

    Something like:
    local formattted_number = tonumber(n) > 1000000 and n:gsub("^(-?%d+)(%d%d%d)(%d%d%d)","%1.%2.%3") or
                              tonumber(n) > 1000 and n:gsub("^(-?%d+)(%d%d%d)","%1.%2") or
                              tostring(n)
    Posted in: Lua Code Discussion
  • 0

    posted a message on Page markup
    Use Wiki Creole and choose Lua Code, it should help I think.
    Posted in: AddOn HELP!
  • 0

    posted a message on Curse client not showing latest version
    I notice that there is always a delay between files being available on Curse and WoWAce and them being available on the Curse client. I can't say how long but it's often multiple hours and I've seen download that would only becomes available the next day. I normally log only once or twice a day to Curse though so they delay is probably less then 24 hours.

    If you try it this morning, do you see the correct version?
    Posted in: Updaters
  • 0

    posted a message on track npc code.
    Be mindful that this imply cleaning the cache. The NPC data normally stays in the cache until a patch unless you delete it.

    When I pointed you to _NPCScan, I though it had another way to detect nearness.
    Posted in: Need Help?
  • 0

    posted a message on track npc code.
    WoWHead has 39 different IDs for Harisson Jones so my guess a different ID for each phases. I should add that I'm not sure it's always the case.
    Posted in: Need Help?
  • 0

    posted a message on track npc code.
    I suggest having a look at _NPCScan and see how it's done.
    Posted in: Need Help?
  • 0

    posted a message on For-do loop vs ipairs loop
    When I need to sort tables with "holes", I create a table of indexes, sort it and then use it. Something like this:

    -- Sort function
    local function sort_by_item_name (a,b)
    	local name_a = _G.GetItemInfo(a)
    	local name_b = _G.GetItemInfo(b)
    	return name_a < name_b
    end
    
    
    index = index or {}
    wipe(index)
    
    -- Sort by item name
    for key in pairs(item_table) do tinsert(index,key) end
    sort(index, sort_by_item_name)
    
    -- Do something using the item name sort
    for i=1,#index do
        DoSomething(item_table[index[i].some_value)
    end
    
    -- Do something using ipairs
    for i, item in ipairs(index) do
        DoSomething(item_table[item].some_value)
    end
    


    I dabbled a bit with custom iterator but I didn't find any clean ways to do them without creating table garbage. I would be interested to know if anyone is using them and how.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Shortcut ! Help !
    In Perl, we can use \Q and \E to "quote" a string in a pattern so that any special characters are automatically escape. Using "\Q[[test]]+\E" would be the same as "\[\[test\[\]\+". Is there something similar in Lua pattern matching?
    Posted in: AddOn HELP!
  • 0

    posted a message on Quest Events, etc.
    Quote from Dridzt
    You could deformat global strings like ERR_QUEST_COMPLETE_S and ERR_QUEST_ACCEPTED_S for a locale independent solution (just adding to what LaoTseu said above)


    Don't have a way to test it right now but would

    local MATCHING_TEXT = ERR_QUEST_ACCEPTED_S:gsub('(%%s)','(%s)',1)


    work with all localization of the string or does the deformat needs to be more complex?
    Posted in: Lua Code Discussion
  • 0

    posted a message on Quest Events, etc.
    You haven't missed anything. If you really want to do something when the user press the button or the equivalent, you need to hook CompleteQuest() or QuestProgressCompleteButton_OnClick(). GetQuestID() will get you the quest besing completed when the button is pressed.

    You can also register CHAT_MSG_SYSTEM and look for msg:find("^(.+) completed.$") and again, GetQuestID() will tell you what is completed but this only works for English client obviously. The chat message is the only way I know to find quest that are completed on accept since the user will never press the complete button and the quest will never appear in the quest log.

    Most addons that deal with quest turn ins register QUEST_LOG_UPDATE and check what changed since the last time they process the log. Quests that are no longer in the log were turned in unless they were abandon. The only way (that I know of) to know about abandoned quest is to hook AbandonQuest() and use GetQuestID() to know what is abandoned or assume that the only thing that went away from the log was the abandoned quest. Again, this doesn't catch the quest that are completed when accepted.

    Hope that helps.
    Posted in: Lua Code Discussion
  • 0

    posted a message on ElkBuffBars v2 (finally Ace3 version)
    Recently, I've removed the last vestiges of FuBar in my addons folder. That included Fubar2Broker.

    Yesterday I realised that EBB needed FuBar since it didn't have any LibDataBroker support and I just couldn't remember that /ebb was there. So, I went in and hack a quick and durty LDB support:

    -- -----
    -- LibDataBroker stuff
    -- -----
    
    local ldb = LibStub:GetLibrary("LibDataBroker-1.1", true)
    if ldb then
    	local dataobj = ldb:NewDataObject("ElkBuffBars", {
    		type = "launcher",
    		text = "ElkBuffBars",
    		icon = "Interface\\AddOns\\ElkBuffBars\\icon",
    		OnClick = function() ElkBuffBars:ShowDewdrop() end,
    	})
    end


    I've added this in ElkBuffBars.lua and I'm now an happy camper. Just in case someone else needed it.

    Best
    Posted in: General AddOns
  • 0

    posted a message on Cut Scene detection
    Quote from Dridzt
    InCinematic() returns true while a cinematic is playing.
    CINEMATIC_START and CINEMATIC_STOP are the relevant events.


    Thanks a bunch!
    Posted in: Lua Code Discussion
  • To post a comment, please or register a new account.