Jump to content

Photo

Adding spells to InterruptBar


  • Please log in to reply
67 replies to this topic

#61 volcom88

volcom88
  • Members
  • Blood Elfclass_name
  • EU-Nathrezim
  • Blutdurst
  • Posts: 3
  • Talents: Holy
  • RBG: 2178

Posted 18 March 2011 - 07:00 PM

Line 67:

cd.noomnicc = true

to

cd.noCooldownCount = true


I still have that issue with double CD Count on the Icons. I'm currently using tukui v13.

I'm using the version from Czargo.

Here's what I've tried:

local cd = CreateFrame("Cooldown",nil,btn)
		cd.noomnicc = true
		cd.noCooldownCount = true
		cd:SetAllPoints(true)
		cd:SetFrameStrata("MEDIUM")
		cd:Hide()

local cd = CreateFrame("Cooldown",nil,btn)
		cd.noCooldownCount = true
		cd:SetAllPoints(true)
		cd:SetFrameStrata("MEDIUM")
		cd:Hide()

local cd = CreateFrame("Cooldown",nil,btn)
		cd.noomnicc = true
		cd:SetAllPoints(true)
		cd:SetFrameStrata("MEDIUM")
		cd:Hide()

local cd = CreateFrame("Cooldown",nil,btn)
		cd:SetAllPoints(true)
		cd:SetFrameStrata("MEDIUM")
		cd:Hide()

  • 0

#62 volcom88

volcom88
  • Members
  • Blood Elfclass_name
  • EU-Nathrezim
  • Blutdurst
  • Posts: 3
  • Talents: Holy
  • RBG: 2178

Posted 18 March 2011 - 07:13 PM

^ yeah, need help to make bar shorter


Type the following:

/ib scale x

x = number, for ex 1 is standard, 0.5 is smaller, 2 is bigger

/ib columns X

x = number of columns
  • 0

#63 volcom88

volcom88
  • Members
  • Blood Elfclass_name
  • EU-Nathrezim
  • Blutdurst
  • Posts: 3
  • Talents: Holy
  • RBG: 2178

Posted 19 March 2011 - 02:34 AM

Solution

Found that the built in OmniCC from tukui is not detected by Interruptbar.

Either disable it in the lua from Interruptbar or simply replace tukui's OmniCC with the normal OmniCC.
  • 0

#64 Jeheira

Jeheira
  • Junkies
  • Humanclass_name
  • US-Lightning's Blade
  • Vindication
  • Posts: 115
  • Talents: Holy 0/0/2/2/1/0/2
  • 2v2: 2037
  • 3v3: 2107
  • RBG: 1701

Posted 29 March 2011 - 03:51 AM

does anyone know how to make more rows? i tried /ii and /ib columns and neither worked

edit: figured it out

Edited by Jeheira, 29 March 2011 - 03:57 AM.

  • 0

#65 ceare

ceare
  • Members
  • Posts: 2

Posted 01 May 2011 - 10:43 AM

Hey...

i have try to add some spells to Interruptbar... the normal interruptbar runs but when i add 1 spell i dosn´t see the bar. i need help...
here is my LUA...

----------------------------------------------------
-- Interrupt Bar by Kollektiv
-- Modifications by Ceare
----------------------------------------------------

InterruptBarDB = InterruptBarDB or { scale = 1, hidden = false, lock = false, }
local abilities = {}
local order
local band = bit.band


local spellids = {[6552] = 10, [20252] = 15, [5246] = 120, [46924] = 90, [14185] = 480, [26669] = 180, [26889] = 180, [31224] = 90, [2094] = 180, [1766] = 10, [8643] = 20, [1044] = 60, [10308] = 40, [10278] = 300, [642] = 300, [64205] = 120, [6940] = 120, [13809] = 30, [19503] = 30, [19263] = 90, [781] = 25, [23989] = 180, [3045] = 300, [10888] = 30, [33206] = 180, [15487] = 45, [49576] = 35, [48792] = 60, [48707] = 45, [47528] = 10, [47476] = 120, [51514] = 45, [17116] = 120, [1953] = 15, [45438] = 300, [2139] = 24, [11958] = 480, [44572] = 30, [17928] = 32, [19647] = 24, [18708] = 180, [47847] = 20, [8983] = 30, [18562] = 13, [16979] = 15}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, 10

-- 20252 Intercept, 15

-- 5246 Intimidating Shout, 120

-- 46924 Bladestorm, 90

-- 14185 Preparation, 480

-- 26669 Evasion, 180

-- 26889 Vanish, 180

-- 31224 Cloak of Shadows, 90

-- 2094 Blind, 180

-- 1766 Kick, 10

-- 8643 Kidney shot, 20

-- 1044 Hand of Freedom, 60

-- 10308 Hammer of Justice, 40

-- 10278 Hand of Protection, 300

-- 642 Divine Shield, 300

-- 64205 Divine Sacrifice, 120

-- 6940 Hand of Sacrifice, 120

-- 13809 Frost Trap, 30

-- 19503 Scatter Shot, 30

-- 19263 Deterrence, 90

-- 781 Disengage, 25

-- 23989 Readiness, 180

-- 3045 Rapid Fire, 300

-- 10888 Psychic Scream, 30

-- 33206 Pain Suppression, 180

-- 15487 Silence, 45

-- 49576 Death Grip, 35

-- 48792 Icebound Fortitude, 60

-- 48707 Anti-Magic Shell, 45

-- 47528 Mind Freeze, 10

-- 47476 Strangulate, 120

-- 51514 Hex, 45

-- 17116 Nature's Swiftness, 120

-- 1953 Blink, 15

-- 45438 Ice Block, 300

-- 2139 Counterspell, 24

-- 11958 Cold Snap, 480

-- 44572 Deep Freeze, 30

-- 17928 Howl of Terror, 32

-- 19647 Spell Lock, 24

-- 18708 Fel Domination, 180

-- 47847 Shadowfury, 20

-- 8983 Bash, 30

-- 18562 Swiftmend, 13

-- 16979 Feral Charge, 15



-----------------------------------------------------



local order = {6552, 20252, 5246, 46924, 14185, 26669, 26889, 31224, 2094, 1766, 8643, 1044, 10308, 10278, 642, 64205, 6940, 13809, 19503, 19263, 781, 23989, 3045, 10888, 33206, 15487, 49576, 48792, 48707, 47528, 47476, 51514, 17116, 1953, 45438, 2139, 11958, 44572, 17928, 19647, 18708, 47847, 8983, 18562, 16979}

-----------------------------------------------------

-----------------------------------------------------

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
local y = 0
local r = 0
for _,ability in ipairs(order) do
local btn = CreateFrame("Frame",nil,bar)
btn:SetWidth(30)
btn:SetHeight(30)
if x < (InterruptBarDB.columns * 30 - 45) then
btn:SetPoint("CENTER",bar,"CENTER",x,y)
else
x = x-(InterruptBarDB.columns * 30)
y = y-30
btn:SetPoint("Center",bar,"Center",x,y)

end
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 == 80964 then spellID = 80965
end
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_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,
test = function() InterruptBar_Test() end,
columns = function(v) InterruptBarDB.columns = v;
ChatFrame1:AddMessage("Type '/console reloadui' to update the interface of InterruptBar.",0,1,0)
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("-- columns <number> | value: " .. InterruptBarDB.columns,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.columns then InterruptBarDB.columns = 5 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 Mod./Update by Veliace. 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")


Edit: i have a german client maybe is the client my problem?? but why the normal interrupt bar runs????
  • 0

#66 Beargryllzx

Beargryllzx
  • Members
  • Posts: 65

Posted 04 May 2011 - 02:44 PM

same problem after 4.1 here

ok nvm fixd it
  • 0

#67 Ktulu

Ktulu
  • Junkies
  • Posts: 51

Posted 04 May 2011 - 07:07 PM

Hey...

i have try to add some spells to Interruptbar... the normal interruptbar runs but when i add 1 spell i dosn´t see the bar. i need help...
here is my LUA...

Spoiler


Edit: i have a german client maybe is the client my problem?? but why the normal interrupt bar runs????


You should REALLY spoiler stuff like that
  • 0

#68 ilovekamas

ilovekamas
  • Members
  • Posts: 1

Posted 24 August 2012 - 09:31 AM

Hi! I really need help with my IB. I want spells I chase in that order but I don't know how to set everything:(





----------------------------------------------------
-- Interrupt Bar by Kollektiv
----------------------------------------------------

InterruptBarDB = InterruptBarDB or { scale = 1, hidden = false, lock = false, }
local abilities = {}
local order
local band = bit.band

local spellids = {[23920] = 10, [31224] = 90, [46924] = 90, [6552] = 10, [72] = 12, [19647] = 24, [19503] = 30, [47528] = 10, [49916] = 120, [49576] = 25, [10890] = 23, [1766] = 10, [408] = 20, [2139] = 24, [44572] = 30, [57994] = 6}
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
-----------------------------------------------------
-- 23920 Spell Reflection
-- 31224 Cloak of Shadows
-- 46924 Bladestorm
-- 6552 Pummel
-- 72 Shield Bash
-- 19647 Spell Lock
-- 19503 Scatter Shot
-- 47528 Mind Freeze
-- 49916 Strangulate
-- 49576 Death Grip
-- 10890 Psychic Scream
-- 1766 Kick
-- 408 Kidney Shot
-- 2139 Counterspell
-- 44572 Deep Freeze
-- 57994 Wind Shock
-----------------------------------------------------

local order = {23920, 31224, 46924, 6552, 72, 19647, 19503, 47528, 49916, 49576, 10890, 1766, 408, 2139, 44572, 57994,}

-----------------------------------------------------
-----------------------------------------------------

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
local y = 0
--local curAbility = 0
for curAbility,ability in ipairs(order) do
local btn = CreateFrame("Frame",nil,bar)
btn:SetWidth(30)
btn:SetHeight(30)
btn:SetPoint("CENTER",bar,"CENTER",x,y)
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

--
-- Originally curAbility < AbilityCount / 2
-- Which was counted early on when adding
-- The abilities to a table
--
-- This method ensures we only use the number of
-- Abilities that are going to be displayed
-- Given in the order table.
--
if curAbility < #(order) / 2 then
x = x + 30
else
if curAbility > #(order) / 2 then
x = x + 30
else
y = y - 30
x = -45
end
end
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

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")


EDIT: NVM anymore

Edited by ilovekamas, 24 August 2012 - 09:41 AM.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

<