I'd like to have an addon that lists the colours and amounts of gems currently socketed in my gear. Since this is obviously just for the benefit of seeing which metagems are useable for the character I guess a metagem recommendation would go well with that.
However, I am severely retarded in terms of programming things, so I can't do this myself. Anyone feel like taking this on?
Edit: I suggest that someone with access to the US forum ask Slouken for an API like GetSocketedGemCount(color) to be added.
Otherwise, something like the following might work. (this is a drycoded function, might not work. Needs Gratuity. Needs Omnibus or another script editor to be tested.)
function CountGems()
local colors = {}
local G = AceLibrary("Gratuity-2.0")
local addcolors = function (...)
local count = select("#", ...)
if count == 0 then return end
for i = 1, count do
local color = select(i, ...)
colors[color] = (colors[color] or 0) + 1
end
return true
end
HideUIPanel(ItemSocketingFrame)
UIParent:UnregisterEvent("SOCKET_INFO_UPDATE")
for slotId = 0, 20 do
-- inventory slots
SocketInventoryItem(slotId)
-- assume that this make the following information available without delay
if GetSocketItemInfo() then
for gemId = 1, GetNumSockets() do
if GetExistingSocketInfo(gemId) then
G:SetExistingSocketGem(gemId)
-- assume the color description is on the last tooltip line
local line = G:GetLine(G:NumLines())
local found = addcolors(line:match("Matches a ([^%s]+) Socket")) or
addcolors(line:match("Matches a ([^%s]+) or ([^%s]+) Socket")) or
addcolors(line:match("Matches a ([^%s]+), ([^%s]+) or ([^%s]+) Socket"))
end
end
end
CloseSocketInfo()
end
UIParent:RegisterEvent("SOCKET_INFO_UPDATE")
ChatFrame1:AddMessage("Gem Color count :")
for color, count in pairs(colors) do
ChatFrame1:AddMessage(string.format("%s : %d", color, count))
end
end
However, I am severely retarded in terms of programming things, so I can't do this myself. Anyone feel like taking this on?
Edit: I suggest that someone with access to the US forum ask Slouken for an API like GetSocketedGemCount(color) to be added.
Otherwise, something like the following might work. (this is a drycoded function, might not work. Needs Gratuity. Needs Omnibus or another script editor to be tested.)
http://www.wowinterface.com/downloads/info7081-GemCounter0.1.0.html