• 0

    posted a message on Mendeleev [PT3]
    Quote from gagou
    I've checked Gathermate which is also doing translations for mines and it's using it's own localized data, maybe the same can be done for Mendeleev and then get rid of Babble-2.2 from the deps?


    I know, it has been rejected before, but I'm voting for creating Babble-Ore-3.0, because it can be shared between more addons and wouldn't need to be updated in each of the different addons (GatherMate, Mendeleev, my unfinished GatherInfo, others?)
    Posted in: General AddOns
  • 0

    posted a message on Item types and subtypes - localization, weird names, ???
    2) The function GetMerchantItemCostItem(idx, costidx) returns Marks of Honor as regular items...

    Bonus) AFAIK there are only 2 function to scan vendor's list: GetMerchantItemInfo(idx) and GetMerchantItemLink(idx). The first doesn't return itemid in any way so I cannot simply call a GameTooltip:SetHyperlink(item) to get the info :(
    Posted in: Lua Code Discussion
  • 0

    posted a message on Item types and subtypes - localization, weird names, ???
    Hi,
    I'm trying to understand ItemType and ItemSubtype parameters returned from GetItemInfo(item).

    1) Is there a way/another function which returns item categories (types + subtypes) in language independent way?

    2) Why the ItemType "Money" has subtype "Money(OBSOLETE)". (returned for item:20558 = [Warsong Gulch Mark of Honor]) This seems pretty weird, because the ItemSubtypes are likely to be displayed to the user by some addon... Are there any other weird ItemTypes/ItemSubtypes?

    3) For HandyNotes_Vendors I want to parse vendor's list and mark his type (Poison vendor, Reagents vendor, ...) according to his goods. Without language independent ItemTypes this is very hard. (I don't want to use PeriodicTable) Any other ideas, how to accomplish this?

    3b) How the Blizzard tracking recognizes vendor types? How does it decide, which vendors to display on Minimap when tracking Reagents vendors?

    Bonus question: When the itemcache is empty GetMerchantItemLink(idx) returns nil on MERCHANT_SHOW. How can I know the links are ready for scanning?
    Posted in: Lua Code Discussion
  • 0

    posted a message on Working with variable number of return values
    [PHP]return t == "binder" or IsInnkeeperTail(...)[/PHP]

    :( According to luac 5.1.4 this is NOT a tail call :o
    Posted in: Lua Code Discussion
  • 0

    posted a message on Working with variable number of return values
    Quote from sylvanaar
    [php]
    local function tail2(a, b, ...)
    if not a then return end

    -- process the "pair"
    print(a..b)

    return tail2(...)
    end
    [/php]

    This avoids the {...}, and loops using tail recursion.


    Wow! What a ingenious piece of code! I love it ;) Although I will stay with select() and a loop, because it is clearer for me...

    Edit: wow, it's even more ingenious then I thought. Just compare these two (each called as IsInnkeeperXxx(GetGossipOptions()) ):
    [PHP]
    local function IsInnkeeperSelect(...)
    for i=2, select("#", ...), 2 do -- just iterate over even items as these contain the type name
    if select(i, ...) == "binder" then
    return true -- found, no need to continue
    end
    end
    return false
    end

    local function IsInnkeeperTail(x, t, ...) -- x - text; t - texture/type
    if not x then return false end
    return t == "binder" or IsInnkeeperTail(...)
    end
    [/PHP]
    Posted in: Lua Code Discussion
  • 0

    posted a message on Looking for a flight master map addon, any ideas?
    IMHO, HandyNotes_FilghtMasters is currently the best addon displaying Flightpaths on the World Map.

    It depends on HandyNotes so you need two addons for it to work, but there are other HandyNotes addons (eg: Vendors and Trainers written by me 8))

    Also HandyNotes_FilghtMasters doesn't track flight times...
    Posted in: General Chat
  • 0

    posted a message on Handynotes
    Can you please add HandyNotes options to the Blizzard's Addons configuration window?
    Posted in: AddOn HELP!
  • 0

    posted a message on Working with variable number of return values
    Thank you all for your comments.

    I have one last question:
    If I have one list of itemids and database of lists of itemids, how can find, if the new list is already in the database or not?

    Using string lists and knowing all itemids are sorted according to some system, I can just compare strings, which is super-fast in Lua. (Lua compare just their "hashes")
    local newlist = CreateList()
    for k,v in pairs(itemlistdatabase) do
      if v == newlist then 
        return k -- found same list already in DB
      end
    end
    local key = GetNewKey()
    itemlistdatabase[key] = newlist
    return key -- added to DB under new key
    


    But when using tables instead of stringlists, I have to go through all inner tables and they need to be sorted as well. If they are not sorted there needs to be some even more complicated comparison system.

    I can create some "hashes" for easier searching - e.g. sum all itemids and compare just tables with the same sums.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Working with variable number of return values
    Thank you all for your answers and suggestions.

    I've encountered this issue when working with GetGossipOptions() and thus my question was created around it, and as you've written, there is almost no need for perfect efficiency, because the code is called once per GOSSIP_SHOW event.


    I've been planning on storing lists of itemids in SavedVariables and using comma separated string for the storage. Unpacking is rather easy, but it also returns all values as variable long list instead of a table:
    local item1, item2, item3 = strsplit(",", stringlist)

    I don't know, how many items will be stored in one list and thus I've asked this question.

    Maybe my whole idea is wrong. The purpose for the itemid lists is to display some of the items in the tooltip and search these lists for one particular itemid. Also I need to be able to append new itemids, if they are not already in the list (which is easy when working with strings). I'm not sure, if I will need to remove some itemids (not so easy - needs to recreate the whole string)

    When I was writing this post, new idea enterred my mind - instead of splitting the list for searching, it may be faster to do just string search:
    string.find(stringlist, searchitemid)
    Posted in: Lua Code Discussion
  • 0

    posted a message on Working with variable number of return values
    Hi,
    some of the WoW functions return variable number of values. GetGossipOptions() is one of them. What is the preferred way of parsing the results?
    I've used this code:
    local GossipOptions = { GetGossipOptions() } -- wrap in temporary table
    for i, v in ipairs(GossipOptions) do
    	-- do something
    end

    But as far as I know, this code creates garbage on each run, by creating temporary table.

    I've thought of another idea:
    local function GossipParse(...)
    	for i = 1, select("#", ...) do
    		local v = select(i, ...)
    		-- do something
    	end
    end
    GossipParse(GetGossipOptions())

    But I fear this creates temporary table in the background... (or does it?)

    Is there any better way?

    BTW: I know that GetGossipOptions() returns results in pairs, but this is not point of this question.
    Posted in: Lua Code Discussion
  • 0

    posted a message on AHsearch
    Hi, thank you for such great yet simple addon ;)

    Just a minor issue: The button strata/level is to high. When I open WorldMap (I'm using Mapster), AHSearch button is displayed over the map. Can you please fix it?

    Also: You've integrated AHSearchNext into your addon, but AFAIK it is only accessible from keybinding. Can you create button or menu entry for selecting "next" search?
    Posted in: General AddOns
  • 0

    posted a message on Wowace packager - auto Alpha packages from SVN branches
    The last one is a trick ;)

    If I understand the code correctly it shouldn't work:
    [PHP]if tag_name.lower().endswith('-alpha'):[/PHP]

    I don't understand, why the hyphen is needed for Alpha tags and IMHO should be optional...
    Posted in: General Chat
  • 0

    posted a message on Wowace packager - auto Alpha packages from SVN branches
    I don't know if the changes are live (haven't tested it), but I'm referring to this changeset of wowace/curseforge packager:
    http://hg.curseforge.net/www/curseforge-packager/mainline/rev/9531dcc92efe
    Posted in: General Chat
  • 0

    posted a message on Wowace packager - auto Alpha packages from SVN branches
    Quote from Nevcairiel
    No, the automated alpha versions will only ever be created from trunk.


    Ok, thanks for your reply.

    I was thinking about it from your perspective and it would create to many problems to solve just a minor issue (names of files, ui for users to distinguish between trunk versions and branch version, ui for developers and addon managers, ...)

    Can you please update KB article about tagging as Alpha versions?

    What is the proper tag name for Alpha version?
    - "anything-alpha"
    - "r45-alpha"
    - "1.1.5-alpha"
    - "v1.1.7 Alpha"
    Posted in: General Chat
  • 0

    posted a message on Ackis Recipe List
    Quote from Ackis
    The reason that it's mining, not smelting is because the trade skill window is considered "Mining"... I changed it to smelting and it broke shit heh... I think I may have to look into this more.

    Yeah, I'm sorry for confusion - it seems there is problem associated with lilsparky's Skillet, which I have been using at that time. ARL seemed to work without using using Skillet (cannot check now). I've reported the issue to lilsparky in his thread, but I forgot to update my post here :(

    When I have my account sorted out, I'll try to test it more - just create new character, level it up to level 5 and get Mining. (BTW: How long does it take to get reply from Blizzard's billing support?)
    Posted in: General AddOns
  • To post a comment, please or register a new account.