Jump to content

Photo

Trinket Tracker script not working O_o?


  • Please log in to reply
2 replies to this topic

#1 Oaktane

Oaktane
  • Members
  • Posts: 6

Posted 25 November 2012 - 06:33 AM

trinkets = {}
local arenaFrame, trinket
for i = 1, 5 do
arenaFrame = "ArenaEnemyFrame"..i
trinket
= CreateFrame("Cooldown", arenaFrame.."Trinket", ArenaEnemyFrames)
trinket:SetPoint("TOPRIGHT", arenaFrame, 30, -6)
trinket:SetSize(24, 24)
trinket.icon = trinket:CreateTexture(nil, "BACKGROUND")
trinket.icon:SetAllPoints()
trinket.icon:SetTexture("Interface\\Icons\\inv_jewelry_trinketpvp_01")
trinket:Hide()
trinkets["arena"..i] = trinket
end

local events = CreateFrame("Frame")
function events:UNIT_SPELLCAST_SUCCEEDED(unitID, spell, rank, lineID, spellID)
if not trinkets[unitID] then
return
end
if spellID == 59752 or spellID == 42292 then
CooldownFrame_SetTimer(trinkets[unitID], GetTime(), 120, 1)
SendChatMessage("Trinket used by: "..GetUnitName(unitID, true), "PARTY")
end
end

function events:PLAYER_ENTERING_WORLD()
local _, instanceType = IsInInstance()
if instanceType == "arena" then
self:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED")
elseif self:IsEventRegistered("UNIT_SPELLCAST_SUCCEEDED") then
self:UnregisterEvent("UNIT_SPELLCAST_SUCCEEDED")
for _, trinket in pairs(trinkets) do
trinket:SetCooldown(0, 0)
trinket:Hide()
end
end
end
events:SetScript("OnEvent", function(self, event, ...) return self[event](self, ...) end)
events:RegisterEvent("PLAYER_ENTERING_WORLD")


I use this script, It doesn't seem to work when i enter arena, any help out there?
  • 0

#2 Havocz

Havocz
  • Members
  • Orcclass_name
  • EU-Anetheron
  • Glutsturm / Emberstorm
  • Posts: 11
  • Talents: Destruction 0/2/2/2/2/1

Posted 24 December 2012 - 10:43 PM

dude this works fine i use the same
  • 0

#3 Thaya

Thaya
  • Moderators
  • Humanclass_name
  • EU-Outland
  • Misery
  • Posts: 4170
  • Talents: Destruction 1/2/0/1/2/0/1
  • LocationRussia

Posted 24 December 2012 - 11:08 PM

Add LoadAddOn("Blizzard_ArenaUI") at the very top. The ArenaUI addon has to be running before you can do anything with arena frames.
  • 0
Default UI Scripts - Compilation & how-to




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

<