I have an addon I am trying to update that would pull the rune count, by type and make spell suggestions based on what it found. I am trying to update this, to simply return the count for all of the runes (as the rune system changed). Would anyone mind helping me here? I took a crack at it, but it doesn't seem to be working
Thanks for helping - I am fairly new to this.
New (not working):
Code:
local runes_c = {
[1] = 0,
[2] = 0,
[3] = 0,
[4] = 0,
[5] = 0,
[6] = 0
}
Goof.condition.register("runes.count", function(target, rune)
local rune = string.lower(rune)
runes_c[1], runes_c[2], runes_c[3], runes_c[4], runes_c[5], runes_c[6] = 0,0,0,0,0,0
for i=1, 6 do
local _, _, c = GetRuneCooldown(i)
if c then
runes_c[i] = runes_c[i] + 1
end
end
return runes_c[1] + runes_c[2] + runes_c[3] + runes_c[4] + runes_c[5] + runes_c[6]
end)
Original:
Code:
local runes_t = {
[1] = 0,
[2] = 0,
[3] = 0,
[4] = 0
}
local runes_c = {
[1] = 0,
[2] = 0,
[3] = 0,
[4] = 0
}
Goof.condition.register("runes.count", function(target, rune)
local rune = string.lower(rune)
runes_t[1], runes_t[2], runes_t[3], runes_t[4], runes_c[1], runes_c[2], runes_c[3], runes_c[4] = 0,0,0,0,0,0,0,0
for i=1, 6 do
local _, _, c = GetRuneCooldown(i)
local t = GetRuneType(i)
runes_t[t] = runes_t[t] + 1
if c then
runes_c[t] = runes_c[t] + 1
end
end
if rune == 'frost' then
return runes_c[3] + runes_c[4]
elseif rune == 'blood' then
return runes_c[1] + runes_c[4]
elseif rune == 'unholy' then
return runes_c[2] + runes_c[4]
elseif rune == 'death' then
return runes_c[4]
end
return 0
end)