Jump to content

Photo

Adding spells to InterruptBar


  • Please log in to reply
67 replies to this topic

#21 kannetixx

kannetixx
  • Junkies
  • Humanclass_name
  • US-Kel'Thuzad
  • Nightfall
  • Posts: 3,011
  • Talents: Fire
  • RBG: 768
  • LocationFlorida yee

Posted 29 March 2010 - 06:00 PM

i put something infront of mind freeze .. maybe that was it?


lewl now everytime i try to login it just says Connecting - > you've been disconnected from server oh lawd


-- 6552 Pummel
-- 2139 Counterspell
-- 19647 Spell Lock
-- 16979 Feral Charge
-- 1766 Kick
-- 47528 Mind Freeze
-- 31244 Cloak of Shadows
-- 48707 Anti-Magic Shell
-- 48782 Icebound Fortitude
-- 51514 Hex
-- 49576 Death Grip
-- 10890 Psychic Scream
-- 57994 Wind Shear
-- 15487 Silence
-- 20252 Intercept
-- 44572 Deep Freeze
-- 18562 Swiftmend
-- 17116 Nature's Swiftness


is what i have in mine .. idk if i messed anything up or what


hm downloaded someone elses and the spells came up .. guess ill figure it out from here
  • 0

#22 Pharaun

Pharaun
  • LocationSeattle, WA

Posted 29 March 2010 - 06:32 PM

That list is optional

--

is a Lua comment, so stuff after -- doesn't mean anything.

You could do

-- 6552 Pummel
-- 2139 Counterspell
-- 19647 Spell Lock
-- Holy shit do the funky chicken
-- 1697 Feral Charge

and it wouldn't matter.

You have to modify the two variables detailed in the first post of this thread.
  • 0
"Who, after all, is today speaking of the destruction of the Armenians?"

-Adolf Hitler, 1939

#23 kannetixx

kannetixx
  • Junkies
  • Humanclass_name
  • US-Kel'Thuzad
  • Nightfall
  • Posts: 3,011
  • Talents: Fire
  • RBG: 768
  • LocationFlorida yee

Posted 29 March 2010 - 06:42 PM

ahh i figured out what i did .. i wasn't adding the spellid's to Local spell ids nor the local order .. sorry if you mentioned that
  • 0

#24 Bigbadburks

Bigbadburks
  • Members
  • Draeneiclass_name
  • US-Undermine
  • Nightfall
  • Posts: 2,046
  • Talents: Elemental

Posted 30 March 2010 - 08:11 AM

It seems as though some people often have questions on how to add spells to InterruptBar, so I thought I would repost some things I put up in other threads. Hopefully this helps some people:)!

It's pretty simple. Go to your addons folder and open up the interruptbar folder. Then open the .lua file (you probably have to open it with wordpad/notepad). Then you just type in the cooldowns and spell ids*. Here is a picture of the .lua file after I edited it.
http://img23.imagesh...ruptbarfile.png

*Found on wowhead at the end of the address bar. Type in the spell you need, and then look at your address bar. ex: psychic scream - http://www.wowhead.com/?spell=10890. The 10890 is the spell id number.

Also, if you want the .lua for Interrupt Bar to add the extra spells that I used, I uploaded it to http://www.filefront.com/13922417.
You can change the cooldowns to what you need and to your liking, I am sure I have mistakes in there. Let me know if you have any suggestions as well! Thanks:D!


This thread should be stickied btw.
  • 0
Posted Image

#25 natasya

natasya
  • Members
  • Humanclass_name
  • US-Blackhand
  • Rampage
  • Posts: 936
  • Talents: Arms

Posted 30 March 2010 - 10:07 AM

what else do I need to do besides adding the spells to the table?
  • 0

#26 Hatesarenas

Hatesarenas
  • Junkies
  • Blood Elfclass_name
  • US-Tichondrius
  • Bloodlust
  • Posts: 72
  • Talents: Holy 0/0/1/2/2/0
  • RBG: 2078

Posted 30 March 2010 - 03:41 PM

You can also put the following code in the LUA file and it works perfectly.

http://pastebin.com/f2849692c
  • 0

#27 Pharaun

Pharaun
  • LocationSeattle, WA

Posted 30 March 2010 - 07:57 PM

what else do I need to do besides adding the spells to the table?


There are two tables. spellids and order. Read the OP, look at the .png image.
  • 0
"Who, after all, is today speaking of the destruction of the Armenians?"

-Adolf Hitler, 1939

#28 Nalle

Nalle
  • Members
  • Taurenclass_name
  • EU-Al'Akir
  • Blackout
  • Posts: 29
  • Talents:

Posted 04 April 2010 - 09:02 AM

If someone's still playing around with these and has been in the same unsatisfying situation, where you'd like to add lots of new icons to interruptbar, resulting in too long rows and you've noticed InterruptIcons has not been updated, you can use my 3 lines of code, most easily implemented as replacing the "local function InterruptBar_AddIcons()" function with the following code. You can change the value 14 to anything suitable, so if you want 10 icons / line, change it to 9, etc.

Here's the code:

local function InterruptBar_AddIcons()
local x = -45
local y = 0
local icons_thisrow = 0
for _,ability in ipairs(order) do
local btn = CreateFrame("Frame",nil,bar)
btn:SetWidth(30)
btn:SetHeight(30)
icons_thisrow = icons_thisrow + 1
if icons_thisrow > 14 then
y = y + 30
x = -45
icons_thisrow = 0
end


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,12,"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


My whole lua for interruptbar:

http://pastebin.com/QnG6TzTd
  • 0

#29 Notchris

Notchris
  • Junkies
  • Dwarfclass_name
  • US-Scilla
  • Stormstrike
  • Posts: 30
  • Talents: Unholy

Posted 08 April 2010 - 10:12 PM

i've successfully modified my spells and what now, but now i cant seem to drag the bar itself. is there a script or command that i may have accidentally edited? (and yes i have tried unlocking the bar ingame lol)
  • 0

#30 Primaris

Primaris
  • Junkies
  • Orcclass_name
  • US-Rexxar
  • Vengeance
  • Posts: 491
  • Talents: Assassination

Posted 09 April 2010 - 12:22 AM

So I've added the spells, their id, the timers at the top of the notepad for them and the local order but everytime I reload my UI it says error with interruptbar and doesnt load..

here's my pastebin

http://pastebin.com/9NjBSSV9

I took the originally lua downloaded from the original poster, and added things like kidneyshot, strangulate, blind, etc so if you can look and see if i did those right.. im not sure what im missing? also changed scale to .7

The debug error is:

Message: ..\AddOns\InterruptBar\InterruptBar.lua line 91:
attempt to index field '?' (a nil value)

Debug:
InterruptBar\InterruptBar.lua:91:
InterruptBar\InterruptBar.lua:73
InterruptBar\InterruptBar.lua:153:
InterruptBar\InterruptBar.lua:143
InterruptBar\InterruptBar.lua:298:
InterruptBar\InterruptBar.lua:292
InterruptBar\InterruptBar.lua:307: ?()
InterruptBar\InterruptBar.lua:313:
InterruptBar\InterruptBar.lua:312


I looked at line 91 but dont see how that correlates to what I added (you can see line numbers on pastebin)
  • 0

#31 Kerbaroth

Kerbaroth
  • Members
  • Worgenclass_name
  • EU-Gilneas
  • Reckoning / Abrechnung
  • Posts: 32
  • Talents: Survival

Posted 11 April 2010 - 01:30 AM

@ ericlol

just by the way, afaik earth shock doesn't interrupt anymore. now the shaman rupt is wind shear ;)
  • 0
Posted Image

#32 Diagnosis

Diagnosis
  • Members
  • Undeadclass_name
  • US-Arthas
  • Ruin
  • Posts: 57
  • Talents: Affliction

Posted 11 April 2010 - 11:07 PM

Does this show up in BGs? Or just arenas?
  • 0

#33 Bloodly

Bloodly
  • Members
  • Orcclass_name
  • EU-Defias Brotherhood
  • Rampage / Saccage
  • Posts: 10
  • Talents: Affliction

Posted 12 April 2010 - 03:11 PM

Line 67:

cd.noomnicc = true

to

cd.noCooldownCount = true


I can't find that line, in which lua file is it located?
  • 0

#34 Pharaun

Pharaun
  • LocationSeattle, WA

Posted 12 April 2010 - 05:39 PM

Probably %WOWDIR%\Interface\AddOns\InterruptBar\InterruptBar.lua
  • 0
"Who, after all, is today speaking of the destruction of the Armenians?"

-Adolf Hitler, 1939

#35 Cutiepied

Cutiepied
  • Members
  • Humanclass_name
  • US-Sargeras
  • Shadowburn
  • Posts: 28
  • Talents: Retribution

Posted 14 April 2010 - 11:07 PM

i've successfully modified my spells and what now, but now i cant seem to drag the bar itself. is there a script or command that i may have accidentally edited? (and yes i have tried unlocking the bar ingame lol)


Try clicking on the bottom left-most buttons. The first 4 allowed me to move the whole unit when I dragged them.
:)
  • 0

#36 Hayate

Hayate
  • Members
  • Taurenclass_name
  • EU-Boulderfist
  • Misery
  • Posts: 4
  • Talents: Elemental

Posted 15 April 2010 - 08:50 PM

man its bugging alot !!! it just stops working sometimes , i have to restart the game to make it work again .. any advices ?
  • 0

#37 Pharaun

Pharaun
  • LocationSeattle, WA

Posted 16 April 2010 - 05:21 AM

man its bugging alot !!! it just stops working sometimes , i have to restart the game to make it work again .. any advices ?


Check the sticky in the General Discussion section about the combat log bug.
  • 0
"Who, after all, is today speaking of the destruction of the Armenians?"

-Adolf Hitler, 1939

#38 Afran

Afran
  • Members
  • Goblinclass_name
  • EU-Auchindoun
  • Vindication
  • Posts: 111
  • Talents: Frost

Posted 17 April 2010 - 04:44 PM

I just changed mine to this;

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

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

local spellids = {[6552] = 10, [2139] = 24, [19647] = 24, [16979] = 15, [1766] = 10, [47528] = 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
-- 49039 Lichborne
-- 20252 Intercept
-- 10890 Psychic Scream
-- 15487 Silence
-- 51514 Hex
-- 31224 Cloak of Shadows
-- 49576 Death Grip
-----------------------------------------------------

local order = {6552, 2139, 19647, 1766, 47528, 16979, 1766, 47528, 49039, 20252, 10890, 15487, 51514, 31244, 49576}

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

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


and IB doesn't even load now, /ib does nothing and there's no errors and it's enabled

what's the problem? =p
  • 0

#39 Pharaun

Pharaun
  • LocationSeattle, WA

Posted 17 April 2010 - 05:53 PM

You need to update spellids with cooldown times.
  • 0
"Who, after all, is today speaking of the destruction of the Armenians?"

-Adolf Hitler, 1939

#40 Afran

Afran
  • Members
  • Goblinclass_name
  • EU-Auchindoun
  • Vindication
  • Posts: 111
  • Talents: Frost

Posted 17 April 2010 - 06:01 PM

Ah, thanks.

Do you know how to add spells to InterruptIcons lua too? Seems a little more complicated.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

<