Thread Tools Display Modes
06-09-05, 08:59 PM   #1
notphilip
A Murloc Raider
Join Date: Jun 2005
Posts: 6
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.

Last edited by notphilip : 06-10-05 at 04:56 AM. Reason: nevermind
  Reply With Quote
06-11-05, 11:02 PM   #2
notphilip
A Murloc Raider
Join Date: Jun 2005
Posts: 6
bump. Please I really need help
  Reply With Quote
06-11-05, 11:43 PM   #3
Inokis
EQInterface Staff
 
Inokis's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 156
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?
__________________
If not yourself, who can you count on...
  Reply With Quote
06-11-05, 11:50 PM   #4
notphilip
A Murloc Raider
Join Date: Jun 2005
Posts: 6
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.
  Reply With Quote
06-12-05, 12:18 AM   #5
Gello
A Molten Giant
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 521
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.
  Reply With Quote
06-12-05, 12:27 AM   #6
notphilip
A Murloc Raider
Join Date: Jun 2005
Posts: 6
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.
  Reply With Quote
06-12-05, 01:03 AM   #7
Inokis
EQInterface Staff
 
Inokis's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 156
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
__________________
If not yourself, who can you count on...

Last edited by Inokis : 06-12-05 at 01:35 AM.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Help with Class Specific buff macro

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off