매크로 게시판

전체보기

모바일 상단 메뉴

본문 페이지

[질문] 매크로 질문드려요~!

chi9787
조회: 950
2016-03-15 12:22:27

트위치 방송을 보다 이런소스를 찾았는데 흠 어떻게 사용을 해야될지 모르겠습니다.. 공격대 프레임에다 본인의 버프를 띄울수 있게하는 매크로 같습니다. 매크로 고수님들 도와 주십쇼 ㅠㅠ..

 

local indicators = {}
local buffs = {}
local_, class = UnitClass("player");

if ( class == "DRUID" ) then
buffs = {["Mark of the Wild"] = true}
end
if (class == "PRIEST" ) then
buffs = {["Power Word: Fortitude"] = true}
end
if (class == "MAGE" ) then
buffs = {["Arcane Brilliance"] = true}
end
if (class == "MONK" ) then
buffs = {
["Legacy of the White Tiger"] = true,
["Legacy of the Emperor"] = true
}
end
if (class == "DEATHKNIGHT" ) then
buffs = {["Horn of Winter"] = true}
end
if (class == "PALADIN" ) then
buffs = {
["Blessing of Kings"] = true,
["Blessing of Might"] = true
}
end
if (class == "WARLOCK" ) then
buffs = {["Dark Intent"] = true}
end
if (class == "WARRIOR" ) then
buffs = {
["Battle Shout"] = true,
["Commanding Shout"] = true
}
end

 

local function getIndicator(frame)
local indicator = indicators[frame:GetName()]
if not indicator then
indicator = CreateFrame("Button", nil, frame, "CompactAuraTemplate")
indicator:ClearAllPoints()
indicator:SetPoint("TOPRIGHT", frame, "TOPRIGHT", -3, -2)
indicator:SetSize(22, 22)
indicator:SetAlpha(0.6)
indicators[frame:GetName()] = indicator
end
return indicator
end

local function updateBuffs(frame)
if not frame:IsVisible() then return end

local indicator = getIndicator(frame)
local buffName = nil
for i = 1, 40 do
local _, _, _, _, _, d, _, ut, _, sc, s, c = UnitBuff(frame.displayedUnit, i);
buffName = UnitBuff(frame.displayedUnit, i);
if not buffName then break end
if buffs[buffName] and ( ut == "player" or ut == "pet" ) then
indicator:SetSize(frame.buffFrames[1]:GetSize()) -- scale
CompactUnitFrame_UtilSetBuff(indicator, frame.displayedUnit, i, nil);
return
end
end
indicator:Hide()
end
hooksecurefunc("CompactUnitFrame_UpdateBuffs", updateBuffs)

 

Lv16 chi9787

모바일 게시판 하단버튼

댓글

새로고침
새로고침

모바일 게시판 하단버튼

지금 뜨는 인벤

더보기+

모바일 게시판 리스트

모바일 게시판 하단버튼

글쓰기

모바일 게시판 페이징

최근 HOT한 콘텐츠

  • 와우
  • 게임
  • IT
  • 유머
  • 연예
AD