Vysci / Enchanter

WoW Addon that helps enchanters get connected with those looking for enchants
MIT License
2 stars 11 forks source link

added some enchants #3

Closed caffeineaddiction closed 3 years ago

caffeineaddiction commented 3 years ago

When TBC hit I went through and updated a weakaura I wrote a while ago to include ALL enchants. I updated my data to fit yours, though it might need a bit of tweaking as my code looks for multiple tags.

Feel free to take what you want, or merge as is. Your call.

caffeineaddiction commented 3 years ago

feel free to hit me up on discord if you wish: caffeineaddiction#0001

Vysci commented 3 years ago

I took a couple of recipes that were missing (advanced herbalism, mining to gloves, riding skill)

Like you said you included all of the enchants which is something I want to avoid. Almost never is any one looking for a huge majority of the low level recipes so no reason to add extra CPU time for that rare case that someone actually wants those. Also your tags are really generic which is something I am trying to avoid as I don't want to incorrectly invite people and I also want to be able to uniquely identify what they are actually looking for so I can link it to them

caffeineaddiction commented 3 years ago

Yep, np I totally understand. The main reason I have everything is because I have the inviting and the linking as two diff pieces of code. My linking only works via whisper and party chat, and allows them to do stuff like link gloves agi and get a full listing of what is available.

_ae.grepEnchant = function(aString, sendMsg, aMin)
    local tFound = 0
    local tOut = {}
    for k, v in pairs(eDict) do
        ltFound = 0
        for key = 1, #v['keys'] do
            if string.match(aString, v['keys'][key]) then
                tOut[tFound + 1] = v['link']
                ltFound = ltFound + 1
            end
        end
        if ltFound >= aMin then
            tFound = tFound + 1
        end
    end
    if tFound > 5 then
        tReturn = _ae.grepEnchant(aString, sendMsg, aMin + 1)
        if tReturn > 0 then return tReturn end
    end
    if tFound > 0 then
        local tWispCount = 0
        for n = 1, tFound do
            sendMsg(tOut[n])
            -- SendChatMessage(tOut[n], "WHISPER", "Common", aAuthor);
            tWispCount = tWispCount + 1
            if tWispCount > 5 then
                sendMsg("and more ...")
                return tFound 
            end
        end
    end
    return tFound
end

This works great for what I use it for, but would be terrible for auto inviting.

Vysci commented 3 years ago

Ah that makes absolute sense. It also explains why you have all the recipes. It would work poorly if you had a quarter of the recipes