Hi All,
I have been right down in the guts of things and here is an attempt at a macro that watches for a Proc then acts. I get asked about these all the time and here is why it wont work.
TL;DR; - The action that updates the step is EXPLICITLY BLOCKED BY Blizzard.
Macro:
Sequences['DB_Fire'] = {
specID = 63,
author = "John Mets - wowlazymacros.com",
helpTxt = "Talents - 2233111",
procstep=5,
proctest="Hot Streak!",
StepFunction=GSStaticProcTest,
PreMacro = [[
/targetenemy [noharm][dead]
]],
"/castsequence reset=combat Fireball, Fireball, Fireball, Fireball, Fire Blast",
"/cast Combustion",
"/cast Living Bomb",
"/cast Ice floes",
"/cast Pyroblast",
}
The Underlying on Click code:
local procstep = self:GetAttribute('procstep')
local proctest = self:GetAttribute('proctest')
local returnstep = self:GetAttribute('returnstep')
if not GSisEmpty(proctest) then
local procname = UnitBuff("player", proctest)
if not GSisEmpty(procname) then
print("proc " .. procname)
self:SetAttribute('returnstep', step) -- This is the line that would fail and abort at. This function is explicitly blocked within the Macro sandbox.
print(self:GetAttribute('returnstep'))
self:SetAttribute('step', procstep)
print(3)
step = procstep
print(4)
end
elseif not GSisEmpty(returnstep) then
print("reset")
self:SetAttribute('step', returnstep)
self:SetAttribute('returnstep', nil)
step = returnstep
end
The step FUnciton in this was watching for Hot Streak and would then change the Step to be 5. Prior to that it would cycle through steps 1-4 and not hit 5 unless Hot Streak. The macro could detect Hot Streak but when it went to change the step to 5 “Interface has been Blocked from an Action”. As soon as you call UnitBuff, you are restricted to read actions only.