WoWInterface

WoWInterface (http://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (http://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Help with Class Specific buff macro (http://www.wowinterface.com/forums/showthread.php?t=910)

notphilip 06-09-05 08:59 PM

OK so I made a macro that either casts blessing of might or blessing of wisdom depending on the target class. However, I've got two problems. When I cast it on cloth classes, it still does blessing of might. Also in order for me to cast this, I must untarget, then click on the macro button, and then I have to click on the target player. How do I fix these problems?

Here is what i have so far
/script if(UnitClass("target")==Priest) then CastSpellByName("Blessing of Wisdom (Rank3)")end
/script if(UnitClass("target")==Mage) then CastSpellByName("Blessing of Wisdom (Rank 3)")end
/script if(UnitClass("target")==Warlock) then CastSpellByName("Blessing of Wisdom (Rank 3)")end
/script if(UnitClass("target")==Warrior) then CastSpellByName("Blessing of Might(Rank 5)")end
/script if(UnitClass("target")==Rogue) then CastSpellByName("Blessing of Might(Rank 5)")end
/script if(UnitClass("target")==Hunter) then CastSpellByName("Blessing of Might(Rank 5)")end
/script if(UnitClass("target")==Druid) then CastSpellByName("Blessing of Wisdom(Rank 3)")end
/script if(UnitClass("target")==Paladin) then CastSpellByName("Blessing of Might(Rank 5)")end

I'm very well aware that the code is very messy but I'm new to the wow code and I have no idea what operators this language uses for "and" or "or". It took me a little bit to figure out that I had to use double equals for the comparison operator :P. Please help.

notphilip 06-11-05 11:02 PM

bump. Please I really need help

Inokis 06-11-05 11:43 PM

the way i solve complex macros is i throw them in an lua file and load that as an addon, I call my local addon MacroLib. So the first question to you use do you want to stick to programming that macro in the MacroUI or do you want to create a macro library addon to refrence your macro functions from?

notphilip 06-11-05 11:50 PM

I think I'd like to make an addon. Is this addon language difficult? I have pretty good knowledge of C++ and know the basics of object oriented programming.

Gello 06-12-05 12:18 AM

This may work as a macro:

/script local w,s,m,b="Wisdom(Rank 3)","Salvation(Rank 1)","Might(Rank 5)",{Priest=s,Mage=w,Warlock=w,Warrior=m,Rogue=m,Hunter=m,Druid=w,Paladin=m} if UnitExists("target") then CastSpellByName("Blessing of "..b[UnitClass("target")]) end

I added Salvation for priests. But if you have a warrior tank or the priest really wants wisdom instead, change Priest=s to Priest=w.

notphilip 06-12-05 12:27 AM

Quote:

Originally Posted by Gello
This may work as a macro:

/script local w,s,m,b="Wisdom(Rank 3)","Salvation(Rank 1)","Might(Rank 5)",{Priest=s,Mage=w,Warlock=w,Warrior=m,Rogue=m,Hunter=m,Druid=w,Paladin=m} if UnitExists("target") then CastSpellByName("Blessing of "..b[UnitClass("target")]) end

I added Salvation for priests. But if you have a warrior tank or the priest really wants wisdom instead, change Priest=s to Priest=w.

thanks. for some reason, nothing happens when i click on it.

Inokis 06-12-05 01:03 AM

I helped him work out a script using an addon:

Code:

function Blessing()
        if not UnitAffectingCombat("Player") and not UnitExists("Target") then
                TargetNearestFriend();
                if ( UnitClass("target") == "Priest" ) or ( UnitClass("target")== "Mage" ) or  ( UnitClass("target") == "Warlock" ) or  ( UnitClass("target") == "Druid" ) then 
                                  CastSpellByName("Blessing of Wisdom (Rank3)"); 
                      elseif ( UnitClass("target") == "Rogue" ) or  ( UnitClass("target")== "Hunter" ) or  ( UnitClass("target")== "Paladin" ) or ( UnitClass("target") == "Warrior" ) then
                                  CastSpellByName("Blessing of Might(Rank 5)");
                end
        elseif UnitInParty("Player") then
                TargetUnit("Party1");
                if ( UnitClass("target") == "Priest" ) or ( UnitClass("target")== "Mage" ) or  ( UnitClass("target") == "Warlock" ) or  ( UnitClass("target") == "Druid" ) then 
                                  CastSpellByName("Blessing of Wisdom (Rank3)"); 
                      elseif ( UnitClass("target") == "Rogue" ) or  ( UnitClass("target")== "Hunter" ) or  ( UnitClass("target")== "Paladin" ) or ( UnitClass("target") == "Warrior" ) then
                                  CastSpellByName("Blessing of Might(Rank 5)");
                end
                TargetUnit("Party2");
                if ( UnitClass("target") == "Priest" ) or ( UnitClass("target")== "Mage" ) or  ( UnitClass("target") == "Warlock" ) or  ( UnitClass("target") == "Druid" ) then 
                                  CastSpellByName("Blessing of Wisdom (Rank3)"); 
                      elseif ( UnitClass("target") == "Rogue" ) or  ( UnitClass("target")== "Hunter" ) or  ( UnitClass("target")== "Paladin" ) or ( UnitClass("target") == "Warrior" ) then
                                  CastSpellByName("Blessing of Might(Rank 5)");
                end
                TargetUnit("Party3");
                if ( UnitClass("target") == "Priest" ) or ( UnitClass("target")== "Mage" ) or  ( UnitClass("target") == "Warlock" ) or  ( UnitClass("target") == "Druid" ) then 
                                  CastSpellByName("Blessing of Wisdom (Rank3)"); 
                      elseif ( UnitClass("target") == "Rogue" ) or  ( UnitClass("target")== "Hunter" ) or  ( UnitClass("target")== "Paladin" ) or ( UnitClass("target") == "Warrior" ) then
                                  CastSpellByName("Blessing of Might(Rank 5)");
                end
                TargetUnit("Party4");
                if ( UnitClass("target") == "Priest" ) or ( UnitClass("target")== "Mage" ) or  ( UnitClass("target") == "Warlock" ) or  ( UnitClass("target") == "Druid" ) then 
                                  CastSpellByName("Blessing of Wisdom (Rank3)"); 
                      elseif ( UnitClass("target") == "Rogue" ) or  ( UnitClass("target")== "Hunter" ) or  ( UnitClass("target")== "Paladin" ) or ( UnitClass("target") == "Warrior" ) then
                                  CastSpellByName("Blessing of Might(Rank 5)");
                end
        else               
                if ( UnitClass("target") == "Priest" ) or ( UnitClass("target")== "Mage" ) or  ( UnitClass("target") == "Warlock" ) or  ( UnitClass("target") == "Druid" ) then 
                                  CastSpellByName("Blessing of Wisdom (Rank3)"); 
                      elseif ( UnitClass("target") == "Rogue" ) or  ( UnitClass("target")== "Hunter" ) or  ( UnitClass("target")== "Paladin" ) or ( UnitClass("target") == "Warrior" ) then
                                  CastSpellByName("Blessing of Might(Rank 5)");
                end
      end
      TargetLastEnemy();       
 end



All times are GMT -6. The time now is 09:34 AM.

vBulletin © 2017, Jelsoft Enterprises Ltd
© 2004 - 2017 MMOUI