Jump to content

  • Curse Sites
Help

Default UI Scripts


  • Please log in to reply
396 replies to this topic

#1 Thaya

Thaya
  • Moderators
  • Posts: 1491
  • LocationRussia

Posted 17 April 2012 - 08:57 AM

*
POPULAR

Table of contents
  • How to use scripts
  • General/uncategorized scripts
    • Disable damage/healing spam in floating text
    • Add more "power auras"
    • Darken all the graphics Ibo/Lorti UI style
    • Hide the error frame (red text in top middle)
  • Unit frame scripts
    • Class icons instead of portraits
    • Class colors in hp bars
    • Class colors behind names
    • Disable healing/damage spam over player/pet frame
    • Flashy spellsteal border for non-mages and/or enrage effects
    • Change the format of hp/mana text to absolute values ("140k")
    • Hide the faction/PvP icon
    • Disable the group number frame
    • Scaling/moving unitframes
  • Arena frame scripts
    • Show frames outside of arena (macro)
    • Scaling/moving arenaframes and castbars
    • Arena trinkets tracker
  • Action bar scripts
    • Hide graphics
    • Hide macro labels
    • Hide hotkeys
  • Cast bar scripts
    • Text cast timer ("0.8 / 1.5")
    • Scaling/moving castbars
  • Quality of life scripts
    • Autosell grey trash and repair
    • Minimap tweaks
    • Extra slash commands
            

1. How to use scripts

You either need to create your own addon, add the code to an existing addon (I don't recommend this), or run it in-game via the /run command. The latter, in most cases, requires a condensed form of the script to fit the 255 character limit of input/macros; macros often need to be executed after every reload or zone. Unless you're going to Blizzcon tomorrow, there's really no reason to use macros - just create an addon. I will, however, add macros where available (i.e. those I already have in macro form).

Download this template: http://www.mediafire...b4cj4r0fcqcwquj

This already has the folder structure and the .toc file, at this point you only need to open the .lua file as a text file (with notepad/wordpad or anything that works with raw text), and simply copy/paste the code you want from below.

You don't need to relog every time you edit a .lua file if the addon is loaded, a /reloadui is enough.

Comments start with "--", multi-line comments look like this:
--[[
This code
won't execute.
]]

-- This is a single-line comment
This way you can enable/disable certain features, or just add comments to organize your code better.

If you're a do it yourself type, here's how you create an addon:
1. Create YourAddon folder in Interface/Addons
2. Create a text file called YourAddon.toc (has to be the same name as the folder), content should be:
## Title: YourAddon
## Interface: 50001

YourAddon.lua
3. Create YourAddon.lua (can be any filename, but it has to be mentioned in the .toc file to load), copy scripts into that file.

Make sure that you see the actual extensions of files - this is disabled by default in Windows. So the files you are looking at might actually be YourAddon.toc.txt and YourAddon.lua.txt, and of course it doesn't work in this case.

2. General/uncategorized scripts

2.1. Disable damage/healing spam in floating text:
LoadAddOn("Blizzard_CombatText")

COMBAT_TEXT_TYPE_INFO["PERIODIC_HEAL"] = {var = nil, show = nil}
COMBAT_TEXT_TYPE_INFO["HEAL_CRIT"] = {var = nil, show = nil}
COMBAT_TEXT_TYPE_INFO["HEAL"] = {var = nil, show = nil}
COMBAT_TEXT_TYPE_INFO["PERIODIC_HEAL_ABSORB"] = {var = nil, show = nil}
COMBAT_TEXT_TYPE_INFO["HEAL_CRIT_ABSORB"] = {var = nil, show = nil}
COMBAT_TEXT_TYPE_INFO["HEAL_ABSORB"] = {var = nil, show = nil}

COMBAT_TEXT_TYPE_INFO["DAMAGE_CRIT"] = {var = nil, show = nil}
COMBAT_TEXT_TYPE_INFO["DAMAGE"] = {var = nil, show = nil}
COMBAT_TEXT_TYPE_INFO["SPELL_DAMAGE_CRIT"] = {var = nil, show = nil}
COMBAT_TEXT_TYPE_INFO["SPELL_DAMAGE"] = {var = nil, show = nil}
Macros:
/run CTTI=COMBAT_TEXT_TYPE_INFO CTTI.PERIODIC_HEAL={var=nil,show=nil} CTTI.HEAL_CRIT={var=nil,show=nil} CTTI.HEAL={var=nil,show=nil} CTTI.PERIODIC_HEAL_ABSORB={var=nil,show=nil} CTTI.HEAL_CRIT_ABSORB={var=nil,show=nil} CTTI.HEAL_ABSORB={var=nil,show=nil}
/run CTTI.DAMAGE_CRIT={var=nil,show=nil} CTTI.DAMAGE={var=nil,show=nil} CTTI.SPELL_DAMAGE_CRIT={var=nil,show=nil} CTTI.SPELL_DAMAGE={var=nil,show=nil}

2.2. Add more "power auras":
local frame = CreateFrame("FRAME")
frame:RegisterEvent("UNIT_AURA")

frame:SetScript("OnEvent", function(self, event, ...)
	local unitid = ... if unitid ~= "player" then return end

	if UnitBuff("player", "Eradication") then
		SpellActivationOverlay_ShowOverlay(SpellActivationOverlayFrame, 64371, "TEXTURES\\SPELLACTIVATIONOVERLAYS\\GENERICTOP_01.BLP", "TOP", 1.2, 139, 65, 239, false, false)
	else
		SpellActivationOverlay_HideOverlays(SpellActivationOverlayFrame, 64371)
	end
end)
First, change "Eradication" to whatever you need. (Use the locale/language you actually play on.)

Next, here's how you configure this whole thing:
SpellActivationOverlay_ShowOverlay(self, spellID, texturePath, location, scale, r, g, b, info.vFlip, info.hFlip)
It's all pretty self-explanatory. Keep the first argument as it is in the script above, everything else you can change/edit as you wish to. The last two arguments are vertical and horizontal flips, "r, g, b" are red/green/blue color codes (0-255).

To get the spellID, find your spell/aura on wowhead and look at the address bar. The number is the spellID. Keep in mind you need the spellID of the buff, not the spell that triggers it - they are sometimes different.

Textures created for the default UI and available in the game files:
Spoiler
Just change the last part of the texture path provided in the example above to any of these.

If that's not enough, you can always steal a file from Power Auras or other addons. To specify an external texture: "Interface\\AddOns\\YourAddon\\yourtexture.tga" - you can use .tga files; in general, you can use any texture/picture available to the game (anything in the game files and anything in addon folders).

2.3. Darken all the graphics Ibo/Lorti UI style:
This particular script is stolen from Ibo UI. You'll also need some textures to make it look right, simply put them into the /Interface/ folder alongside the Addons folder:
http://www.mediafire...mpaxe6jfllwa5q8

local frame=CreateFrame("Frame")
frame:RegisterEvent("ADDON_LOADED")

frame:SetScript("OnEvent", function(self, event, addon)
	if (addon == "Blizzard_TimeManager") then
		for i, v in pairs({PlayerFrameTexture, TargetFrameTextureFrameTexture, PetFrameTexture, PartyMemberFrame1Texture, PartyMemberFrame2Texture, PartyMemberFrame3Texture, PartyMemberFrame4Texture,
			PartyMemberFrame1PetFrameTexture, PartyMemberFrame2PetFrameTexture, PartyMemberFrame3PetFrameTexture, PartyMemberFrame4PetFrameTexture, FocusFrameTextureFrameTexture,
			TargetFrameToTTextureFrameTexture, FocusFrameToTTextureFrameTexture, BonusActionBarFrameTexture0, BonusActionBarFrameTexture1, BonusActionBarFrameTexture2, BonusActionBarFrameTexture3,
			BonusActionBarFrameTexture4, MainMenuBarTexture0, MainMenuBarTexture1, MainMenuBarTexture2, MainMenuBarTexture3, MainMenuMaxLevelBar0, MainMenuMaxLevelBar1, MainMenuMaxLevelBar2,
			MainMenuMaxLevelBar3, MinimapBorder, CastingBarFrameBorder, FocusFrameSpellBarBorder, TargetFrameSpellBarBorder, MiniMapTrackingButtonBorder, MiniMapLFGFrameBorder, MiniMapBattlefieldBorder,
			MiniMapMailBorder, MinimapBorderTop,
			select(1, TimeManagerClockButton:GetRegions())
		}) do
			v:SetVertexColor(.4, .4, .4)
		end

		for i,v in pairs({ select(2, TimeManagerClockButton:GetRegions()) }) do
			v:SetVertexColor(1, 1, 1)
		end

		self:UnregisterEvent("ADDON_LOADED")
		frame:SetScript("OnEvent", nil)
	end
end)

for i, v in pairs({ MainMenuBarLeftEndCap, MainMenuBarRightEndCap }) do
	v:SetVertexColor(.35, .35, .35)
end

2.4. Hide the error frame (red text in top middle):
UIErrorsFrame:SetAlpha(0)

3. Unit frame scripts

3.1. Class icons instead of portraits:
hooksecurefunc("UnitFramePortrait_Update",function(self)
	if self.portrait then
		if UnitIsPlayer(self.unit) then				
			local t = CLASS_ICON_TCOORDS[select(2, UnitClass(self.unit))]
			if t then
				self.portrait:SetTexture("Interface\\TargetingFrame\\UI-Classes-Circles")
				self.portrait:SetTexCoord(unpack(t))
			end
		else
			self.portrait:SetTexCoord(0,1,0,1)
		end
	end
end)
Macros:
/run UFP="UnitFramePortrait_Update" UICC="Interface\\TargetingFrame\\UI-Classes-Circles" CIT=CLASS_ICON_TCOORDS UC=UnitClass
/run hooksecurefunc(UFP,function(self) if self.portrait then t=CIT[select(2,UC(self.unit))] if t and UnitIsPlayer(self.unit) then self.portrait:SetTexture(UICC) self.portrait:SetTexCoord(unpack(t)) else self.portrait:SetTexCoord(0,1,0,1) end end end)

3.2. Class colors in hp bars:
local function colour(statusbar, unit)
	local _, class, c
	if UnitIsPlayer(unit) and UnitIsConnected(unit) and unit == statusbar.unit and UnitClass(unit) then
		_, class = UnitClass(unit)
		c = CUSTOM_CLASS_COLORS and CUSTOM_CLASS_COLORS[class] or RAID_CLASS_COLORS[class]
		statusbar:SetStatusBarColor(c.r, c.g, c.b)
		PlayerFrameHealthBar:SetStatusBarColor(0,1,0)
	end
end

hooksecurefunc("UnitFrameHealthBar_Update", colour)
hooksecurefunc("HealthBar_OnValueChanged", function(self)
	colour(self, self.unit)
end)
Macros:
/run UIP=UnitIsPlayer UIC=UnitIsConnected RCC=RAID_CLASS_COLORS PFHB=PlayerFrameHealthBar UC=UnitClass
/run function colour(sb,unit) if UIP(unit) and UIC(unit) and unit==sb.unit and UC(unit) then _,cl=UC(unit) c=RAID_CLASS_COLORS[cl] sb:SetStatusBarColor(c.r,c.g,c.b) PFHB:SetStatusBarColor(0,1,0) end end
/run hooksecurefunc("UnitFrameHealthBar_Update", colour) hooksecurefunc("HealthBar_OnValueChanged", function(self) colour(self, self.unit) end)

3.3. Class colors behind names:
local frame = CreateFrame("FRAME")
frame:RegisterEvent("GROUP_ROSTER_UPDATE")
frame:RegisterEvent("PLAYER_TARGET_CHANGED")
frame:RegisterEvent("PLAYER_FOCUS_CHANGED")
frame:RegisterEvent("UNIT_FACTION")

local function eventHandler(self, event, ...)
	if UnitIsPlayer("target") then
		c = RAID_CLASS_COLORS[select(2, UnitClass("target"))]
		TargetFrameNameBackground:SetVertexColor(c.r, c.g, c.b)
	end
	if UnitIsPlayer("focus") then
		c = RAID_CLASS_COLORS[select(2, UnitClass("focus"))]
		FocusFrameNameBackground:SetVertexColor(c.r, c.g, c.b)
	end
end

frame:SetScript("OnEvent", eventHandler)

for _, BarTextures in pairs({TargetFrameNameBackground, FocusFrameNameBackground}) do
	BarTextures:SetTexture("Interface\\TargetingFrame\\UI-StatusBar")
end
Macros:
/run UIP=UnitIsPlayer RCC=RAID_CLASS_COLORS UC=UnitClass TFNB=TargetFrameNameBackground FFNB=FocusFrameNameBackground
/run f=CreateFrame("FRAME") f:RegisterEvent("PARTY_MEMBERS_CHANGED") f:RegisterEvent("PLAYER_TARGET_CHANGED") f:RegisterEvent("PLAYER_FOCUS_CHANGED") f:RegisterEvent("UNIT_FACTION")
/run function e(self,event,...) if UIP("target") then c=RCC[select(2,UC("target"))] TFNB:SetVertexColor(c.r,c.g,c.b) end if UIP("focus") then c=RCC[select(2,UC("focus"))] FFNB:SetVertexColor(c.r,c.g,c.b) end end f:SetScript("OnEvent",e)

3.4. Disable healing/damage spam over player/pet frame:
PlayerHitIndicator:SetText(nil)
PlayerHitIndicator.SetText = function() end

PetHitIndicator:SetText(nil)
PetHitIndicator.SetText = function() end

3.5. Flashy spellsteal border for non-mages and/or enrage effects:
hooksecurefunc("TargetFrame_UpdateAuras", function(s)
	for i = 1, MAX_TARGET_BUFFS do
		_, _, ic, _, dT = UnitBuff(s.unit, i)
		if(ic and (not s.maxBuffs or i<=s.maxBuffs)) then
			fS=_G[s:GetName()..'Buff'..i..'Stealable']
			if(UnitIsEnemy(PlayerFrame.unit, s.unit) and dT=='Magic') then
				fS:Show()
			else
				fS:Hide()
			end
		end
	end
end)
Macros:
/run b = 'Buff' st = 'Stealable' mM = 'Magic' mB = maxBuffs TFUA = 'TargetFrame_UpdateAuras' PFu = PlayerFrame.unit MTB = MAX_TARGET_BUFFS UB = UnitBuff UIE = UnitIsEnemy
/run hooksecurefunc(TFUA,function(s) for i=1,MTB do _,_,ic,_,dT=UB(s.unit,i) if(ic and (not s.mB or i<=s.mB)) then fS=_G[s:GetName()..b..i..st] if (UIE(PFu,s.unit) and dT==mM) then fS:Show() else fS:Hide() end end end end)
You can adapt this to enrages by changing the dT=='Magic' line to dT='' (or in the macro, mM='' instead of mM='Magic'). For an unknown reason, enrage effects return an empty string as their debuff type.

3.6. Change the format of hp/mana text to absolute values ("140k"):
hooksecurefunc("TextStatusBar_UpdateTextStringWithValues", function()
	PlayerFrameHealthBar.TextString:SetText(AbbreviateLargeNumbers(UnitHealth("player")))
	PlayerFrameManaBar.TextString:SetText(AbbreviateLargeNumbers(UnitMana("player")))

	TargetFrameHealthBar.TextString:SetText(AbbreviateLargeNumbers(UnitHealth("target")))
	TargetFrameManaBar.TextString:SetText(AbbreviateLargeNumbers(UnitMana("target")))

	FocusFrameHealthBar.TextString:SetText(AbbreviateLargeNumbers(UnitHealth("focus")))
	FocusFrameManaBar.TextString:SetText(AbbreviateLargeNumbers(UnitMana("focus")))
end)

3.7. Hide faction/PvP icon:
PlayerPVPIcon:SetAlpha(0)
TargetFrameTextureFramePVPIcon:SetAlpha(0)
FocusFrameTextureFramePVPIcon:SetAlpha(0)

3.8. Disable the group number frame:
PlayerFrameGroupIndicator.Show = function() return end

3.9. Scaling/moving frames:
framename:SetScale(1.1)
You can find the frame name by using /fstack. Value is in %, i.e. 1.1 is 110%.

Move most frames on the default UI:
/run local f=framename; f:SetMovable(true); f:EnableMouse(true); f:SetUserPlaced(true); f:SetScript("OnMouseDown", f.StartMoving); f:SetScript("OnMouseUp", f.StopMovingOrSizing);
You can find the frame name by using /fstack. Drag the frame where you want it to be, reload. (If it doesn't save, type /console synchronizeSettings 0 and try again.)

I personally recommend to move the TargetFrameToT (target of target) frame at least, because it often overlaps the last debuff. Just move it a little bit to the right. This method works for sure for the ToT frame.

If the above method doesn't work or doesn't save position for the frame you're trying to move (doesn't for pet frame, for example), paste this into your addon:
framename:ClearAllPoints()
framename:SetPoint("CENTER", x, y)
framename.SetPoint = function() end
Also, you can move the player, target and focus frames within the default UI by right clicking on it and unlocking/locking. That's much better than moving it with scripts due to some weird interactions with vehicle UI if you move those frames with scripts.

4. Arena frame scripts

4.1. Show frames outside of arena (macro):
/run LoadAddOn("Blizzard_ArenaUI") ArenaEnemyFrames:Show() ArenaEnemyFrame1:Show() ArenaEnemyFrame2:Show() ArenaEnemyFrame3:Show() ArenaEnemyFrame1CastingBar:Show() ArenaEnemyFrame2CastingBar:Show() ArenaEnemyFrame3CastingBar:Show()
This will display frames 1, 2 and 3 with the cast bars.

4.2. Scaling/moving arenaframes and castbars:
LoadAddOn("Blizzard_ArenaUI") -- You only need to run this once. You can safely delete any copies of this line.

ArenaEnemyFrame1:ClearAllPoints()
ArenaEnemyFrame2:ClearAllPoints()
ArenaEnemyFrame3:ClearAllPoints()
ArenaEnemyFrame4:ClearAllPoints()
ArenaEnemyFrame5:ClearAllPoints()

ArenaEnemyFrame1:SetPoint("CENTER",UIParent,"CENTER",350,50)
ArenaEnemyFrame2:SetPoint("CENTER",UIParent,"CENTER",350,0)
ArenaEnemyFrame3:SetPoint("CENTER",UIParent,"CENTER",350,-50)
ArenaEnemyFrame4:SetPoint("CENTER",UIParent,"CENTER",350,-100)
ArenaEnemyFrame5:SetPoint("CENTER",UIParent,"CENTER",350,-150)

ArenaEnemyFrame1.SetPoint = function() end
ArenaEnemyFrame2.SetPoint = function() end
ArenaEnemyFrame3.SetPoint = function() end
ArenaEnemyFrame4.SetPoint = function() end
ArenaEnemyFrame5.SetPoint = function() end
Frames have to be moved separately now. ClearAllPoints and blanketing the SetPoint method are both mandatory now for it to work properly. The only way to fit this in a macro is to loop it, I'll add this in later.

ArenaEnemyFrames:SetScale(1.3)
This scales up the whole thing, everything in the frames will be scaled up equally. Make sure this is after LoadAddOn("Blizzard_ArenaUI").

for i=1, 5 do
	_G["ArenaEnemyFrame"..i]:SetScale(1.3)
	_G["ArenaEnemyFrame"..i.."CastingBar"]:SetScale(1.3)
	-- _G["ArenaEnemyFrame"..i.."CastingBar"]:SetPoint("RIGHT", 95, 0)
end
This lets you scale things up separately if you want to. First line changes the scale of arena frames themselves. Second line changes the scale of the cast bar. Third line moves the cast bar to the right of the frame - its disabled here, just remove the "--" to enable it (just an example of using comments in code).

4.3. Arena trinkets tracker:

LoadAddOn("Blizzard_ArenaUI") -- You only need to run this once. You can safely delete any copies of this line.

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")
This puts icons to the right of the arena frames. Does not track WotF - it now simply shares 30 seconds CD with trinkets, so it's impossible to track with just 1 icon. Only enables in arenas.

5. Action bar scripts

5.1. Hide graphics:
I will just list all the options in one block, you can choose which you want. You can enter them separately with /run if you want to see each individually.
MainMenuBarLeftEndCap:Hide()
MainMenuBarRightEndCap:Hide() -- hide the gryphons

MainMenuExpBar:Hide()
MainMenuBarMaxLevelBar:SetAlpha(0) -- hide the xp bar

MainMenuBarTexture0:Hide() -- hide all the background textures.
MainMenuBarTexture1:Hide() -- leaving them on looks better,
MainMenuBarTexture2:Hide() -- unless you are going to hide the
MainMenuBarTexture3:Hide() -- micromenu and bag buttons too.

BonusActionBarFrameTexture1:SetAlpha(0)
BonusActionBarFrameTexture2:SetAlpha(0) -- this is for druids/rogues/warriors.
BonusActionBarFrameTexture3:SetAlpha(0) -- their stances cause this to show up
BonusActionBarFrameTexture4:SetAlpha(0) -- over the normal bar.

SlidingActionBarTexture0:SetAlpha(0)
SlidingActionBarTexture1:SetAlpha(0) -- hide pet bar background

-- These hide individual elements of the menu bar. Its easy to figure out what is what.
ActionBarUpButton:Hide()
ActionBarDownButton:Hide()
MainMenuBarPageNumber:SetAlpha(0)

CharacterMicroButton:Hide()
SpellbookMicroButton:Hide()
TalentMicroButton:Hide()
AchievementMicroButton:Hide()
QuestLogMicroButton:Hide()
GuildMicroButton:Hide()
PVPMicroButton:Hide()
LFDMicroButton:Hide()
CompanionsMicroButton:Hide()
EJMicroButton:Hide()
MainMenuMicroButton:Hide()
HelpMicroButton:Hide()

CharacterBag3Slot:Hide()
CharacterBag2Slot:Hide()
CharacterBag1Slot:Hide()
CharacterBag0Slot:Hide()
MainMenuBarBackpackButton:Hide()

5.2. Hide macro labels:
for i=1, 12 do
	_G["ActionButton"..i.."Name"]:SetAlpha(0) -- main bar
	_G["MultiBarBottomRightButton"..i.."Name"]:SetAlpha(0) -- bottom right bar
	_G["MultiBarBottomLeftButton"..i.."Name"]:SetAlpha(0) -- bottom left bar
	_G["MultiBarRightButton"..i.."Name"]:SetAlpha(0) -- right bar
	_G["MultiBarLeftButton"..i.."Name"]:SetAlpha(0) -- left bar
end

5.3. Hide hotkeys:
for i=1, 12 do
	_G["ActionButton"..i.."HotKey"]:SetAlpha(0) -- main bar
	_G["MultiBarBottomRightButton"..i.."HotKey"]:SetAlpha(0) -- bottom right bar
	_G["MultiBarBottomLeftButton"..i.."HotKey"]:SetAlpha(0) -- bottom left bar
	_G["MultiBarRightButton"..i.."HotKey"]:SetAlpha(0) -- right bar
	_G["MultiBarLeftButton"..i.."HotKey"]:SetAlpha(0) -- left bar
end

6. Cast bar scripts

6.1. Text cast timer ("0.8 / 1.5"):
CastingBarFrame.timer = CastingBarFrame:CreateFontString(nil);
CastingBarFrame.timer:SetFont(STANDARD_TEXT_FONT,12,"OUTLINE");
CastingBarFrame.timer:SetPoint("TOP", CastingBarFrame, "BOTTOM", 0, 0);
CastingBarFrame.update = .1;

hooksecurefunc("CastingBarFrame_OnUpdate", function(self, elapsed)
	if not self.timer then return end
	if self.update and self.update < elapsed then
		if self.casting then
			self.timer:SetText(format("%2.1f/%1.1f", max(self.maxValue - self.value, 0), self.maxValue))
		elseif self.channeling then
			self.timer:SetText(format("%.1f", max(self.value, 0)))
		else
			self.timer:SetText("")
		end
		self.update = .1
	else
		self.update = self.update - elapsed
	end
end)

6.2. Scaling/moving castbars
Player cast bar:
CastingBarFrame:ClearAllPoints()
CastingBarFrame:SetPoint("CENTER",UIParent,"CENTER", 0, -235)
CastingBarFrame.SetPoint = function() end
CastingBarFrame:SetScale(1.0)

Target cast bar. This one is attached to the target unit frame by default, this script will unattach it and place it in the center:
TargetFrameSpellBar:ClearAllPoints()
TargetFrameSpellBar:SetPoint("CENTER", UIParent, "CENTER", 0, -140)
TargetFrameSpellBar.SetPoint = function() end
TargetFrameSpellBar:SetScale(1.0)
Focus cast bar functions the exact same way as the target cast bar, just that the frame is called FocusFrameSpellBar.

Set the cast bar above the frame instead of under the auras:
TargetFrameSpellBar:ClearAllPoints()
TargetFrameSpellBar:SetPoint("BOTTOM", TargetFrame, "TOP", -15, 0)
TargetFrameSpellBar.SetPoint = function() end
It will still remain attached to the target frame if you decide to move the target frame. Change "Target" to "Focus" everywhere and you'll get the same script for focus frame.

Spoiler

7. Quality of life scripts

7.1. Autosell grey trash and repair:
local g = CreateFrame("Frame")
g:RegisterEvent("MERCHANT_SHOW")

g:SetScript("OnEvent", function()  
	local bag, slot
	for bag = 0, 4 do
		for slot = 0, GetContainerNumSlots(bag) do
			local link = GetContainerItemLink(bag, slot)
			if link and (select(3, GetItemInfo(link)) == 0) then
				UseContainerItem(bag, slot)
			end
		end
	end

	if(CanMerchantRepair()) then
		local cost = GetRepairAllCost()
		if cost > 0 then
			local money = GetMoney()
			if IsInGuild() then
				local guildMoney = GetGuildBankWithdrawMoney()
				if guildMoney > GetGuildBankMoney() then
					guildMoney = GetGuildBankMoney()
				end
				if guildMoney > cost and CanGuildBankRepair() then
					RepairAllItems(1)
					print(format("|cfff07100Repair cost covered by G-Bank: %.1fg|r", cost * 0.0001))
					return
				end
			end
			if money > cost then
				RepairAllItems()
				print(format("|cffead000Repair cost: %.1fg|r", cost * 0.0001))
			else
				print("Not enough gold to cover the repair cost.")
			end
		end
	end
end)
Will use guild bank if available.

7.1. Minimap tweaks:
MinimapZoomIn:Hide()
MinimapZoomOut:Hide()
Minimap:EnableMouseWheel(true)
Minimap:SetScript('OnMouseWheel', function(self, delta)
	if delta > 0 then
		Minimap_ZoomIn()
	else
		Minimap_ZoomOut()
	end
end)
MiniMapTracking:ClearAllPoints()
MiniMapTracking:SetPoint("TOPRIGHT", -26, 7)
Hides zoom in/out buttons, enables mousewheel zoom, and moves the tracking button to top right near the calendar button.

7.3. Extra slash commands:
SlashCmdList["CLCE"] = function() CombatLogClearEntries() end
SLASH_CLCE1 = "/clc"

SlashCmdList["TICKET"] = function() ToggleHelpFrame() end
SLASH_TICKET1 = "/gm"

SlashCmdList["READYCHECK"] = function() DoReadyCheck() end
SLASH_READYCHECK1 = '/rc'

SlashCmdList["CHECKROLE"] = function() InitiateRolePoll() end
SLASH_CHECKROLE1 = '/cr'
- /clc to clear combat log
- /gm to open a GM ticket
- /rc for readycheck
- /cr for check role

Edited by Thaya, 24 December 2012 - 11:06 PM.


#2 Thaya

Thaya
  • Moderators
  • Posts: 1491
  • LocationRussia

Posted 17 April 2012 - 08:57 AM

This thread is a work in progress. I'm posting it before its done because if I don't post it, I'll never finish it and it will just rot on my desktop in a .txt for eternity like all my other unfinished articles.

Known issues/to-do list:
- Add screenshot examples of every script
- Fix minor inconsistencies in format (use of colons, descriptions, etc)

Scripts to add:
- Scale up buffs/debuffs on target/focus frames - still looking for a decent script for this
- Raid/party buff/debuff tweaks for healers. I got some scripts lying about like prioritizing UA debuff, moving debuffs to the right of the frame etc, but I have no idea how useful this actually is. Need a healer PoV/opinion on these
- hp/mana text on arena frames - not sure if this shows by default or not (couldn't test)
- move/resize action bars scripts. Same as with pvp trinkets - I just didn't get around to it, don't bother linking me those
- Change status bar color of uninterruptable casts - wonder if this is at all possible?
- Stopwatch stuff. Will look at Xandyns scripts, just haven't gotten around to it yet
- Hidden cooldown tracker for things like hamstring or mage frostbolt. Got a script for hamstring, just wonder if I can adapt it to other stuff, maybe even proc trinkets
- Hide chat tab highlight on whispers - saw Navariums script for this, but it just hides the buttons for me (not even clickable). Like the idea though

What I don't want to do with this thread, at least not now:
- Miniports of other addons, such as omnicc, losecontrol, spellalert, etc. If you want that functionality, you might as well just use the addons, there's really no reason not to unless you're going to LAN. Don't bother posting these. Otherwise I'm open to any suggestions.

If you spot any errors - spelling, code, grammar, anything - let me know.

Edited by Thaya, 19 October 2012 - 03:13 PM.

Default UI Scripts - Compilation & how-to

#3 Hyuru

Hyuru
  • Junkies
  • Humanclass_name
  • EU-Outland
  • Misery
  • Posts: 9104
  • Talents: Subtlety 1/2/2/0/0/0
  • RBG: 2237
  • LocationNOT EVEN EU

Posted 17 April 2012 - 09:03 AM

Quote

Action failed: You have reached your quota of positive votes for the day

: (
Posted Image

#4 hertzuk

hertzuk
  • Junkies
  • Humanclass_name
  • EU-Outland
  • Misery
  • Posts: 1497
  • Talents: Affliction
  • RBG: 2615
  • LocationUK

Posted 17 April 2012 - 09:46 AM

I love you

Posted Image


#5 mukuld50

mukuld50
  • Junkies
  • Dwarfclass_name
  • US-Magtheridon
  • Ruin
  • Posts: 718
  • Talents: Elemental ./././././.
  • RBG: 2666

Posted 17 April 2012 - 10:05 AM

Thank you very much for this.

#6 m0nk

m0nk
  • Members
  • Posts: 304

Posted 17 April 2012 - 12:03 PM

Couldn't see this script on their so I thought I'd post it.

Arena Enemy CD Tracker script
USS="UNIT_SPELLCAST_SUCCEEDED";OE="OnEvent";PvP="Interface\\Icons\\inv_jewelry_trinketpvp_01";F="Frame";CF=CreateFrame;BO="Border";PvPT="PvP Trinket";EMFH="Every Man For Himself";UC=UnitClass;SCM=SendChatMessage;RW="RAID_WARNING"
function TrS(f,x,y,cd,T,s,h) f:SetPoint("BOTTOMLEFT",x,y)f:SetSize(s,s)f.c=CF("Cooldown",cd)f.c:SetAllPoints(f)f.t=f:CreateTexture(nil,BO)f.t:SetAllPoints()f.t:SetTexture(T);if not h then f:Hide(); end f:RegisterEvent(USS) end
function Ts(f,cd,U,N,S,TI)if CPz(N,S,U) then f:Show();CooldownFrame_SetTimer(cd,GetTime(),TI,1) end end
function CPz(N,S,U) if(N==S and (U=="arena1" or U=="arena2" or U=="arena3" or U=="arenapet1" or U=="arenapet2" or U=="arenapet3"))then return true else return false end end


t1p="Interface\\Icons\\ability_rogue_shadowdance";t1=CF(F);TrS(t1,1060,500,"cd1",t1p,22,false);t1:SetScript(OE,function(_,_,U,N)Ts(t1,cd1,U,N,"Shadow Dance",60)end);
t2p="Interface\\Icons\\ability_rogue_kidneyshot";t2=CF(F);TrS(t2,1082,500,"cd2",t2p,22,false);t2:SetScript(OE,function(_,_,U,N)Ts(t2,cd2,U,N,"Kidney Shot",20)end);
t3p="Interface\\Icons\\spell_shadow_nethercloak";t3=CF(F);TrS(t3,1104,500,"cd3",t3p,22,false);t3:SetScript(OE,function(_,_,U,N)Ts(t3,cd3,U,N,"Cloak of Shadows",90)end);
t4p="Interface\\Icons\\ability_rogue_combatreadiness";t4=CF(F);TrS(t4,1104,500,"cd4",t4p,22,false);t4:SetScript(OE,function(_,_,U,N)Ts(t4,cd4,U,N,"Combat Readiness",90)end);
t5p="Interface\\Icons\\ability_vanish";t5=CF(F);TrS(t5,1126,500,"cd5",t5p,22,false);t5:SetScript(OE,function(_,_,U,N)Ts(t5,cd5,U,N,"Vanish",120)end);
t6p="Interface\\Icons\\ability_rogue_dismantle";t6=CF(F);TrS(t6,1148,500,"cd6",t6p,22,false);t6:SetScript(OE,function(_,_,U,N)Ts(t6,cd6,U,N,"Dismantle",60)end);
t7p="Interface\\Icons\\ability_rogue_shadowstep";t7=CF(F);TrS(t7,1170,500,"cd7",t7p,22,false);t7:SetScript(OE,function(_,_,U,N)Ts(t7,cd7,U,N,"Shadowstep",24)end);
t8p="Interface\\Icons\\spell_shadow_mindsteal";t8=CF(F);TrS(t8,1192,500,"cd8",t8p,22,false);t8:SetScript(OE,function(_,_,U,N)Ts(t8,cd8,U,N,"Blind",120)end);
t9p="Interface\\Icons\\ability_rogue_smoke";t9=CF(F);TrS(t9,1214,500,"cd9",t9p,22,false);t9:SetScript(OE,function(_,_,U,N)Ts(t9,cd9,U,N,"Smoke Bomb",180)end);
t10p="Interface\\Icons\\ability_rogue_preparation";t10=CF(F);TrS(t10,1236,500,"cd10",t10p,22,false);t10:SetScript(OE,function(_,_,U,N)Ts(t10,cd10,U,N,"Preparation",300)end);

t11p="Interface\\Icons\\spell_shadow_deathscream";t11=CF(F);TrS(t11,1060,470,"cd11",t11p,22,false);t11:SetScript(OE,function(_,_,U,N)Ts(t11,cd11,U,N,"Howl of Terror",32)end);
t12p="Interface\\Icons\\spell_shadow_deathcoil";t12=CF(F);TrS(t12,1104,470,"cd12",t12p,22,false);t12:SetScript(OE,function(_,_,U,N)Ts(t12,cd12,U,N,"Death Coil",90)end);
t13p="Interface\\Icons\\spell_shadow_demoniccircleteleport";t13=CF(F);TrS(t13,1082,470,"cd13",t13p,22,false);t13:SetScript(OE,function(_,_,U,N)Ts(t13,cd13,U,N,"Demonic Portal: Teleport",25)end);
t14p="Interface\\Icons\\spell_shadow_mindrot";t14=CF(F);TrS(t14,1126,470,"cd14",t14p,22,false);t14:SetScript(OE,function(_,_,U,N)Ts(t14,cd14,U,N,"Spell Lock",24)end);

t15p="Interface\\Icons\\ability_mage_deepfreeze";t15=CF(F);TrS(t15,1060,440,"cd15",t15p,22,false);t15:SetScript(OE,function(_,_,U,N)Ts(t15,cd15,U,N,"Deep Freeze",30)end);
t16p="Interface\\Icons\\spell_frost_wizardmark";t16=CF(F);TrS(t16,1082,440,"cd16",t16p,22,false);t16:SetScript(OE,function(_,_,U,N)Ts(t16,cd16,U,N,"Cold Snap",480)end);
t17p="Interface\\Icons\\spell_arcane_blink";t17=CF(F);TrS(t17,1104,440,"cd17",t17p,22,false);t17:SetScript(OE,function(_,_,U,N)Ts(t17,cd17,U,N,"Blink",15)end);


t18p="Interface\\Icons\\spell_shadow_soulleech_3";t18=CF(F);TrS(t18,1148,410,"cd18",t18p,22,false);t18:SetScript(OE,function(_,_,U,N)Ts(t18,cd18,U,N,"Strangulate",120)end);
t19p="Interface\\Icons\\spell_shadow_antimagicshell";t19=CF(F);TrS(t19,1082,410,"cd19",t19p,22,false);t19:SetScript(OE,function(_,_,U,N)Ts(t19,cd19,U,N,"Anti-Magic Shell",45)end);
t20p="Interface\\Icons\\spell_deathknight_iceboundfortitude";t20=CF(F);TrS(t20,1104,410,"cd20",t20p,22,false);t20:SetScript(OE,function(_,_,U,N)Ts(t20,cd20,U,N,"Icebound Fortitude",180)end);
t21p="Interface\\Icons\\inv_sword_62";t21=CF(F);TrS(t21,1192,410,"cd21",t21p,22,false);t21:SetScript(OE,function(_,_,U,N)Ts(t21,cd21,U,N,"Empowered Rune Weapon",300)end);
t22p="Interface\\Icons\\spell_shadow_raisedead";t22=CF(F);TrS(t22,1126,410,"cd22",t22p,22,false);t22:SetScript(OE,function(_,_,U,N)Ts(t22,cd22,U,N,"Lichborne",120)end);
t23p="Interface\\Icons\\spell_deathknight_strangulate";t23=CF(F);TrS(t23,1060,410,"cd23",t23p,22,false);t23:SetScript(OE,function(_,_,U,N)Ts(t23,cd23,U,N,"Death Grip",25)end);
t24p="Interface\\Icons\\spell_deathknight_antimagiczone";t24=CF(F);TrS(t24,1148,410,"cd24",t24p,22,false);t24:SetScript(OE,function(_,_,U,N)Ts(t24,cd24,U,N,"Anti-Magic Zone",120)end);
t25p="Interface\\Icons\\ability_deathknight_summongargoyle";t25=CF(F);TrS(t25,1170,410,"cd25",t25p,22,false);t25:SetScript(OE,function(_,_,U,N)Ts(t25,cd25,U,N,"Summon Gargoyle",180)end);

t26p="Interface\\Icons\\spell_shadow_psychicscream";t26=CF(F);TrS(t26,1060,385,"cd26",t26p,22,false);t26:SetScript(OE,function(_,_,U,N)Ts(t26,cd26,U,N,"Psychic Scream",26)end);
t27p="Interface\\Icons\\spell_shadow_psychicscream";t27=CF(F);TrS(t27,1082,385,"cd27",t27p,22,false);t27:SetScript(OE,function(_,_,U,N)Ts(t27,cd27,U,N,"Psychic Scream",30)end);
t28p="Interface\\Icons\\spell_frost_windwalkon";t28=CF(F);TrS(t28,1104,385,"cd28",t28p,22,false);t28:SetScript(OE,function(_,_,U,N)Ts(t28,cd28,U,N,"Inner Focus",45)end);
t29p="Interface\\Icons\\spell_holy_painsupression";t29=CF(F);TrS(t29,1126,385,"cd29",t29p,22,false);t29:SetScript(OE,function(_,_,U,N)Ts(t29,cd29,U,N,"Pain Suppression",45)end);
t30p="Interface\\Icons\\spell_shadow_dispersion";t30=CF(F);TrS(t30,1148,385,"cd30",t30p,22,false);t30:SetScript(OE,function(_,_,U,N)Ts(t30,cd30,U,N,"Dispersion",115)end);
t31p="Interface\\Icons\\spell_shadow_psychichorrors";t31=CF(F);TrS(t31,1170,385,"cd31",t31p,22,false);t31:SetScript(OE,function(_,_,U,N)Ts(t31,cd31,U,N,"Psychic Horror",90)end);
t32p="Interface\\Icons\\ability_priest_silence";t32=CF(F);TrS(t32,1192,385,"cd32",t32p,22,false);t32:SetScript(OE,function(_,_,U,N)Ts(t32,cd32,U,N,"Silence",45)end);

t33p="Interface\\Icons\\spell_holy_sealofvalor";t33=CF(F);TrS(t33,1060,350,"cd33",t33p,22,false);t33:SetScript(OE,function(_,_,U,N)Ts(t33,cd33,U,N,"Hand of Freedom",25)end);
t34p="Interface\\Icons\\spell_holy_sealofmight";t34=CF(F);TrS(t34,1082,350,"cd34",t34p,22,false);t34:SetScript(OE,function(_,_,U,N)Ts(t34,cd34,U,N,"Hammer of Justice",40)end);
t58p="Interface\\Icons\\spell_holy_sealofmight";t58=CF(F);TrS(t58,1104,350,"cd58",t58p,22,false);t58:SetScript(OE,function(_,_,U,N)Ts(t58,cd58,U,N,"Hammer of Justice",60)end);
t35p="Interface\\Icons\\spell_holy_sealofsacrifice";t35=CF(F);TrS(t35,1126,350,"cd35",t35p,22,false);t35:SetScript(OE,function(_,_,U,N)Ts(t35,cd35,U,N,"Hand of Sacrifice",90)end);
t36p="Interface\\Icons\\spell_holy_sealofprotection";t36=CF(F);TrS(t36,1148,350,"cd36",t36p,22,false);t36:SetScript(OE,function(_,_,U,N)Ts(t36,cd36,U,N,"Hand of Protection",180)end);
t37p="Interface\\Icons\\spell_holy_divineshield";t37=CF(F);TrS(t37,1170,350,"cd37",t37p,22,false);t37:SetScript(OE,function(_,_,U,N)Ts(t37,cd37,U,N,"Divine Shield",300)end);
t38p="Interface\\Icons\\spell_holy_auramastery";t38=CF(F);TrS(t38,1192,350,"cd38",t38p,22,false);t38:SetScript(OE,function(_,_,U,N)Ts(t38,cd38,U,N,"Aura Mastery",120)end);

t39p="Interface\\Icons\\ability_warrior_charge";t39=CF(F);TrS(t39,1060,320,"cd39",t39p,22,false);t39:SetScript(OE,function(_,_,U,N)Ts(t39,cd39,U,N,"Charge",13)end);
t40p="Interface\\Icons\\inv_mace_62";t40=CF(F);TrS(t40,1082,320,"cd40",t40p,22,false);t40:SetScript(OE,function(_,_,U,N)Ts(t40,cd40,U,N,"Throwdown",45)end);
t41p="Interface\\Icons\\ability_heroicleap";t41=CF(F);TrS(t41,1104,320,"cd41",t41p,22,false);t41:SetScript(OE,function(_,_,U,N)Ts(t41,cd41,U,N,"Heroic Leap",60)end);
t42p="Interface\\Icons\\spell_nature_ancestralguardian";t42=CF(F);TrS(t42,1126,320,"cd42",t42p,22,false);t42:SetScript(OE,function(_,_,U,N)Ts(t42,cd42,U,N,"Berserker Rage",30)end);
t43p="Interface\\Icons\\ability_criticalstrike";t43=CF(F);TrS(t43,1148,320,"cd43",t43p,22,false);t43:SetScript(OE,function(_,_,U,N)Ts(t43,cd43,U,N,"Recklessness",300)end);
t44p="Interface\\Icons\\ability_warrior_shieldwall";t44=CF(F);TrS(t44,1170,320,"cd44",t44p,22,false);t44:SetScript(OE,function(_,_,U,N)Ts(t44,cd44,U,N,"Shield Wall",300)end);

t45p="Interface\\Icons\\ability_hunter_pet_bear";t45=CF(F);TrS(t45,1060,290,"cd45",t45p,22,false);t45:SetScript(OE,function(_,_,U,N)Ts(t54,cd54,U,N,"Feral Charge",14)end);
t46p="Interface\\Icons\\spell_druid_feralchargecat";t46=CF(F);TrS(t46,1082,290,"cd46",t46p,22,false);t46:SetScript(OE,function(_,_,U,N)Ts(t46,cd46,U,N,"Feral Charge",28)end);
t47p="Interface\\Icons\\spell_nature_stoneclawtotem";t47=CF(F);TrS(t47,1104,290,"cd47",t47p,22,false);t47:SetScript(OE,function(_,_,U,N)Ts(t47,cd47,U,N,"Barkskin",60)end);
t48p="Interface\\Icons\\ability_druid_bash";t48=CF(F);TrS(t48,1126,290,"cd48",t48p,22,false);t48:SetScript(OE,function(_,_,U,N)Ts(t48,cd48,U,N,"Bash",60)end);
t49p="Interface\\Icons\\ability_druid_tigersroar";t49=CF(F);TrS(t49,1148,290,"cd49",t49p,22,false);t49:SetScript(OE,function(_,_,U,N)Ts(t49,cd49,U,N,"Survival Instincts",180)end);
t50p="Interface\\Icons\\ability_druid_berserk";t50=CF(F);TrS(t50,1170,290,"cd50",t50p,22,false);t50:SetScript(OE,function(_,_,U,N)Ts(t50,cd50,U,N,"Berserk",180)end);

t51p="Interface\\Icons\\ability_golemstormbolt";t51=CF(F);TrS(t51,1060,260,"cd51",t51p,22,false);t51:SetScript(OE,function(_,_,U,N)Ts(t51,cd51,U,N,"Scatter Shot",30)end);
t52p="Interface\\Icons\\spell_frost_chainsofice";t52=CF(F);TrS(t52,1082,260,"cd52",t52p,22,false);t52:SetScript(OE,function(_,_,U,N)Ts(t52,cd52,U,N,"Freezing Trap",30)end);
t53p="Interface\\Icons\\ability_whirlwind";t53=CF(F);TrS(t53,1104,260,"cd53",t53p,22,false);t53:SetScript(OE,function(_,_,U,N)Ts(t53,cd53,U,N,"Deterrence",120)end);
t54p="Interface\\Icons\\ability_rogue_feint";t54=CF(F);TrS(t54,1126,260,"cd54",t54p,22,false);t54:SetScript(OE,function(_,_,U,N)Ts(t54,cd54,U,N,"Disengage",16)end);

t55p="Interface\\Icons\\spell_shaman_hex";t55=CF(F);TrS(t55,1060,230,"cd55",t55p,22,false);t55:SetScript(OE,function(_,_,U,N)Ts(t55,cd55,U,N,"Hex",35)end);
t56p="Interface\\Icons\\spell_shaman_spiritlink";t56=CF(F);TrS(t56,1082,230,"cd56",t56p,22,false);t56:SetScript(OE,function(_,_,U,N)Ts(t56,cd56,U,N,"Spirit Link Totem",180)end);
t57p="Interface\\Icons\\spell_nature_tremortotem";t57=CF(F);TrS(t57,1104,230,"cd57",t57p,22,false);t57:SetScript(OE,function(_,_,U,N)Ts(t57,cd57,U,N,"Tremor Totem",60)end);


Arena CD UI Reset (Use after every arena as cooldowns remain timed)

/run for i=1,58 do _G["t"..i]:Hide() end

Posted Image


#7 Thaya

Thaya
  • Moderators
  • Posts: 1491
  • LocationRussia

Posted 17 April 2012 - 01:15 PM

There was an error with class color hp bars and class color name background scripts - the script got slightly modified due to "B)" being an emoticon (changed the lower case b into an upper case B).

Corrected it.

Edited by Thaya, 17 April 2012 - 01:15 PM.

Default UI Scripts - Compilation & how-to

#8 TGIFrisbie

TGIFrisbie
  • Members
  • Posts: 192

Posted 17 April 2012 - 03:55 PM

+repped, great compilation of currently useful scripts.

If you can find the Class Portraits post that involves changing druid portraits by druid form and add it to your compilation, that would be awesome (it's somewhere here on the forums, but I have no idea where it was posted)...

I've seen that portrait macro in a recent Arena video and must say it was very nice in action.

#9 Navariumx

Navariumx
  • Junkies
  • Blood Elfclass_name
  • EU-Skullcrusher
  • Cyclone / Wirbelsturm
  • Posts: 625
  • Talents: Retribution
  • RBG: 1775
  • LocationDenmark

Posted 17 April 2012 - 05:28 PM

Nice scripts, just one little thing:

/run for i = 1, 12 do _G["BonusActionButton"..i.."HotKey"]:Hide() end
/run for i = 1, 12 do _G["MultiBarBottomLeftButton"..i.."HotKey"]:Hide() end
/run for i = 1, 12 do _G["MultiBarBottomRightButton"..i.."HotKey"]:Hide() end


These will reappear in combat, using SetAlpha(0) circumvents this problem. =)

View PostBlackafrican, on 23 May 2011 - 05:45 PM, said:

I think you guys need to realize that shamans are not the problem, and are probably less powerful than you think.

#10 TGIFrisbie

TGIFrisbie
  • Members
  • Posts: 192

Posted 17 April 2012 - 05:42 PM

Corrected a spacing error that was throwing an error in game.  Thanks for posting the script.

View Postwit4er, on 17 April 2012 - 04:37 PM, said:

Spoiler


#11 Navariumx

Navariumx
  • Junkies
  • Blood Elfclass_name
  • EU-Skullcrusher
  • Cyclone / Wirbelsturm
  • Posts: 625
  • Talents: Retribution
  • RBG: 1775
  • LocationDenmark

Posted 17 April 2012 - 05:53 PM

View PostThaya, on 17 April 2012 - 08:57 AM, said:

This thread is a work in progress. I'm posting it way before its done because if I don't post it, I'll never finish it and it will just rot on my desktop in a .txt for eternity like all the other unfinished articles. And yes, I want it to be a sticky - doubt Kollektiv is planning to ever update the current thread.

Known issues/to-do list:
- I haven't tested some of the scripts. Namely the action bar scripts (I use dominos myself), arena scripts (nobody to wargame with to test them in actual arena, although I did test them with forced display).
- Order is random.
- Table of contents. (Can I create anchors with bb code? or will it have to be plain text Ctrl+F kind of thing)
- I'll add (small) screenshots and spoilertag some/all of the scripts, just improve format in general.

Scripts to add:
- Scale up buffs/debuffs on target/focus frames - still looking for a decent script for this
- Raid/party buff/debuff tweaks for healers. I got some scripts lying about like prioritizing UA debuff, moving debuffs to the right of the frame etc, but I have no idea how useful this actually is. Need a healer PoV/opinion on these.
- PvP trinket tracking. Several variants flowing about, don't bother linking them to me. I just want to test it properly first.
- hp/mana text on arena frames - not sure if this shows by default or not (couldn't test).
- move/resize action bars scripts. Same as with pvp trinkets - I just didn't get around to it, don't bother linking me those.
- Change status bar color of uninterruptable casts - wonder if this is at all possible?
- Stopwatch stuff. Will look at Xandyns scripts, just haven't gotten around to it yet.
- Hidden cooldown tracker for things like hamstring or mage frostbolt. Got a script for hamstring, just wonder if I can adapt it to other stuff, maybe even proc trinkets.
- Hide chat tab highlight on whispers - saw Navariums script for this, but it just hides the buttons for me (not even clickable). Like the idea though

What I don't want to do with this thread, at least not now: miniports of other addons, such as omnicc, losecontrol, spellalert, etc. If you want that functionality, you might as well just use the addons, there's really no reason not to unless you're going to Blizzcon tomorrow. Don't bother posting these. Otherwise I'm open to suggestions/contributions/optimizations.

I'm also sure there are some inconsistencies or errors in this current version since I'm too tired to proofread it properly, so do speak up if you notice mistakes.

/run for i=1,16 do _G["FocusFrameDebuff"..i]:SetScale(2)end
/run for i=1,16 do _G["TargetFrameDebuff"..i]:SetScale(2)end
/run for i=1,16 do _G["FocusFrameBuff"..i]:SetScale(2)end
/run for i=1,16 do _G["TargetFrameBuff"..i]:SetScale(2)end


This will increase the buff and debuff sizes, just take LUA errors off, as it seems to put up errors. =) Still works fine for me, though.

/run for j=1,40 do for i=1,3 do local f=_G["CompactRaidFrame"..j.."DispelDebuff"..i]if f then f:SetAlpha(0)local f=_G["CompactRaidFrame"..j.."Debuff"..i]if f then f:ClearAllPoints()end end end end
/run for j=1,40 do for i=1,3 do local f=_G["CompactRaidFrame"..j.."Debuff"..i.."Cooldown"]if f then f:SetScale(0.6)end end end
/run for j=1,40 do for i=1,3 do local f=_G["CompactRaidFrame"..j.."Debuff"..i]if f then f:SetPoint("BOTTOMRIGHT",0+i*13,0)local f=_G["CompactRaidFrame"..j.."Debuff"..i]if f then f:SetScale(2)end end end end


These scripts will hide the raid frame DispelDebuff icon, resize the debuffs and move them to the right of the frame, amazing for RBGs. <3 For party buffs just use Kollektiv's script in sticky, my personal preference is that I don't like it though, too much clutter.

For the chat, while my script hides them, you can simply make a SetBindingClick call to ChatFramen<n>Tab to click them. =)

View PostBlackafrican, on 23 May 2011 - 05:45 PM, said:

I think you guys need to realize that shamans are not the problem, and are probably less powerful than you think.

#12 Thaya

Thaya
  • Moderators
  • Posts: 1491
  • LocationRussia

Posted 17 April 2012 - 06:32 PM

Thanks for the tips! I'll be going over these in the next few days, a little bit busy atm.
Default UI Scripts - Compilation & how-to

#13 Claythorne

Claythorne
  • Members
  • Dwarfclass_name
  • US-Darkspear
  • Cyclone
  • Posts: 286
  • Talents: Restoration
  • RBG: 1335

Posted 17 April 2012 - 08:45 PM

This is amazing! really good post
Posted Image

#14 Superlative

Superlative
  • Members
  • Humanclass_name
  • EU-Outland
  • Misery
  • Posts: 51
  • Talents: Shadow 0/2/0/1/2/.
  • RBG: 1894

Posted 18 April 2012 - 02:11 PM

i do recommend checking out: Prestige Gaming (russian translated) loads of scripts and addons!

#15 Thaya

Thaya
  • Moderators
  • Posts: 1491
  • LocationRussia

Posted 20 April 2012 - 03:42 AM

Slight update:

- Wrote table of contents (ctrl+f ghetto search possible);
- Ordered the scripts by what I think is more relevant/useful/popular;
- Changed the "absolute value on unitframes" script to a more efficient version. New version uses much much less cpu cycles. I urge you to switch to it if you're using the old script that runs on every OnUpdate event (ctrl+f 3.6);
- Added Novoz horizontal arena frames as an example for arena frame scaling/position script (ctrl+f 4.2);
- Action bar scripts actually work now (hotkey hide script didn't work at all), and expanded the hide graphic section (scripts to hide pretty much everything if you want to).

Just need to add screenshots to everything now and I'm done with the tedious/boring part of it. Will add the scripts I promised to add after that. Got very limited time this week, and none this weekend most likely.

Edited by Thaya, 20 April 2012 - 11:50 AM.

Default UI Scripts - Compilation & how-to

#16 Anathëma

Anathëma
  • Junkies
  • Dwarfclass_name
  • EU-Outland
  • Misery
  • Posts: 87
  • Talents: Enhancement 0/2/0/1/1/2
  • 2v2: 1730
  • 3v3: 1845

Posted 20 April 2012 - 02:13 PM

Thanks, this topic is great :D.

Would like to ask you something if you dont mind :) - is it possible to change the scale and/or position of the default blizzard combat text through scripts?
Posted Image

#17 Thaya

Thaya
  • Moderators
  • Posts: 1491
  • LocationRussia

Posted 20 April 2012 - 03:18 PM

View PostAnathëma, on 20 April 2012 - 02:13 PM, said:

Thanks, this topic is great :D.

Would like to ask you something if you dont mind :) - is it possible to change the scale and/or position of the default blizzard combat text through scripts?
I found this to work for scaling:
CombatText:SetScale(1.5)
But the interaction is a bit weird since that resizes the frame with the floating text, not increases the font size. So basically the more you increase it, the higher up the text will pop. Default scale is 1, obviously.

COMBAT_TEXT_HEIGHT = 25
This will increase font size (25 is the default value). This will make the text itself look worse, though.

As for position: that'll be a lot harder. It seems that the position is hardcoded directly into the function that creates messages, it'll be hard to modify it, the solution definitely won't look pretty.

Edited by Thaya, 20 April 2012 - 03:20 PM.

Default UI Scripts - Compilation & how-to

#18 r8ms

r8ms
  • Members
  • Posts: 12

Posted 20 April 2012 - 04:59 PM

Hi guys, i tried to make this script that shows players trinkets in arenas.but it doesnt work. Anyone know how to fix it?

local trinkets = {}
local events = CreateFrame("Frame")
 
function events:ADDON_LOADED(addonName)
	if addonName ~= "Blizzard_ArenaUI" then
		return
	end

	local arenaFrame, trinket
	for i = 1, MAX_ARENA_ENEMIES do
		arenaFrame = "ArenaEnemyFrame"..i
		trinket = CreateFrame("Cooldown", arenaFrame.."Trinket", ArenaEnemyFrames)
		trinket:SetPoint("Right", arenaFrame, 29, -5)
		trinket:SetSize(30, 30)
		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
	self:UnregisterEvent("ADDON_LOADED")
end
 
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")
	elseif spellID == 7744 then
		CooldownFrame_SetTimer(trinkets[unitID], GetTime(), 45, 1)
		SendChatMessage("WotF 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
 
SLASH_BAF1 = "/baf"
SlashCmdList["BAF"] = function(msg, editBox)
	if not IsAddOnLoaded("Blizzard_ArenaUI") then
		LoadAddOn("Blizzard_ArenaUI")
	end
	ArenaEnemyFrames:Show()
	local arenaFrame
	for i = 1, MAX_ARENA_ENEMIES do
		arenaFrame = _G["ArenaEnemyFrame"..i]
		arenaFrame.classPortrait:SetTexture("Interface\\TargetingFrame\\UI-Classes-Circles")
		arenaFrame.classPortrait:SetTexCoord(unpack(CLASS_ICON_TCOORDS["WARRIOR"]))
		arenaFrame.name:SetText("Dispelme")
		arenaFrame:Show()
		CooldownFrame_SetTimer(trinkets["arena"..i], GetTime(), 120, 1)
	end
end
 
events:SetScript("OnEvent", function(self, event, ...) return self[event](self, ...) end)
events:RegisterEvent("ADDON_LOADED")
events:RegisterEvent("PLAYER_ENTERING_WORLD")


#19 Anathëma

Anathëma
  • Junkies
  • Dwarfclass_name
  • EU-Outland
  • Misery
  • Posts: 87
  • Talents: Enhancement 0/2/0/1/1/2
  • 2v2: 1730
  • 3v3: 1845

Posted 20 April 2012 - 06:15 PM

View PostThaya, on 20 April 2012 - 03:18 PM, said:

I found this to work for scaling:
CombatText:SetScale(1.5)
But the interaction is a bit weird since that resizes the frame with the floating text, not increases the font size. So basically the more you increase it, the higher up the text will pop. Default scale is 1, obviously.

COMBAT_TEXT_HEIGHT = 25
This will increase font size (25 is the default value). This will make the text itself look worse, though.

As for position: that'll be a lot harder. It seems that the position is hardcoded directly into the function that creates messages, it'll be hard to modify it, the solution definitely won't look pretty.


Alright thanks a lot for you help :).
Posted Image

#20 Vengeance

Vengeance
  • Junkies
  • Humanclass_name
  • US-Sargeras
  • Shadowburn
  • Posts: 111
  • Talents: Subtlety 0/2/2/0/0/.

Posted 20 April 2012 - 07:36 PM

HP Values AND Percents for Player, Target, and Focus Frames:

	FrameList = {"Player", "Target", "Focus"}
	function UpdateHealthValues(...)
		for i = 1, select("#", unpack(FrameList)) do 
			local FrameName = (select(i, unpack(FrameList)))
			local Health = TextStatusBar_CapDisplayOfNumericValue(UnitHealth(FrameName))
			local HealthMax = TextStatusBar_CapDisplayOfNumericValue(UnitHealthMax(FrameName))
			local HealthPercent = (UnitHealth(FrameName)/UnitHealthMax(FrameName))*100
			_G[FrameName.."FrameHealthBar"].TextString:SetText(Health.."/"..HealthMax.." ("..format("%.0f",HealthPercent).."%)")
		end
	end
	hooksecurefunc("TextStatusBar_UpdateTextStringWithValues", UpdateHealthValues)

Macro 1:
/run CDNV=TextStatusBar_CapDisplayOfNumericValue;PFHB=PlayerFrameHealthBar.TextString;TFHB=TargetFrameHealthBar.TextString;FFHB=FocusFrameHealthBar.TextString;

Macro 2(PlayerFrame):
/run hooksecurefunc("TextStatusBar_UpdateTextStringWithValues",function() UH=UnitHealth("player");UHM=UnitHealthMax("player");PH=CDNV(UH);PMH=CDNV(UHM);PHP=((UH/UHM)*100);PFHB:SetText(PH.."/"..PMH.." ("..format("%.0f", PHP).."%)");end)

Macro 3(TargetFrame):
/run hooksecurefunc("TextStatusBar_UpdateTextStringWithValues",function() TUH=UnitHealth("target");TUHM=UnitHealthMax("target");TH=CDNV(TUH);TMH=CDNV(TUHM);THP=((TUH/TUHM)*100);TFHB:SetText(TH.."/"..TMH.." ("..format("%.0f", THP).."%)");end)

Macro 4(FocusFrame):
/run hooksecurefunc("TextStatusBar_UpdateTextStringWithValues",function() FUH=UnitHealth("focus");FUHM=UnitHealthMax("focus");FH=CDNV(FUH);FMH=CDNV(FUHM);FHP=((FUH/FUHM)*100);FFHB:SetText(FH.."/"..FMH.."  ("..format("%.0f", FHP).."%)");end)

OR

Condensed version of the above 4 macros, into 2.
Macro 1:
V=TextStatusBar_CapDisplayOfNumericValue;function Z(...)for i=1,3 do W=(select(i,"Player","Target","Focus"))Y=UnitHealth(W)X=UnitHealthMax(W)H=V(Y)M=V(X)P=(Y/X)*100;_G[W.."FrameHealthBar"].TextString:SetText(H.."/"..M.." ("..format("%.0f",P).."%)")end;end

Macro 2:
hooksecurefunc("TextStatusBar_UpdateTextStringWithValues",Z)

Macro 1 is exactly 255 characters long. :)

Posted Image

Edited by Vengeance, 20 April 2012 - 10:26 PM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

<