Muchachaz
[0.3]
|
0
Скрипты Neilyo и не только
Скрытый текст
Код:
/run rc=35;rfc=CooldownFrame_SetTimer;aef="ArenaEnemyFrame";hb="HealthBar";trt=GetItemIcon(37865)ctf = CreateFrame;oe="ARENA_OPPONENT_UPDATE"ve="PLAYER_ENTERING_WORLD"tr="RIGHT"LoadAddOn("Blizzard_ArenaUI") /run function Cr(i)local f=ctf("Frame",nil,UIParent)f:SetPoint(tr,_G[aef..i..hb],tr,67,0)f:SetSize(rc,rc)f.t=f:CreateTexture(nil,"BORDER")f.t:SetAllPoints(true)f.t:SetTexture(trt)f.c=CreateFrame("Cooldown",nil,f)f.c:SetAllPoints(f)return f;end
/run function ur(f,i)f:SetScript("OnEvent",function(_,e,u,_,_,_,s)if(u=="arena"..i)then if(s==42292 or s==59752)then rfc(f.c,GetTime(),120,1)elseif(s==7744)then rfc(f.c,GetTime(),30,1)end end end)f:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED")end
/run for i=1,5 do _G["rf"..i]=Cr(i)local f=_G["rf"..i]ur(f,i)f:Hide()end function str(o,m)for i=1, m do local f=_G["rf"..i]if o then f:Show()else f:Hide()f.c:Hide()end end end
/run tk=ctf("Frame")tk:SetScript("OnEvent",function(_,e)if e==oe then str(1,GetNumArenaOpponents())else str(nil,5)end end)tk:RegisterEvent(oe)tk:RegisterEvent(ve)
Так же работают другие скрипты из Adrenaline UI
Скрытый текст Код:
--------------- --[[ Cooldown Viewer[Omnicc]
cs = actionbar cooldown text size ps = player/focus/target/raid cooldown text size(disable if ps is 1) ctp = actionbar cooldown position(DEFAULT : CENTER) ptp = player cooldown position(DEFAULT : BOTTOMRIGHT) ct = font
-- text position list
CETNER / RIGHT / LEFT TOP / TOPRIGHT / TOPLEFT BOTTOM / BOTTOMRIGHT / BOTTOMLEFT
-- font list
DAMAGE_TEXT_FONT STANDARD_TEXT_FONT UNIT_NAME_FONT NAMEPLATE_FONT
-- show cooldown text until 1 sec
:: insert "elseif(e>0)then" -> "elseif(e>1)" in macro 3
-- disable to show 0.x sec with enabling red text
:: insert "return"%.1f",e" -> "return"%d",e" in macro 3
-- DEATH KNIGHT RUNE COOLDOWN DISABLE
instead of macro 6, use this two macro
/run function gct(f)if not cDB[f]then local c=gict(f)c:SetSize(c.s*crt,c.s*crt)sf(c,1)cDB[f]=c;end return cDB[f]end
/run function cvf(f,s,d)if(string.find(f:GetName(),"Rune") ~= nil)then return end local c=gct(f)if(s and d)then c.b=s;c.d=d;if(s>0 and d>1.5)then c.c=0;c.r=d-(GetTime()-s);suc(c)else rt(c)end end end
]]-- cs=20; ps=10; ctp="CENTER" ptp="BOTTOMRIGHT" cp=5; ct=UNIT_NAME_FONT;
crt=2; cDB={} action={} ccf=CreateFrame; gac=GetActionCooldown; ol="OUTLINE" cpe="PLAYER_ENTERING_WORLD" cau="ACTIONBAR_UPDATE_COOLDOWN" co="OnUpdate" ----------------------------------------------:: 1
function rt(f) f.e=nil f.t:SetText("") f:SetScript(co,nil) end
function sf(f,v) f.t:SetFont(ct,f.s*v,ol) end
function acv(b) local x=b.cooldown x.a=b.action action[x]=x end
function scv(p,f,po,s) if(s>1)then f.t:SetPoint(po,p) end f.s=s; end
----------------------------------------------:: 2
function sr(f,e) if(e>60)then sf(f,0.7) if(f.s==cs)then return"%d:%02d",e,e else return"%dm",e+60,e end elseif(e>=cp)then sf(f,1) f.t:SetTextColor(1,1,0,1) return"%d",e elseif(e>0)then sf(f,0.9) f.t:SetTextColor(1,0,0,1) return"%.1f",e else return end end
----------------------------------------------:: 3 function suc(f) if not f.e then f.e=1; f:SetScript(co,function(s,e) f.c=f.c+e; local fo,v1,v2=sr(f,f.r-f.c) if not fo then rt(f) elseif not v2 then f.t:SetFormattedText(fo,v1) else f.t:SetTextColor(1,1,1,1) f.t:SetFormattedText(fo,v1/60,v2%60) end end) end end ----------------------------------------------:: 4 function scs(p,f) if(p:GetSize()<35)then scv(p,f,ptp,ps) else scv(p,f,ctp,cs) end end
function gict(f) local c=ccf("Frame",nil,f) c:SetFrameLevel(f:GetFrameLevel()+5) c.t=c:CreateFontString(nil,"OVERLAY") c.t:SetAllPoints(c) scs(f:GetParent(),c) return c; end ----------------------------------------------:: 5
function gct(f) if not cDB[f]then local c=gict(f) c:SetSize(c.s*crt,c.s*crt) sf(c,1) cDB[f]=c; end return cDB[f] end ------------------ --[[ DeathKnight Rune Disable
function cvf(f,s,d) if(string.find(f:GetName(),"Rune") ~= nil)then return end local c=gct(f) if(s and d)then c.b=s; c.d=d; if(s>0 and d>1.5)then c.c=0; c.r=d-(GetTime()-s); suc(c) else rt(c) end end end
]]-- function cvf(f,s,d) local c=gct(f) if(s and d)then c.b=s; c.d=d; if(s>0 and d>1.5)then c.c=0; c.r=d-(GetTime()-s); suc(c) else rt(c) end end end ----------------------------------------------:: 6 function cvc(DB) for c in pairs(DB)do if c.a then local s,d=gac(c.a) cvf(c,s,d) end end end
function pcv(_,e) if e==cau then cvc(action) else cvc(cDB) end end
for _,b in pairs(ActionBarButtonEventsFrame.frames)do acv(b) end
----------------------------------------------:: 7
vc=ccf("Frame") vc:SetScript("OnEvent",pcv) vc:RegisterEvent(cpe) vc:RegisterEvent(cau)
hooksecurefunc(getmetatable(ActionButton1Cooldown).__index,"SetCooldown",cvf) hooksecurefunc("SetActionUIButton",acv)
----------------------------------------------:: 8 ------------------------------------------------------------- ------------------------------------------------------------- --[[ Interrupt Bar
ic = icon size xp = x position of interrupt bar yp = y positon of interrupt bar
n = x icons per line
fl=0 : Enable in world fl=1 : Enable only in Arena
* use this line when use macro *
li={2139,19647,57994,48707,8143,8122,6552,1766,96231,47528,80965,44572} cd={24,24,5,45,60,27,10,10,10,10,10,45}
]]-- --[[or use this lua code in lua file ]]-- _,Class=UnitClass("player"); if Class == "WARRIOR" then li={2139,19647,57994,48707,8143,8122,6552,1766,96231,47528,80965,44572} cd={24,24,5,45,60,27,10,10,10,10,10,45} elseif Class == "SHAMAN" then li={2139,19647,57994,48707,8143,8122,6552,1766,96231,47528,80965,44572} cd={24,24,15,45,60,27,10,10,10,10,10,45} elseif Class == "PALADIN" then li={2139,19647,57994,48707,8143,8122,6552,1766,96231,47528,80965,44572} cd={24,24,5,45,60,27,10,10,10,10,10,45} elseif Class == "PRIEST" then li={2139,19647,57994,48707,8143,8122,6552,1766,96231,47528,80965,44572} cd={24,24,5,45,60,27,10,10,10,10,10,45} elseif Class == "DRUID" then li={2139,19647,57994,48707,8143,8122,6552,1766,96231,47528,80965,44572} cd={24,24,5,45,60,27,10,10,10,10,10,45} elseif Class == "ROGUE" then li={2139,19647,57994,48707,8143,8122,6552,1766,96231,47528,80965,44572} cd={24,24,5,45,60,27,10,10,10,10,10,45} elseif Class == "MAGE" then li={2139,19647,57994,48707,8143,8122,6552,1766,96231,47528,80965,44572} cd={24,24,5,45,60,27,10,10,10,10,10,45} elseif Class == "WARLOCK" then li={2139,19647,57994,48707,8143,8122,6552,1766,96231,47528,80965,44572} cd={24,24,5,45,60,27,10,10,10,10,10,45} elseif Class == "HUNTER" then li={2139,19647,57994,48707,8143,8122,6552,1766,96231,47528,80965,44572} cd={24,24,5,45,60,27,10,10,10,10,10,45} elseif Class == "DEATHKNIGHT" then li={2139,19647,57994,48707,8143,8122,6552,1766,96231,47528,80965,44572} cd={24,24,5,45,60,27,10,10,10,10,10,45} end ----------------------------------------------:: 1 fl=0; ic=40; xp=-500; yp=360; n=6; sfc=CooldownFrame_SetTimer; crf=CreateFrame; ce=math.ceil; ih=IsInInstance; gsi=GetSpellInfo; up=UIParent pe="PLAYER_ENTERING_WORLD" cdf="Cooldown" ----------------------------------------------:: 2 function cf(i,s,x,y) local _,_,t=gsi(s) local f=crf("Frame",nil,up) f:SetPoint("CENTER",x,y) f:SetSize(ic,ic) f.t = f:CreateTexture(nil,"BORDER") f.t:SetAllPoints(true) f.t:SetTexture(t) f.c=CreateFrame(cdf,nil,f) f.c:SetAllPoints(f) return f; end ----------------------------------------------:: 3 function ud(f,ls,lc) f:SetScript("OnEvent", function(_,_,_,e,_,_,_,b,_,_,_,_,_,s) if((bit.band(b,0x40) == 0x40)and e=="SPELL_CAST_SUCCESS"and s==ls)then sfc(f.c,GetTime(),lc,1) end end) f:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED") end ----------------------------------------------:: 4 for i,s in ipairs(li)do _G["ib"..i] = cf(i,s,xp+(ic+5)*ce((i-1)%n),yp-(ic+5)*ce(i/n)) ud(_G["ib"..i],s,cd[i]) end ----------------------------------------------:: 5 ik=crf("Frame") ik:SetScript("OnEvent", function() local _,t=ih() for i,s in ipairs(li)do local f=_G["ib"..i] if(t=="arena"or fl==0)then f:Show() f.c:Show() else f:Hide() f.c:Hide() end end end) ik:RegisterEvent(pe)
----------------------------------------------:: 6 ------------------------------------------------------------- ------------------------------------------------------------- --[[ Trinket Viewer
Alience Trinket : trt=GetItemIcon(37864) Horde Trinket : trt=GetItemIcon(70395) rc : trinket icon size
]]--
rc=40; rfc=CooldownFrame_SetTimer; aef="ArenaEnemyFrame"; hb="HealthBar"; trt=GetItemIcon(37864) ctf = CreateFrame; oe="ARENA_OPPONENT_UPDATE" ve="PLAYER_ENTERING_WORLD" tr="RIGHT" LoadAddOn("Blizzard_ArenaUI") ----------------------------------------------:: 1 function Cr(i) local f=ctf("Frame",nil,UIParent) f:SetPoint(tr,_G[aef..i..hb],tr,100,0) f:SetSize(rc,rc) f.t=f:CreateTexture(nil,"BORDER") f.t:SetAllPoints(true) f.t:SetTexture(trt) f.c=CreateFrame("Cooldown",nil,f) f.c:SetAllPoints(f) return f; end ----------------------------------------------:: 2 function ur(f,i) f:SetScript("OnEvent", function(_,e,u,_,_,_,s) if(u=="arena"..i)then if(s==42292 or s==59752)then rfc(f.c,GetTime(),120,1) elseif(s==7744)then rfc(f.c,GetTime(),30,1) end end end) f:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED") end ----------------------------------------------:: 3 for i=1,5 do _G["rf"..i]=Cr(i) local f=_G["rf"..i] ur(f,i) f:Hide() end
function str(o,m) for i=1, m do local f=_G["rf"..i] if o then f:Show() else f:Hide() f.c:Hide() end end end ----------------------------------------------:: 4 tk=ctf("Frame") tk:SetScript("OnEvent", function(_,e) if e==oe then str(1,GetNumArenaOpponents()) else str(nil,5) end end) tk:RegisterEvent(oe) tk:RegisterEvent(ve) ----------------------------------------------:: 5 ------------------------------------------------------------- ------------------------------------------------------------- --[[ Buff Filter
bl = icon list bs = icon size xb = x positon of buff filter yb = y positon of buff filter
br = x buffs per line
-PALADIN - bl={31884,53563,31821,85497,86659,20049,88819,54149,84963,642,31842}
-SHAMAN - bl={52127,32734,324,61295,55277,8178,73685,96230} -PRIEST bl={588,73413,15473,81292,47218,17,92085,37274,33206,96266,59887,87152,81661} ]]--
_,Class=UnitClass("player"); if Class == "WARRIOR" then bl = {6673,469,871,1719,21118,84584, 85730} elseif Class == "SHAMAN" then bl={52127,53390,32734,324,73685,77800} elseif Class == "PALADIN" then bl = {31884,53563,31821,85497,86659,20049,88819,54149,84963,642,31842} elseif Class == "PRIEST" then bl = {588,73413,15473,81292,47218,17,92085,37274,33206,96266,59887,87152,81661} elseif Class == "DRUID" then bl={52127,32734,61295,55277,8178,73685,16177,96230,52109} elseif Class == "ROGUE" then bl={52127,32734,61295,55277,8178,73685,16177,96230,52109} elseif Class == "MAGE" then bl={52127,32734,61295,55277,8178,73685,16177,96230,52109} elseif Class == "WARLOCK" then bl={52127,32734,61295,55277,8178,73685,16177,96230,52109} elseif Class == "HUNTER" then bl={52127,32734,61295,55277,8178,73685,16177,96230,52109} elseif Class == "DEATHKNIGHT" then bl={52127,32734,61295,55277,8178,73685,16177,96230,52109} end --[[ or use in MACRO
bl={52127,53390,32734,324,73685,77800}
]]--
----------------------------------------------:: 1 bs=36; xb=-370; yb=-140; br=4;
bdr="BORDER" be="UNIT_AURA" cbf=CreateFrame; gi=GetSpellInfo; bm=math.ceil; fm=math.floor; st=STANDARD_TEXT_FONT; function cu(s) return UnitBuff("player",gi(s))end ----------------------------------------------:: 2 function Cb(i,s) local _,_,t3=gi(s) local f=cbf("Frame") f:SetSize(bs,bs) f.t=f:CreateTexture(nil,bdr) f.t:SetAllPoints(true) f.t:SetTexture(t3) f.f=f:CreateFontString(nil,bdr) f.f:SetFont(st,12,"OUTLINE") f.f:SetPoint("BOTTOMRIGHT",0,0) return f; end ----------------------------------------------:: 3 function vb(s,i,row) local b1,_,_,b4=cu(s) local f=_G["B"..i] if b1 then f:Show() f:SetPoint("CENTER",xb+(bs+5)*bm((row-1)%br),yb-(bs+10)*bm(row/br)) if(b4>1)then f.f:SetText(b4) else f.f:SetText("") end row=row+1; end return row; end ----------------------------------------------:: 4 function ub() for i,s in ipairs(bl)do local b,_,_,_,_,_,k=cu(s) if b then local vt=fm(k-GetTime()) if (vt>=60)then vt=bm(vt/60) _G["B"..i].c:SetText(vt.."m") elseif vt >= 0 then _G["B"..i].c:SetText(vt.."s") end end end end ----------------------------------------------:: 5 function Cc(f) f.c=f:CreateFontString(nil,bdr) f.c:SetFont(st,12,"OUTLINE") f.c:SetPoint("CENTER",0,-25) end
function db() for i in ipairs(bl)do _G["B"..i]:Hide() end end ----------------------------------------------:: 6 for i,s in ipairs(bl)do _G["B"..i]=Cb(i,s) Cc(_G["B"..i]) _G["B"..i]:Hide() end
function bb() db() local bw=1; for i,s in ipairs(bl)do bw=vb(s,i,bw) end end
bk=cbf("Frame") bk:SetScript("OnEvent",bb) bk:SetScript("OnUpdate",ub) bk:RegisterEvent(be) ----------------------------------------------:: 7 --[[ DR Tracker
drx = x position drs = icon size DRt={{DRLIST1},{DRLIST2},{DRLIST3}...} DEFAULT : DRt={{fear},{polymhorpe}}
-- show frame in left of arena enemyframe
drx : set minus value(ex drx : -120) dp : "LEFT"
and insert in macro 5
drx+(r-1) -> drx-(r-1)
]]--
DRt={ {5782,8122,5484,20511,2094}, -- FEAR {118,6770,1776,49203,28272,28271,61305,61721,61780,82691,51514} -- polymhorpe }
----------------------------------------------:: 1 drx=145; drs=40; dp="RIGHT"; dre="COMBAT_LOG_EVENT_UNFILTERED" drp="PLAYER_ENTERING_WORLD" dra="ARENA_OPPONENT_UPDATE" LoadAddOn("Blizzard_ArenaUI") function gaef(f,n)return _G["ArenaEnemyFrame"..n.."HealthBar"]end
----------------------------------------------:: 2 function rDR(f) f.e=1; f.t:SetTexture(nil) f.c:Hide() end
function sDR(f) f.e=f.e+1; f.c:Show() end
function gDRt(i,j) return _G["drc"..i..":"..j] end
function runDR(f,n) CooldownFrame_SetTimer(f.c,GetTime(),18,1) eDR(f,n) sDR(f) oDR(n) end ----------------------------------------------:: 3 function eDR(f,n) local t=1; f:SetScript("OnUpdate", function(s,e) t=t+e; if(t>=18)then f:SetScript("OnUpdate",nil) rDR(f) oDR(n) end end) end
function cDR(f,n,s) if f.e<4 then local _,_,t=GetSpellInfo(s) f.t:SetTexture(t) runDR(f,n) end end ----------------------------------------------:: 4 function oDR(n) local r=1; for j in ipairs(DRt)do local f=gDRt(n,j) f:SetPoint(dp,gaef(f,n),dp,drx+(r-1)*50,0) r=r+1; end end
function uDR(n,s) for i,t in ipairs(DRt)do for _,j in ipairs(t)do if s==j then cDR(gDRt(n,i),n,s) end end end end
----------------------------------------------:: 5 function DRc(i,j) local f=CreateFrame("Frame",nil,UIParent) f:SetSize(drs,drs) f.t=f:CreateTexture(nil,"BORDER") f.t:SetAllPoints(true) f.c=CreateFrame("Cooldown",nil,f) f.c:SetAllPoints(f) f.e=1 return f end ----------------------------------------------:: 6 function clDR(_,e,_,_,_,_,_,d,_,_,_,s) if(e=="SPELL_AURA_REMOVED" or e=="SPELL_AURA_REFRESH")then for i=1,5 do local ag=UnitGUID("arena"..i) if(ag ~= nil and d==ag)then uDR(i,s) end end end end ----------------------------------------------:: 7 function iDRt(o,m) for i=1,m do for j in ipairs(DRt)do local f=gDRt(i,j) rDR(f) if o then f:Show() end end end end
for i=1,5 do for j in ipairs(DRt)do _G["drc"..i..":"..j]=DRc(i,j) end end ----------------------------------------------:: 8 dt=CreateFrame("Frame") dt:SetScript("OnEvent", function(_,e,...) if e==dre then clDR(...) elseif e==dra then iDRt(1,GetNumArenaOpponents()) else iDRt(nil,5) end end) dt:RegisterEvent(dra) dt:RegisterEvent(drp) dt:RegisterEvent(dre) ----------------------------------------------:: 9
-- Trinket
rc=40; rfc=CooldownFrame_SetTimer; aef="ArenaEnemyFrame"; hb="HealthBar"; trt=GetItemIcon(37865) ctf = CreateFrame; oe="ARENA_OPPONENT_UPDATE" ve="PLAYER_ENTERING_WORLD" tr="RIGHT" LoadAddOn("Blizzard_ArenaUI") ---------------------------------------------- ArenaEnemyFrame1:ClearAllPoints() ArenaEnemyFrames:SetScale(1.1) ArenaEnemyFrame1:SetPoint("TOPRIGHT",20,6) ----------------------------------------------:: 1 function Cr(i) local f=ctf("Frame",nil,UIParent) f:SetPoint(tr,_G[aef..i..hb],tr,58,8) f:SetSize(rc,rc) f.t=f:CreateTexture(nil,"BORDER") f.t:SetAllPoints(true) f.t:SetTexture(trt) f.c=CreateFrame("Cooldown",nil,f) f.c:SetAllPoints(f) return f; end ----------------------------------------------:: 2 function ur(f,i) f:SetScript("OnEvent", function(_,e,u,_,_,_,s) if(u=="arena"..i)then if(s==42292 or s==59752)then rfc(f.c,GetTime(),120,1) elseif(s==7744)then rfc(f.c,GetTime(),30,1) end end end) f:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED") end ----------------------------------------------:: 3 for i=1,5 do _G["rf"..i]=Cr(i) local f=_G["rf"..i] ur(f,i) f:Hide() end
function str(o,m) for i=1, m do local f=_G["rf"..i] if o then f:Show() else f:Hide() f.c:Hide() end end end ----------------------------------------------:: 4 tk=ctf("Frame") tk:SetScript("OnEvent", function(_,e) if e==oe then str(1,GetNumArenaOpponents()) else str(nil,5) end end) tk:RegisterEvent(oe) tk:RegisterEvent(ve) ----------------------------------------------:: 5 a:RegisterEvent("PLAYER_ENTERING_WORLD") a:RegisterEvent("ADDON_LOADED")
|