PDA

View Full Version : Paly Tanking Macro


Thetos
27-11-2006, 03:31 PM
I have never created a macro more advanced than "/decursive". I have been browsing some of the Macros available on the site and am unable to figure out how to make the macro I am after.

What I want is a single button that does 3 things:
If my target is targetting me, cast Holy Shield
If my target is targetting a clothy, cast Blessing of Protection
If my target is targetting a non-clothy, cast Righteous Defense

This is what I have come up with so far, but I only get errors when I test it. Any help would be appreciated. Any ways to improve upon this idea would be appreciated as well.

/script c=CastSpellByName;if not UnitIsUnit("targettarget", "player") then if ((class=="Warlock") or (class=="Priest") or (class=="Mage")) c("Blessing of Protection (Rank 3)") else c("Righteous Defense"));end
/run if UnitMana("player")>135 then CastSpellByName("Holy Shield");end

Duugu
27-11-2006, 07:08 PM
Can't test it ... but I think it's something like this:

/script t="targettarget";u=UnitName;c=CastSpellByName;cl=UnitClass(t);if u("player")==U(t) then c("Holy Shield");elseif ((cl=="Warlock") or (cl=="Priest") or (cl=="Mage")) then c("Blessing of Protection (Rank 3)");else c("Righteous Defense");end

Or just more readable:

t="targettarget";
u=UnitName;
c=CastSpellByName;
cl=UnitClass(t);
if u("player") == U(t) then
c("Holy Shield");
elseif ((cl=="Warlock") or (cl=="Priest") or (cl=="Mage")) then
c("Blessing of Protection (Rank 3)");
else
c("Righteous Defense");
end

246 chars ... tight. :)


Edit: just want to inform you that the next definitely patch will break this macro.
Don't accustom to it. *g*