Originally Posted by
kickmydog
I have been considering it, but honestly I looked at the code for Nova Frame and I don't have to time to delve into it in any great detail.
But I definitely like the idea of using the /commands to toggle abilities.
Code:
--------------------
-- Slash Commands --
--------------------
if SlashMacros == nil then
SlashMacros = true
RegisterCVar("Tamrael_ActiveCD", 0)
SLASH_ACTIVECOOLDOWNS1 = "/activecooldowns"
SLASH_ACTIVECOOLDOWNS2 = "/activecooldown"
function SlashCmdList.ACTIVECOOLDOWNS(msg, editbox)
if not GetCVarBool("Tamrael_ActiveCD") then
xrn:message("|cff9933ffCooldowns - Active.")
SetCVar("Tamrael_ActiveCD", 1)
else
xrn:message("|cff9933ffCooldowns - Inactive.")
SetCVar("Tamrael_ActiveCD", 0)
end
end
RegisterCVar("Tamrael_AOE_Toggle", 0)
SLASH_AOE1 = "/aoe"
function SlashCmdList.AOE(msg, editbox)
if not GetCVarBool("Tamrael_AOE_Toggle") then
xrn:message("|cff9933ffAOE - Mode.")
SetCVar("Tamrael_AOE_Toggle", 1)
else
xrn:message("|cff9933ffSingle - Mode.")
SetCVar("Tamrael_AOE_Toggle", 0)
end
end
end
AutoCooldowns = GetCVarBool("Tamrael_ActiveCD")
AOEToggle = GetCVarBool("Tamrael_AOE_Toggle")
just change the variable names to anything you want on makro and test vor the variables at the end of the code in the abilitiy you want to fire on makro.this code should be put on top of the rotation so the "GetCVarBool" will be updated every run of the routine the slash macros should only be read in once that why they are in the fi-statement.this is not my code just a like snippet out of cml's wonderful profile for my one personal use, so if you use the code and like it please consider +rep'in him not me
EDIT: the part with the xrn:message is not needed but if you want to include it you have to to something like:
Code:
if PQR_RotationStarted == true then
-- xrn Chat Overlay
local function onUpdate(self,elapsed)
if self.time < GetTime() - 2.8 then
if self:GetAlpha() == 0 then self:Hide() else self:SetAlpha(self:GetAlpha() - .05) end
end
end
xrn = CreateFrame("Frame",nil,ChatFrame1)
xrn:SetSize(ChatFrame1:GetWidth(),30)
xrn:Hide()
xrn:SetScript("OnUpdate",onUpdate)
xrn:SetPoint("TOP",0,0)
xrn.text = xrn:CreateFontString(nil,"OVERLAY","MovieSubtitleFont")
xrn.text:SetAllPoints()
xrn.texture = xrn:CreateTexture()
xrn.texture:SetAllPoints()
xrn.texture:SetTexture(0,0,0,.50)
xrn.time = 0
function xrn:message(message)
self.text:SetText(message)
self:SetAlpha(1)
self.time = GetTime()
self:Show()
end
end
on top of the rotaion as well