cyklon wrote:Why make it so complex?
/run if buffed("Find Herbs", 'player') then CastSpellByName("Find Minerals") else CastSpellByName("Find Herbs") end;
I'm pretty sure Vanilla API doesn't have "buffed" function. Instead of that, use UnitBuff("unit", "buffName"). Example: UnitBuff("player", "Find Herbs").
By the way, can you make a timer that switches between Find Herbs/Minerals every 1 second?
E.g.:
- Code: Select all
/run local f, t, e = CreateFrame("FRAME"), GetTime(), 0; f:SetScript("OnUpdate", function() e = GetTime() - t; if e > 1 then t = GetTime(); if UnitBuff("player", "Find Herbs") then CastSpellByName("Find Minerals"); else CastSpellByName("Find Herbs"); end; end; end;);
If the code above is too big for regular macros, try this one:
- Code: Select all
/run local f,t,e,c,g = CreateFrame("FRAME"),GetTime(),0,CastSpellByName,GetTime f:SetScript("OnUpdate", function() e = g - t if e > 1 then t = g if UnitBuff("player", "Find Herbs") then c("Find Minerals") else c("Find Herbs") end end end)