Hasn't worked since 4.0 but saw that people had it working, anyone have a clue as to how I can get it functional again?
Interrupt Bar
Started by Bigbadburks, Nov 03 2010 04:23 PM
12 replies to this topic
#1
Posted 03 November 2010 - 04:23 PM
#2
Posted 03 November 2010 - 05:06 PM
Are you throwing Lua errors?
"Who, after all, is today speaking of the destruction of the Armenians?"
-Adolf Hitler, 1939
-Adolf Hitler, 1939
#3
Posted 03 November 2010 - 05:45 PM
Bigbadburks said:
Hasn't worked since 4.0 but saw that people had it working, anyone have a clue as to how I can get it functional again?
Try using this one. http://wowinterface....withRebuke.html
#4
Posted 03 November 2010 - 07:14 PM
I haven't gotten any LUA errors for InterruptBar and I don't have LUA errors disabled.
#5
Posted 03 November 2010 - 07:17 PM
And it just straight up doesn't do anything? No code loads, you don't get any initialization messages, and /ib does nothing? Are you sure it's enabled from the list of addons from the log-in screen?
"Who, after all, is today speaking of the destruction of the Armenians?"
-Adolf Hitler, 1939
-Adolf Hitler, 1939
#6
Posted 03 November 2010 - 08:26 PM
Yes, it's enabled. I updated the spell id's in it and I'm getting a few problems. No LUA errors though. Here are some screen shots:

As you can see I'm getting two bars for some reason. I don't have a duplicate of the addon in my addon folder so I don't understand why it's doing that. Secondly, I have the two feral charge spell ID's for cat and bear feral charges but it's showing bear charge twice.

As you can see I'm getting two bars for some reason. I don't have a duplicate of the addon in my addon folder so I don't understand why it's doing that. Secondly, I have the two feral charge spell ID's for cat and bear feral charges but it's showing bear charge twice.
#7
Posted 03 November 2010 - 09:11 PM
What in the name of hell... that makes no god damn sense.
Can you try backing up your Interface / WTF, and sticking in just InterruptBar? I seriously doubt this is going to do anything though.
Can you try backing up your Interface / WTF, and sticking in just InterruptBar? I seriously doubt this is going to do anything though.
"Who, after all, is today speaking of the destruction of the Armenians?"
-Adolf Hitler, 1939
-Adolf Hitler, 1939
#8
Posted 03 November 2010 - 11:49 PM
Yeah, same deal even after putting in just IB.
#9
Posted 04 November 2010 - 03:41 AM
Just for shits & giggles, can you post the entirety of your IB's code? Maybe find someone who has working IB code, and get them to post it, diff it.
"Who, after all, is today speaking of the destruction of the Armenians?"
-Adolf Hitler, 1939
-Adolf Hitler, 1939
#10
Posted 04 November 2010 - 06:01 AM
----------------------------------------------------
-- Interrupt Bar by Kollektiv
-- Rebuke and Skull Bash (Cat Form) spells added by Tiriar
----------------------------------------------------
InterruptBarDB = InterruptBarDB or { scale = 1, hidden = false, lock = false, }
local abilities = {}
local order
local band = bit.band
-- Added rebuke (10) to the end of the list.
local spellids = {[6552] = 10, [2139] = 24, [19647] = 24, [16979] = 15, [1766] = 10, [47528] = 10, [85285] = 10, [80965] = 10, [49376] = 30, [8122] = 30, [853] = 60, [65542] = 45, [57994] = 6, [30283] = 20, [19503] = 30, [34490] = 20, [44572] = 30, [85388] = 45, [20252] = 15, [78675] = 60}
for spellid,time in pairs(spellids) do
local name,_,spellicon = GetSpellInfo(spellid)
abilities[name] = { icon = spellicon, duration = time }
end
-----------------------------------------------------
-- Edit this table to change the order
-----------------------------------------------------
-- 6552 Pummel
-- 2139 Counterspell
-- 19647 Spell Lock
-- 16979 Feral Charge
-- 49376 Feral Charge
-- 1766 Kick
-- 47528 Mind Freeze
-- 85285 Rebuke
-- 80965 Skull Bash (Cat Form)
-- 8122 Psychic Scream
-- 853 Hammer of Justice
-- 65542 Silence
-- 57994 Wind Shear
-- 30283 Shadowfury
-- 19503 Scatter Shot
-- 34490 Silencing Shot
-- 44572 Deep Freeze
-- 85388 Throwdown
-- 20252 Intercept
-- 78675 Solar Beam
-----------------------------------------------------
-- Added rebuke to the end of the list.
local order = {6552, 2139, 19647, 1766, 47528, 57994, 16979, 49376, 85285, 80965, 8122, 853, 65542, 30283, 19503, 34490, 44572, 85388, 20252, 78675}
-----------------------------------------------------
-----------------------------------------------------
for k,v in ipairs(order) do order[k] = GetSpellInfo(v) end
local frame
local bar
local GetTime = GetTime
local ipairs = ipairs
local pairs = pairs
local select = select
local floor = floor
local band = bit.band
local GetSpellInfo = GetSpellInfo
local GROUP_UNITS = bit.bor(0x00000010, 0x00000400)
local activetimers = {}
local size = 0
local function getsize()
size = 0
for k in pairs(activetimers) do
size = size + 1
end
end
local function InterruptBar_AddIcons()
local x = -45
for _,ability in ipairs(order) do
local btn = CreateFrame("Frame",nil,bar)
btn:SetWidth(30)
btn:SetHeight(30)
btn:SetPoint("CENTER",bar,"CENTER",x,0)
btn:SetFrameStrata("LOW")
local cd = CreateFrame("Cooldown",nil,btn)
cd.noomnicc = true
cd.noCooldownCount = true
cd:SetAllPoints(true)
cd:SetFrameStrata("MEDIUM")
cd:Hide()
local texture = btn:CreateTexture(nil,"BACKGROUND")
texture:SetAllPoints(true)
texture:SetTexture(abilities[ability].icon)
texture:SetTexCoord(0.07,0.9,0.07,0.90)
local text = cd:CreateFontString(nil,"ARTWORK")
text:SetFont(STANDARD_TEXT_FONT,18,"OUTLINE")
text:SetTextColor(1,1,0,1)
text:SetPoint("LEFT",btn,"LEFT",2,0)
btn.texture = texture
btn.text = text
btn.duration = abilities[ability].duration
btn.cd = cd
bar[ability] = btn
x = x + 30
end
end
local function InterruptBar_SavePosition()
local point, _, relativePoint, xOfs, yOfs = bar:GetPoint()
if not InterruptBarDB.Position then
InterruptBarDB.Position = {}
end
InterruptBarDB.Position.point = point
InterruptBarDB.Position.relativePoint = relativePoint
InterruptBarDB.Position.xOfs = xOfs
InterruptBarDB.Position.yOfs = yOfs
end
local function InterruptBar_LoadPosition()
if InterruptBarDB.Position then
bar:SetPoint(InterruptBarDB.Position.point,UIParent,InterruptBarDB.Position.relativePoint,InterruptBarDB.Position.xOfs,InterruptBarDB.Position.yOfs)
else
bar:SetPoint("CENTER", UIParent, "CENTER")
end
end
local function InterruptBar_UpdateBar()
bar:SetScale(InterruptBarDB.scale)
if InterruptBarDB.hidden then
for _,v in ipairs(order) do bar[v]:Hide() end
else
for _,v in ipairs(order) do bar[v]:Show() end
end
if InterruptBarDB.lock then
bar:EnableMouse(false)
else
bar:EnableMouse(true)
end
end
local function InterruptBar_CreateBar()
bar = CreateFrame("Frame", nil, UIParent)
bar:SetMovable(true)
bar:SetWidth(120)
bar:SetHeight(30)
bar:SetClampedToScreen(true)
bar:SetScript("OnMouseDown",function(self,button) if button == "LeftButton" then self:StartMoving() end end)
bar:SetScript("OnMouseUp",function(self,button) if button == "LeftButton" then self:StopMovingOrSizing() InterruptBar_SavePosition() end end)
bar:Show()
InterruptBar_AddIcons()
InterruptBar_UpdateBar()
InterruptBar_LoadPosition()
end
local function InterruptBar_UpdateText(text,cooldown)
if cooldown < 10 then
if cooldown <= 0.5 then
text:SetText("")
else
text:SetFormattedText(" %d",cooldown)
end
else
text:SetFormattedText("%d",cooldown)
end
if cooldown < 6 then
text:SetTextColor(1,0,0,1)
else
text:SetTextColor(1,1,0,1)
end
end
local function InterruptBar_StopAbility(ref,ability)
if InterruptBarDB.hidden then ref:Hide() end
if activetimers[ability] then activetimers[ability] = nil end
ref.text:SetText("")
ref.cd:Hide()
end
local time = 0
local function InterruptBar_OnUpdate(self, elapsed)
time = time + elapsed
if time > 0.25 then
getsize()
for ability,ref in pairs(activetimers) do
ref.cooldown = ref.start + ref.duration - GetTime()
if ref.cooldown <= 0 then
InterruptBar_StopAbility(ref,ability)
else
InterruptBar_UpdateText(ref.text,floor(ref.cooldown+0.5))
end
end
if size == 0 then frame:SetScript("OnUpdate",nil) end
time = time - 0.25
end
end
local function InterruptBar_StartTimer(ref,ability)
if InterruptBarDB.hidden then
ref:Show()
end
if not activetimers[ability] then
local duration
activetimers[ability] = ref
ref.cd:Show()
ref.cd:SetCooldown(GetTime()-0.40,ref.duration)
ref.start = GetTime()
InterruptBar_UpdateText(ref.text,ref.duration)
end
frame:SetScript("OnUpdate",InterruptBar_OnUpdate)
end
local function InterruptBar_COMBAT_LOG_EVENT_UNFILTERED(...)
local spellID, ability, useSecondDuration
return function(_, eventtype, _, srcName, srcFlags, _, dstName, dstFlags, id)
if (band(srcFlags, 0x00000040) == 0x00000040 and eventtype == "SPELL_CAST_SUCCESS") then
spellID = id
else
return
end
useSecondDuration = false
if spellID == 49376 then spellID = 16979; useSecondDuration = true end -- Feral Charge - Cat -> Feral Charge - Bear
ability = GetSpellInfo(spellID)
if abilities[ability] then
if useSecondDuration and spellID == 16979 then
bar[ability].duration = 30
elseif spellID == 16979 then
bar[ability].duration = 15
end
InterruptBar_StartTimer(bar[ability],ability)
end
end
end
InterruptBar_COMBAT_LOG_EVENT_UNFILTERED = InterruptBar_COMBAT_LOG_EVENT_UNFILTERED()
local function InterruptBar_ResetAllTimers()
for _,ability in ipairs(order) do
InterruptBar_StopAbility(bar[ability])
end
active = 0
end
local function InterruptBar_PLAYER_ENTERING_WORLD(self)
InterruptBar_ResetAllTimers()
end
local function InterruptBar_Reset()
InterruptBarDB = { scale = 1, hidden = false, lock = false }
InterruptBar_UpdateBar()
InterruptBar_LoadPosition()
end
local function InterruptBar_Test()
for _,ability in ipairs(order) do
InterruptBar_StartTimer(bar[ability],ability)
end
end
local cmdfuncs = {
scale = function(v) InterruptBarDB.scale = v; InterruptBar_UpdateBar() end,
hidden = function() InterruptBarDB.hidden = not InterruptBarDB.hidden; InterruptBar_UpdateBar() end,
lock = function() InterruptBarDB.lock = not InterruptBarDB.lock; InterruptBar_UpdateBar() end,
reset = function() InterruptBar_Reset() end,
test = function() InterruptBar_Test() end,
}
local cmdtbl = {}
function InterruptBar_Command(cmd)
for k in ipairs(cmdtbl) do
cmdtbl[k] = nil
end
for v in gmatch(cmd, "[^ ]+") do
tinsert(cmdtbl, v)
end
local cb = cmdfuncs[cmdtbl[1]]
if cb then
local s = tonumber(cmdtbl[2])
cb(s)
else
ChatFrame1:AddMessage("InterruptBar Options | /ib <option>",0,1,0)
ChatFrame1:AddMessage("-- scale <number> | value: " .. InterruptBarDB.scale,0,1,0)
ChatFrame1:AddMessage("-- hidden (toggle) | value: " .. tostring(InterruptBarDB.hidden),0,1,0)
ChatFrame1:AddMessage("-- lock (toggle) | value: " .. tostring(InterruptBarDB.lock),0,1,0)
ChatFrame1:AddMessage("-- test (execute)",0,1,0)
ChatFrame1:AddMessage("-- reset (execute)",0,1,0)
end
end
local function InterruptBar_OnLoad(self)
self:RegisterEvent("PLAYER_ENTERING_WORLD")
self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
if not InterruptBarDB.scale then InterruptBarDB.scale = 1 end
if not InterruptBarDB.hidden then InterruptBarDB.hidden = false end
if not InterruptBarDB.lock then InterruptBarDB.lock = false end
InterruptBar_CreateBar()
SlashCmdList["InterruptBar"] = InterruptBar_Command
SLASH_InterruptBar1 = "/ib"
ChatFrame1:AddMessage("Interrupt Bar by Kollektiv. Type /ib for options.",0,1,0)
end
local eventhandler = {
["VARIABLES_LOADED"] = function(self) InterruptBar_OnLoad(self) end,
["PLAYER_ENTERING_WORLD"] = function(self) InterruptBar_PLAYER_ENTERING_WORLD(self) end,
["COMBAT_LOG_EVENT_UNFILTERED"] = function(self,...) InterruptBar_COMBAT_LOG_EVENT_UNFILTERED(...) end,
}
local function InterruptBar_OnEvent(self,event,...)
eventhandler[event](self,...)
end
frame = CreateFrame("Frame",nil,UIParent)
frame:SetScript("OnEvent",InterruptBar_OnEvent)
frame:RegisterEvent("VARIABLES_LOADED")
----------------------------------------------------
-- Interrupt Bar by Kollektiv
-- Rebuke and Skull Bash (Cat Form) spells added by Tiriar
----------------------------------------------------
InterruptBarDB = InterruptBarDB or { scale = 1, hidden = false, lock = false, }
local abilities = {}
local order
local band = bit.band
-- Added rebuke (10) to the end of the list.
local spellids = {[6552] = 10, [2139] = 24, [19647] = 24, [16979] = 15, [1766] = 10, [47528] = 10, [85285] = 10, [80965] = 10}
for spellid,time in pairs(spellids) do
local name,_,spellicon = GetSpellInfo(spellid)
abilities[name] = { icon = spellicon, duration = time }
end
-----------------------------------------------------
-- Edit this table to change the order
-----------------------------------------------------
-- 6552 Pummel
-- 2139 Counterspell
-- 19647 Spell Lock
-- 16979 Feral Charge
-- 1766 Kick
-- 47528 Mind Freeze
-- 85285 Rebuke
-- 80965 Skull Bash (Cat Form)
-----------------------------------------------------
-- Added rebuke to the end of the list.
local order = {6552, 2139, 19647, 1766, 47528, 16979, 85285, 80965}
-----------------------------------------------------
-----------------------------------------------------
for k,v in ipairs(order) do order[k] = GetSpellInfo(v) end
local frame
local bar
local GetTime = GetTime
local ipairs = ipairs
local pairs = pairs
local select = select
local floor = floor
local band = bit.band
local GetSpellInfo = GetSpellInfo
local GROUP_UNITS = bit.bor(0x00000010, 0x00000400)
local activetimers = {}
local size = 0
local function getsize()
size = 0
for k in pairs(activetimers) do
size = size + 1
end
end
local function InterruptBar_AddIcons()
local x = -45
for _,ability in ipairs(order) do
local btn = CreateFrame("Frame",nil,bar)
btn:SetWidth(30)
btn:SetHeight(30)
btn:SetPoint("CENTER",bar,"CENTER",x,0)
btn:SetFrameStrata("LOW")
local cd = CreateFrame("Cooldown",nil,btn)
cd.noomnicc = true
cd.noCooldownCount = true
cd:SetAllPoints(true)
cd:SetFrameStrata("MEDIUM")
cd:Hide()
local texture = btn:CreateTexture(nil,"BACKGROUND")
texture:SetAllPoints(true)
texture:SetTexture(abilities[ability].icon)
texture:SetTexCoord(0.07,0.9,0.07,0.90)
local text = cd:CreateFontString(nil,"ARTWORK")
text:SetFont(STANDARD_TEXT_FONT,18,"OUTLINE")
text:SetTextColor(1,1,0,1)
text:SetPoint("LEFT",btn,"LEFT",2,0)
btn.texture = texture
btn.text = text
btn.duration = abilities[ability].duration
btn.cd = cd
bar[ability] = btn
x = x + 30
end
end
local function InterruptBar_SavePosition()
local point, _, relativePoint, xOfs, yOfs = bar:GetPoint()
if not InterruptBarDB.Position then
InterruptBarDB.Position = {}
end
InterruptBarDB.Position.point = point
InterruptBarDB.Position.relativePoint = relativePoint
InterruptBarDB.Position.xOfs = xOfs
InterruptBarDB.Position.yOfs = yOfs
end
local function InterruptBar_LoadPosition()
if InterruptBarDB.Position then
bar:SetPoint(InterruptBarDB.Position.point,UIParent,InterruptBarDB.Position.relativePoint,InterruptBarDB.Position.xOfs,InterruptBarDB.Position.yOfs)
else
bar:SetPoint("CENTER", UIParent, "CENTER")
end
end
local function InterruptBar_UpdateBar()
bar:SetScale(InterruptBarDB.scale)
if InterruptBarDB.hidden then
for _,v in ipairs(order) do bar[v]:Hide() end
else
for _,v in ipairs(order) do bar[v]:Show() end
end
if InterruptBarDB.lock then
bar:EnableMouse(false)
else
bar:EnableMouse(true)
end
end
local function InterruptBar_CreateBar()
bar = CreateFrame("Frame", nil, UIParent)
bar:SetMovable(true)
bar:SetWidth(120)
bar:SetHeight(30)
bar:SetClampedToScreen(true)
bar:SetScript("OnMouseDown",function(self,button) if button == "LeftButton" then self:StartMoving() end end)
bar:SetScript("OnMouseUp",function(self,button) if button == "LeftButton" then self:StopMovingOrSizing() InterruptBar_SavePosition() end end)
bar:Show()
InterruptBar_AddIcons()
InterruptBar_UpdateBar()
InterruptBar_LoadPosition()
end
local function InterruptBar_UpdateText(text,cooldown)
if cooldown < 10 then
if cooldown <= 0.5 then
text:SetText("")
else
text:SetFormattedText(" %d",cooldown)
end
else
text:SetFormattedText("%d",cooldown)
end
if cooldown < 6 then
text:SetTextColor(1,0,0,1)
else
text:SetTextColor(1,1,0,1)
end
end
local function InterruptBar_StopAbility(ref,ability)
if InterruptBarDB.hidden then ref:Hide() end
if activetimers[ability] then activetimers[ability] = nil end
ref.text:SetText("")
ref.cd:Hide()
end
local time = 0
local function InterruptBar_OnUpdate(self, elapsed)
time = time + elapsed
if time > 0.25 then
getsize()
for ability,ref in pairs(activetimers) do
ref.cooldown = ref.start + ref.duration - GetTime()
if ref.cooldown <= 0 then
InterruptBar_StopAbility(ref,ability)
else
InterruptBar_UpdateText(ref.text,floor(ref.cooldown+0.5))
end
end
if size == 0 then frame:SetScript("OnUpdate",nil) end
time = time - 0.25
end
end
local function InterruptBar_StartTimer(ref,ability)
if InterruptBarDB.hidden then
ref:Show()
end
if not activetimers[ability] then
local duration
activetimers[ability] = ref
ref.cd:Show()
ref.cd:SetCooldown(GetTime()-0.40,ref.duration)
ref.start = GetTime()
InterruptBar_UpdateText(ref.text,ref.duration)
end
frame:SetScript("OnUpdate",InterruptBar_OnUpdate)
end
local function InterruptBar_COMBAT_LOG_EVENT_UNFILTERED(...)
local spellID, ability, useSecondDuration
return function(_, eventtype, _, srcName, srcFlags, _, dstName, dstFlags, id)
if (band(srcFlags, 0x00000040) == 0x00000040 and eventtype == "SPELL_CAST_SUCCESS") then
spellID = id
else
return
end
useSecondDuration = false
if spellID == 49376 then spellID = 16979; useSecondDuration = true end -- Feral Charge - Cat -> Feral Charge - Bear
ability = GetSpellInfo(spellID)
if abilities[ability] then
if useSecondDuration and spellID == 16979 then
bar[ability].duration = 30
elseif spellID == 16979 then
bar[ability].duration = 15
end
InterruptBar_StartTimer(bar[ability],ability)
end
end
end
InterruptBar_COMBAT_LOG_EVENT_UNFILTERED = InterruptBar_COMBAT_LOG_EVENT_UNFILTERED()
local function InterruptBar_ResetAllTimers()
for _,ability in ipairs(order) do
InterruptBar_StopAbility(bar[ability])
end
active = 0
end
local function InterruptBar_PLAYER_ENTERING_WORLD(self)
InterruptBar_ResetAllTimers()
end
local function InterruptBar_Reset()
InterruptBarDB = { scale = 1, hidden = false, lock = false }
InterruptBar_UpdateBar()
InterruptBar_LoadPosition()
end
local function InterruptBar_Test()
for _,ability in ipairs(order) do
InterruptBar_StartTimer(bar[ability],ability)
end
end
local cmdfuncs = {
scale = function(v) InterruptBarDB.scale = v; InterruptBar_UpdateBar() end,
hidden = function() InterruptBarDB.hidden = not InterruptBarDB.hidden; InterruptBar_UpdateBar() end,
lock = function() InterruptBarDB.lock = not InterruptBarDB.lock; InterruptBar_UpdateBar() end,
reset = function() InterruptBar_Reset() end,
test = function() InterruptBar_Test() end,
}
local cmdtbl = {}
function InterruptBar_Command(cmd)
for k in ipairs(cmdtbl) do
cmdtbl[k] = nil
end
for v in gmatch(cmd, "[^ ]+") do
tinsert(cmdtbl, v)
end
local cb = cmdfuncs[cmdtbl[1]]
if cb then
local s = tonumber(cmdtbl[2])
cb(s)
else
ChatFrame1:AddMessage("InterruptBar Options | /ib <option>",0,1,0)
ChatFrame1:AddMessage("-- scale <number> | value: " .. InterruptBarDB.scale,0,1,0)
ChatFrame1:AddMessage("-- hidden (toggle) | value: " .. tostring(InterruptBarDB.hidden),0,1,0)
ChatFrame1:AddMessage("-- lock (toggle) | value: " .. tostring(InterruptBarDB.lock),0,1,0)
ChatFrame1:AddMessage("-- test (execute)",0,1,0)
ChatFrame1:AddMessage("-- reset (execute)",0,1,0)
end
end
local function InterruptBar_OnLoad(self)
self:RegisterEvent("PLAYER_ENTERING_WORLD")
self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
if not InterruptBarDB.scale then InterruptBarDB.scale = 1 end
if not InterruptBarDB.hidden then InterruptBarDB.hidden = false end
if not InterruptBarDB.lock then InterruptBarDB.lock = false end
InterruptBar_CreateBar()
SlashCmdList["InterruptBar"] = InterruptBar_Command
SLASH_InterruptBar1 = "/ib"
ChatFrame1:AddMessage("Interrupt Bar by Kollektiv. Type /ib for options.",0,1,0)
end
local eventhandler = {
["VARIABLES_LOADED"] = function(self) InterruptBar_OnLoad(self) end,
["PLAYER_ENTERING_WORLD"] = function(self) InterruptBar_PLAYER_ENTERING_WORLD(self) end,
["COMBAT_LOG_EVENT_UNFILTERED"] = function(self,...) InterruptBar_COMBAT_LOG_EVENT_UNFILTERED(...) end,
}
local function InterruptBar_OnEvent(self,event,...)
eventhandler[event](self,...)
end
frame = CreateFrame("Frame",nil,UIParent)
frame:SetScript("OnEvent",InterruptBar_OnEvent)
frame:RegisterEvent("VARIABLES_LOADED")
-- Interrupt Bar by Kollektiv
-- Rebuke and Skull Bash (Cat Form) spells added by Tiriar
----------------------------------------------------
InterruptBarDB = InterruptBarDB or { scale = 1, hidden = false, lock = false, }
local abilities = {}
local order
local band = bit.band
-- Added rebuke (10) to the end of the list.
local spellids = {[6552] = 10, [2139] = 24, [19647] = 24, [16979] = 15, [1766] = 10, [47528] = 10, [85285] = 10, [80965] = 10, [49376] = 30, [8122] = 30, [853] = 60, [65542] = 45, [57994] = 6, [30283] = 20, [19503] = 30, [34490] = 20, [44572] = 30, [85388] = 45, [20252] = 15, [78675] = 60}
for spellid,time in pairs(spellids) do
local name,_,spellicon = GetSpellInfo(spellid)
abilities[name] = { icon = spellicon, duration = time }
end
-----------------------------------------------------
-- Edit this table to change the order
-----------------------------------------------------
-- 6552 Pummel
-- 2139 Counterspell
-- 19647 Spell Lock
-- 16979 Feral Charge
-- 49376 Feral Charge
-- 1766 Kick
-- 47528 Mind Freeze
-- 85285 Rebuke
-- 80965 Skull Bash (Cat Form)
-- 8122 Psychic Scream
-- 853 Hammer of Justice
-- 65542 Silence
-- 57994 Wind Shear
-- 30283 Shadowfury
-- 19503 Scatter Shot
-- 34490 Silencing Shot
-- 44572 Deep Freeze
-- 85388 Throwdown
-- 20252 Intercept
-- 78675 Solar Beam
-----------------------------------------------------
-- Added rebuke to the end of the list.
local order = {6552, 2139, 19647, 1766, 47528, 57994, 16979, 49376, 85285, 80965, 8122, 853, 65542, 30283, 19503, 34490, 44572, 85388, 20252, 78675}
-----------------------------------------------------
-----------------------------------------------------
for k,v in ipairs(order) do order[k] = GetSpellInfo(v) end
local frame
local bar
local GetTime = GetTime
local ipairs = ipairs
local pairs = pairs
local select = select
local floor = floor
local band = bit.band
local GetSpellInfo = GetSpellInfo
local GROUP_UNITS = bit.bor(0x00000010, 0x00000400)
local activetimers = {}
local size = 0
local function getsize()
size = 0
for k in pairs(activetimers) do
size = size + 1
end
end
local function InterruptBar_AddIcons()
local x = -45
for _,ability in ipairs(order) do
local btn = CreateFrame("Frame",nil,bar)
btn:SetWidth(30)
btn:SetHeight(30)
btn:SetPoint("CENTER",bar,"CENTER",x,0)
btn:SetFrameStrata("LOW")
local cd = CreateFrame("Cooldown",nil,btn)
cd.noomnicc = true
cd.noCooldownCount = true
cd:SetAllPoints(true)
cd:SetFrameStrata("MEDIUM")
cd:Hide()
local texture = btn:CreateTexture(nil,"BACKGROUND")
texture:SetAllPoints(true)
texture:SetTexture(abilities[ability].icon)
texture:SetTexCoord(0.07,0.9,0.07,0.90)
local text = cd:CreateFontString(nil,"ARTWORK")
text:SetFont(STANDARD_TEXT_FONT,18,"OUTLINE")
text:SetTextColor(1,1,0,1)
text:SetPoint("LEFT",btn,"LEFT",2,0)
btn.texture = texture
btn.text = text
btn.duration = abilities[ability].duration
btn.cd = cd
bar[ability] = btn
x = x + 30
end
end
local function InterruptBar_SavePosition()
local point, _, relativePoint, xOfs, yOfs = bar:GetPoint()
if not InterruptBarDB.Position then
InterruptBarDB.Position = {}
end
InterruptBarDB.Position.point = point
InterruptBarDB.Position.relativePoint = relativePoint
InterruptBarDB.Position.xOfs = xOfs
InterruptBarDB.Position.yOfs = yOfs
end
local function InterruptBar_LoadPosition()
if InterruptBarDB.Position then
bar:SetPoint(InterruptBarDB.Position.point,UIParent,InterruptBarDB.Position.relativePoint,InterruptBarDB.Position.xOfs,InterruptBarDB.Position.yOfs)
else
bar:SetPoint("CENTER", UIParent, "CENTER")
end
end
local function InterruptBar_UpdateBar()
bar:SetScale(InterruptBarDB.scale)
if InterruptBarDB.hidden then
for _,v in ipairs(order) do bar[v]:Hide() end
else
for _,v in ipairs(order) do bar[v]:Show() end
end
if InterruptBarDB.lock then
bar:EnableMouse(false)
else
bar:EnableMouse(true)
end
end
local function InterruptBar_CreateBar()
bar = CreateFrame("Frame", nil, UIParent)
bar:SetMovable(true)
bar:SetWidth(120)
bar:SetHeight(30)
bar:SetClampedToScreen(true)
bar:SetScript("OnMouseDown",function(self,button) if button == "LeftButton" then self:StartMoving() end end)
bar:SetScript("OnMouseUp",function(self,button) if button == "LeftButton" then self:StopMovingOrSizing() InterruptBar_SavePosition() end end)
bar:Show()
InterruptBar_AddIcons()
InterruptBar_UpdateBar()
InterruptBar_LoadPosition()
end
local function InterruptBar_UpdateText(text,cooldown)
if cooldown < 10 then
if cooldown <= 0.5 then
text:SetText("")
else
text:SetFormattedText(" %d",cooldown)
end
else
text:SetFormattedText("%d",cooldown)
end
if cooldown < 6 then
text:SetTextColor(1,0,0,1)
else
text:SetTextColor(1,1,0,1)
end
end
local function InterruptBar_StopAbility(ref,ability)
if InterruptBarDB.hidden then ref:Hide() end
if activetimers[ability] then activetimers[ability] = nil end
ref.text:SetText("")
ref.cd:Hide()
end
local time = 0
local function InterruptBar_OnUpdate(self, elapsed)
time = time + elapsed
if time > 0.25 then
getsize()
for ability,ref in pairs(activetimers) do
ref.cooldown = ref.start + ref.duration - GetTime()
if ref.cooldown <= 0 then
InterruptBar_StopAbility(ref,ability)
else
InterruptBar_UpdateText(ref.text,floor(ref.cooldown+0.5))
end
end
if size == 0 then frame:SetScript("OnUpdate",nil) end
time = time - 0.25
end
end
local function InterruptBar_StartTimer(ref,ability)
if InterruptBarDB.hidden then
ref:Show()
end
if not activetimers[ability] then
local duration
activetimers[ability] = ref
ref.cd:Show()
ref.cd:SetCooldown(GetTime()-0.40,ref.duration)
ref.start = GetTime()
InterruptBar_UpdateText(ref.text,ref.duration)
end
frame:SetScript("OnUpdate",InterruptBar_OnUpdate)
end
local function InterruptBar_COMBAT_LOG_EVENT_UNFILTERED(...)
local spellID, ability, useSecondDuration
return function(_, eventtype, _, srcName, srcFlags, _, dstName, dstFlags, id)
if (band(srcFlags, 0x00000040) == 0x00000040 and eventtype == "SPELL_CAST_SUCCESS") then
spellID = id
else
return
end
useSecondDuration = false
if spellID == 49376 then spellID = 16979; useSecondDuration = true end -- Feral Charge - Cat -> Feral Charge - Bear
ability = GetSpellInfo(spellID)
if abilities[ability] then
if useSecondDuration and spellID == 16979 then
bar[ability].duration = 30
elseif spellID == 16979 then
bar[ability].duration = 15
end
InterruptBar_StartTimer(bar[ability],ability)
end
end
end
InterruptBar_COMBAT_LOG_EVENT_UNFILTERED = InterruptBar_COMBAT_LOG_EVENT_UNFILTERED()
local function InterruptBar_ResetAllTimers()
for _,ability in ipairs(order) do
InterruptBar_StopAbility(bar[ability])
end
active = 0
end
local function InterruptBar_PLAYER_ENTERING_WORLD(self)
InterruptBar_ResetAllTimers()
end
local function InterruptBar_Reset()
InterruptBarDB = { scale = 1, hidden = false, lock = false }
InterruptBar_UpdateBar()
InterruptBar_LoadPosition()
end
local function InterruptBar_Test()
for _,ability in ipairs(order) do
InterruptBar_StartTimer(bar[ability],ability)
end
end
local cmdfuncs = {
scale = function(v) InterruptBarDB.scale = v; InterruptBar_UpdateBar() end,
hidden = function() InterruptBarDB.hidden = not InterruptBarDB.hidden; InterruptBar_UpdateBar() end,
lock = function() InterruptBarDB.lock = not InterruptBarDB.lock; InterruptBar_UpdateBar() end,
reset = function() InterruptBar_Reset() end,
test = function() InterruptBar_Test() end,
}
local cmdtbl = {}
function InterruptBar_Command(cmd)
for k in ipairs(cmdtbl) do
cmdtbl[k] = nil
end
for v in gmatch(cmd, "[^ ]+") do
tinsert(cmdtbl, v)
end
local cb = cmdfuncs[cmdtbl[1]]
if cb then
local s = tonumber(cmdtbl[2])
cb(s)
else
ChatFrame1:AddMessage("InterruptBar Options | /ib <option>",0,1,0)
ChatFrame1:AddMessage("-- scale <number> | value: " .. InterruptBarDB.scale,0,1,0)
ChatFrame1:AddMessage("-- hidden (toggle) | value: " .. tostring(InterruptBarDB.hidden),0,1,0)
ChatFrame1:AddMessage("-- lock (toggle) | value: " .. tostring(InterruptBarDB.lock),0,1,0)
ChatFrame1:AddMessage("-- test (execute)",0,1,0)
ChatFrame1:AddMessage("-- reset (execute)",0,1,0)
end
end
local function InterruptBar_OnLoad(self)
self:RegisterEvent("PLAYER_ENTERING_WORLD")
self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
if not InterruptBarDB.scale then InterruptBarDB.scale = 1 end
if not InterruptBarDB.hidden then InterruptBarDB.hidden = false end
if not InterruptBarDB.lock then InterruptBarDB.lock = false end
InterruptBar_CreateBar()
SlashCmdList["InterruptBar"] = InterruptBar_Command
SLASH_InterruptBar1 = "/ib"
ChatFrame1:AddMessage("Interrupt Bar by Kollektiv. Type /ib for options.",0,1,0)
end
local eventhandler = {
["VARIABLES_LOADED"] = function(self) InterruptBar_OnLoad(self) end,
["PLAYER_ENTERING_WORLD"] = function(self) InterruptBar_PLAYER_ENTERING_WORLD(self) end,
["COMBAT_LOG_EVENT_UNFILTERED"] = function(self,...) InterruptBar_COMBAT_LOG_EVENT_UNFILTERED(...) end,
}
local function InterruptBar_OnEvent(self,event,...)
eventhandler[event](self,...)
end
frame = CreateFrame("Frame",nil,UIParent)
frame:SetScript("OnEvent",InterruptBar_OnEvent)
frame:RegisterEvent("VARIABLES_LOADED")
----------------------------------------------------
-- Interrupt Bar by Kollektiv
-- Rebuke and Skull Bash (Cat Form) spells added by Tiriar
----------------------------------------------------
InterruptBarDB = InterruptBarDB or { scale = 1, hidden = false, lock = false, }
local abilities = {}
local order
local band = bit.band
-- Added rebuke (10) to the end of the list.
local spellids = {[6552] = 10, [2139] = 24, [19647] = 24, [16979] = 15, [1766] = 10, [47528] = 10, [85285] = 10, [80965] = 10}
for spellid,time in pairs(spellids) do
local name,_,spellicon = GetSpellInfo(spellid)
abilities[name] = { icon = spellicon, duration = time }
end
-----------------------------------------------------
-- Edit this table to change the order
-----------------------------------------------------
-- 6552 Pummel
-- 2139 Counterspell
-- 19647 Spell Lock
-- 16979 Feral Charge
-- 1766 Kick
-- 47528 Mind Freeze
-- 85285 Rebuke
-- 80965 Skull Bash (Cat Form)
-----------------------------------------------------
-- Added rebuke to the end of the list.
local order = {6552, 2139, 19647, 1766, 47528, 16979, 85285, 80965}
-----------------------------------------------------
-----------------------------------------------------
for k,v in ipairs(order) do order[k] = GetSpellInfo(v) end
local frame
local bar
local GetTime = GetTime
local ipairs = ipairs
local pairs = pairs
local select = select
local floor = floor
local band = bit.band
local GetSpellInfo = GetSpellInfo
local GROUP_UNITS = bit.bor(0x00000010, 0x00000400)
local activetimers = {}
local size = 0
local function getsize()
size = 0
for k in pairs(activetimers) do
size = size + 1
end
end
local function InterruptBar_AddIcons()
local x = -45
for _,ability in ipairs(order) do
local btn = CreateFrame("Frame",nil,bar)
btn:SetWidth(30)
btn:SetHeight(30)
btn:SetPoint("CENTER",bar,"CENTER",x,0)
btn:SetFrameStrata("LOW")
local cd = CreateFrame("Cooldown",nil,btn)
cd.noomnicc = true
cd.noCooldownCount = true
cd:SetAllPoints(true)
cd:SetFrameStrata("MEDIUM")
cd:Hide()
local texture = btn:CreateTexture(nil,"BACKGROUND")
texture:SetAllPoints(true)
texture:SetTexture(abilities[ability].icon)
texture:SetTexCoord(0.07,0.9,0.07,0.90)
local text = cd:CreateFontString(nil,"ARTWORK")
text:SetFont(STANDARD_TEXT_FONT,18,"OUTLINE")
text:SetTextColor(1,1,0,1)
text:SetPoint("LEFT",btn,"LEFT",2,0)
btn.texture = texture
btn.text = text
btn.duration = abilities[ability].duration
btn.cd = cd
bar[ability] = btn
x = x + 30
end
end
local function InterruptBar_SavePosition()
local point, _, relativePoint, xOfs, yOfs = bar:GetPoint()
if not InterruptBarDB.Position then
InterruptBarDB.Position = {}
end
InterruptBarDB.Position.point = point
InterruptBarDB.Position.relativePoint = relativePoint
InterruptBarDB.Position.xOfs = xOfs
InterruptBarDB.Position.yOfs = yOfs
end
local function InterruptBar_LoadPosition()
if InterruptBarDB.Position then
bar:SetPoint(InterruptBarDB.Position.point,UIParent,InterruptBarDB.Position.relativePoint,InterruptBarDB.Position.xOfs,InterruptBarDB.Position.yOfs)
else
bar:SetPoint("CENTER", UIParent, "CENTER")
end
end
local function InterruptBar_UpdateBar()
bar:SetScale(InterruptBarDB.scale)
if InterruptBarDB.hidden then
for _,v in ipairs(order) do bar[v]:Hide() end
else
for _,v in ipairs(order) do bar[v]:Show() end
end
if InterruptBarDB.lock then
bar:EnableMouse(false)
else
bar:EnableMouse(true)
end
end
local function InterruptBar_CreateBar()
bar = CreateFrame("Frame", nil, UIParent)
bar:SetMovable(true)
bar:SetWidth(120)
bar:SetHeight(30)
bar:SetClampedToScreen(true)
bar:SetScript("OnMouseDown",function(self,button) if button == "LeftButton" then self:StartMoving() end end)
bar:SetScript("OnMouseUp",function(self,button) if button == "LeftButton" then self:StopMovingOrSizing() InterruptBar_SavePosition() end end)
bar:Show()
InterruptBar_AddIcons()
InterruptBar_UpdateBar()
InterruptBar_LoadPosition()
end
local function InterruptBar_UpdateText(text,cooldown)
if cooldown < 10 then
if cooldown <= 0.5 then
text:SetText("")
else
text:SetFormattedText(" %d",cooldown)
end
else
text:SetFormattedText("%d",cooldown)
end
if cooldown < 6 then
text:SetTextColor(1,0,0,1)
else
text:SetTextColor(1,1,0,1)
end
end
local function InterruptBar_StopAbility(ref,ability)
if InterruptBarDB.hidden then ref:Hide() end
if activetimers[ability] then activetimers[ability] = nil end
ref.text:SetText("")
ref.cd:Hide()
end
local time = 0
local function InterruptBar_OnUpdate(self, elapsed)
time = time + elapsed
if time > 0.25 then
getsize()
for ability,ref in pairs(activetimers) do
ref.cooldown = ref.start + ref.duration - GetTime()
if ref.cooldown <= 0 then
InterruptBar_StopAbility(ref,ability)
else
InterruptBar_UpdateText(ref.text,floor(ref.cooldown+0.5))
end
end
if size == 0 then frame:SetScript("OnUpdate",nil) end
time = time - 0.25
end
end
local function InterruptBar_StartTimer(ref,ability)
if InterruptBarDB.hidden then
ref:Show()
end
if not activetimers[ability] then
local duration
activetimers[ability] = ref
ref.cd:Show()
ref.cd:SetCooldown(GetTime()-0.40,ref.duration)
ref.start = GetTime()
InterruptBar_UpdateText(ref.text,ref.duration)
end
frame:SetScript("OnUpdate",InterruptBar_OnUpdate)
end
local function InterruptBar_COMBAT_LOG_EVENT_UNFILTERED(...)
local spellID, ability, useSecondDuration
return function(_, eventtype, _, srcName, srcFlags, _, dstName, dstFlags, id)
if (band(srcFlags, 0x00000040) == 0x00000040 and eventtype == "SPELL_CAST_SUCCESS") then
spellID = id
else
return
end
useSecondDuration = false
if spellID == 49376 then spellID = 16979; useSecondDuration = true end -- Feral Charge - Cat -> Feral Charge - Bear
ability = GetSpellInfo(spellID)
if abilities[ability] then
if useSecondDuration and spellID == 16979 then
bar[ability].duration = 30
elseif spellID == 16979 then
bar[ability].duration = 15
end
InterruptBar_StartTimer(bar[ability],ability)
end
end
end
InterruptBar_COMBAT_LOG_EVENT_UNFILTERED = InterruptBar_COMBAT_LOG_EVENT_UNFILTERED()
local function InterruptBar_ResetAllTimers()
for _,ability in ipairs(order) do
InterruptBar_StopAbility(bar[ability])
end
active = 0
end
local function InterruptBar_PLAYER_ENTERING_WORLD(self)
InterruptBar_ResetAllTimers()
end
local function InterruptBar_Reset()
InterruptBarDB = { scale = 1, hidden = false, lock = false }
InterruptBar_UpdateBar()
InterruptBar_LoadPosition()
end
local function InterruptBar_Test()
for _,ability in ipairs(order) do
InterruptBar_StartTimer(bar[ability],ability)
end
end
local cmdfuncs = {
scale = function(v) InterruptBarDB.scale = v; InterruptBar_UpdateBar() end,
hidden = function() InterruptBarDB.hidden = not InterruptBarDB.hidden; InterruptBar_UpdateBar() end,
lock = function() InterruptBarDB.lock = not InterruptBarDB.lock; InterruptBar_UpdateBar() end,
reset = function() InterruptBar_Reset() end,
test = function() InterruptBar_Test() end,
}
local cmdtbl = {}
function InterruptBar_Command(cmd)
for k in ipairs(cmdtbl) do
cmdtbl[k] = nil
end
for v in gmatch(cmd, "[^ ]+") do
tinsert(cmdtbl, v)
end
local cb = cmdfuncs[cmdtbl[1]]
if cb then
local s = tonumber(cmdtbl[2])
cb(s)
else
ChatFrame1:AddMessage("InterruptBar Options | /ib <option>",0,1,0)
ChatFrame1:AddMessage("-- scale <number> | value: " .. InterruptBarDB.scale,0,1,0)
ChatFrame1:AddMessage("-- hidden (toggle) | value: " .. tostring(InterruptBarDB.hidden),0,1,0)
ChatFrame1:AddMessage("-- lock (toggle) | value: " .. tostring(InterruptBarDB.lock),0,1,0)
ChatFrame1:AddMessage("-- test (execute)",0,1,0)
ChatFrame1:AddMessage("-- reset (execute)",0,1,0)
end
end
local function InterruptBar_OnLoad(self)
self:RegisterEvent("PLAYER_ENTERING_WORLD")
self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
if not InterruptBarDB.scale then InterruptBarDB.scale = 1 end
if not InterruptBarDB.hidden then InterruptBarDB.hidden = false end
if not InterruptBarDB.lock then InterruptBarDB.lock = false end
InterruptBar_CreateBar()
SlashCmdList["InterruptBar"] = InterruptBar_Command
SLASH_InterruptBar1 = "/ib"
ChatFrame1:AddMessage("Interrupt Bar by Kollektiv. Type /ib for options.",0,1,0)
end
local eventhandler = {
["VARIABLES_LOADED"] = function(self) InterruptBar_OnLoad(self) end,
["PLAYER_ENTERING_WORLD"] = function(self) InterruptBar_PLAYER_ENTERING_WORLD(self) end,
["COMBAT_LOG_EVENT_UNFILTERED"] = function(self,...) InterruptBar_COMBAT_LOG_EVENT_UNFILTERED(...) end,
}
local function InterruptBar_OnEvent(self,event,...)
eventhandler[event](self,...)
end
frame = CreateFrame("Frame",nil,UIParent)
frame:SetScript("OnEvent",InterruptBar_OnEvent)
frame:RegisterEvent("VARIABLES_LOADED")
#11
Posted 04 November 2010 - 06:02 AM
Just noticed that the main code is repeated. For what reason? I do not know. But this is a freshly downloaded copy of InterruptBar, so I've not even pasted anything in this file. I hand typed the new abilities and spell ID's.
#12
Posted 04 November 2010 - 06:18 AM
Now the only problem I have is IB showing feral charge bear twice.
#13
Posted 04 November 2010 - 01:38 PM
Ha, that would explain why you had one bar with your added abilities, and the other one without. Interesting.
Anyways, on the icons. I can't actually debug that for you (no account), but this section of code is what's setting your texture:
local cd = CreateFrame("Cooldown",nil,btn)
cd.noomnicc = true
cd.noCooldownCount = true
cd:SetAllPoints(true)
cd:SetFrameStrata("MEDIUM")
cd:Hide()
local texture = btn:CreateTexture(nil,"BACKGROUND")
texture:SetAllPoints(true)
texture:SetTexture(abilities[ability].icon)
texture:SetTexCoord(0.07,0.9,0.07,0.90)
See if you can change the variable to SetTexture to always be either feral cat or feral bear (see if you can get every single icon to be one or the other).
Anyways, on the icons. I can't actually debug that for you (no account), but this section of code is what's setting your texture:
local cd = CreateFrame("Cooldown",nil,btn)
cd.noomnicc = true
cd.noCooldownCount = true
cd:SetAllPoints(true)
cd:SetFrameStrata("MEDIUM")
cd:Hide()
local texture = btn:CreateTexture(nil,"BACKGROUND")
texture:SetAllPoints(true)
texture:SetTexture(abilities[ability].icon)
texture:SetTexCoord(0.07,0.9,0.07,0.90)
See if you can change the variable to SetTexture to always be either feral cat or feral bear (see if you can get every single icon to be one or the other).
"Who, after all, is today speaking of the destruction of the Armenians?"
-Adolf Hitler, 1939
-Adolf Hitler, 1939
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users


















