Page 1 of 1

All in one Buff command.

Posted: Sat Feb 27, 2010 4:23 pm
by nod77
I was maintaining three different buff macro's for raid, group and soloing so, I decided to consolidate them. This is the result of that. I've learned alot from the boards and people here and am excited to finally be able to give back a little. I'm hoping people like it and find it useful. I'm ready for feedback about improvements and maybe some feature requests but, please be gentle. This is the first time I'm posting a script that I've written.

-nod77

Code: Select all

|----------------------------------------------------------- 
|Description & Command Instructions
|-----------------------------------------------------------
|
|- Buff Macro Ver. 1.00 by Nod77.
|- This script can be made to work for any class or level. It is currently set up for a level 85 Shadow Knight.
| 
|- This script will detect when you are in a raid, in a group or just solo. It will then buff you with
|   a set of buffs you have defined for that situation.  For instance, while in a group I run Mental Horror
|   for its Mana Tap proc but, while in a raid I prefer to run Shroud of the Blightborn for its Life Tap proc.
|
|- Optionally you can pass it the "solo" perameter if you want it to cast the Solo set of buffs even though you are
|   in a group or a raid. This perameter is useful when you have died during raid combat and can't get rebuffed by your
|   group members right away due to ongoing combat.  It will buff you using items or potions you use when group
|   buffs are not available such as Distillate of Health XIV, Distillate of Alacrity X, Distillate of Clarity XIV etc.
|   /example /macro buff.mac solo
|
|- You can also pass it the "nopet" parameter if you do not want it to cast your pet or you are not a pet class.
|   This can be handy for raid encounters or situations where having a pet out would cause problems
|   example /macro buff.mac nopet
|
|- You can also pass it both perameters at once in any order if need be.
|   example /macro buff.mac nopet solo
|   example /macro buff.mac solo nopet
|
|- If you do not pass it the "nopet" parameter it will default to casting a pet. 
|
|- Each section you need to edit will have text containing additional information and configuration instructions.
|
|----------------------------------------------------------- 
|Code: Pre-execution Commands 
|-----------------------------------------------------------
#turbo 10
#include spell_routines.inc

|------------------------------------------------------------ 
|Code: Variable Information. 
|------------------------------------------------------------ 
Sub Main 
   /declare	CastPet		bool	outer   TRUE
   /declare	solo		bool	outer	FALSE	
   /declare	BuffSub		int	outer	1

   /if (${Defined[Param0]} && ${Param0.Equal[nopet]}) /varset CastPet FALSE
   /if (${Defined[Param1]} && ${Param1.Equal[nopet]}) /varset CastPet FALSE
   /if (${Defined[Param0]} && ${Param0.Equal[solo]}) /varset solo TRUE
   /if (${Defined[Param1]} && ${Param1.Equal[solo]}) /varset solo TRUE

|- The script memorizes a buff spell in the slot number you define then casts it. It then memorizes the next buff
|   spell using that same spell slot. This is where you define what number spell slot you would like to use.
|   Characters start out with only 8 slots to memorize spells in so, if you do not have 12 slots be sure to
|   edit the number below.
   /declare	MemSlot		int	outer	12	

|- After buffing is done, The script will memorize a spell of your choice in the slot that was used
|   to memorize buff spells.  Edit the name below to the name of the spell you would like to use here.
|   This can be any spell you want.  Perhaps you want a spell you use in combat placed here or a buff
|   spell that has a short duration and you have to recast alot.  I use Malarian skin buff here
|   becuase its refresh timer is so long.  I then have it listed as the first buff that is cast
|   in all sets.  This way I do not have to wait on its recast timer everytime I run the buff script.
|   Also, the spells duration is only 7 min. Having it memorized after the script runs makes it
|   convenient for me to manually click it when I need it. 
   /declare	DefaultGem	string	outer	Malarian Skin Rk. III

|This is the spell name you use to cast your pet.
   /declare	PetSpell	string	outer	Minion of Sebilis Rk. II
   /declare	PetSpellGem	string	outer	gem${MemSlot}

|This is the spell name you use to buff your pet.
   /declare	PetBuff		string	outer	Gift of Sathir Rk. II 
   /declare	PetBuffName	string	outer	Gift of Sathir Rk. II 
   /declare	PetBuffGem	string	outer	gem${MemSlot}

   /if (!${solo} && ${Raid.Member[${Me}].ID}) {
      /echo Starting buffs from the Raid set...

|- Raid buff section.  
|  -This number represents how many buffs spells you will define for this section.  If you add or remove spells to this
|   section, be sure to edit this number so that it matches.
      /declare	BuffSpells	int	outer	6

|- This is where you enter the names of the buff spells you wish to use when you are in a raid.
|  -BuffSpellName1 is where you enter the name of the item or spell you wish to cast.
|  -BuffSpell1 is where you enter the name of the resulting icon in the buff bar.
|  -BuffSpellGem1 is where you enter the name of the Gem the spell is to be memorized in.  It is also used to define if a
|   alternate ability or item is used  to cast the spell.
|  -You may add or remove as many spells as you like.  Simply continue by adding new /declare statements and
|   changing the number at the end of the items declared (BuffSpell#", BuffSpellName#, BuffSpellGem#).
|  -If you add or remove spells don't forget to change the number that defines the amount of spells (referanced above).
|  -For spells the gem slot value is "gem${MemSlot}".  For items the value is "items" and for alternate abilities the
|   value is "alt".
      /declare	BuffSpell1	string	outer	Malarian Skin Rk. III 
      /declare	BuffSpellName1	string	outer	Malarian Skin Rk. III 
      /declare	BuffSpellGem1	string	outer	gem${MemSlot} 

      /declare	BuffSpell2	string	outer	Shroud of the Blightborn Rk. III 
      /declare	BuffSpellName2	string	outer	Shroud of the Blightborn Rk. III  
      /declare	BuffSpellGem2	string	outer	gem${MemSlot}

      /declare	BuffSpell3	string	outer	Mindshear Horror Rk. III 
      /declare	BuffSpellName3	string	outer	Mindshear Horror Rk. III
      /declare	BuffSpellGem3	string	outer	gem${MemSlot} 

      /declare	BuffSpell4	string	outer	Drape of Korafax Rk. II 
      /declare	BuffSpellName4	string	outer	Drape of Korafax Rk. II
      /declare	BuffSpellGem4	string	outer	gem${MemSlot} 

      /declare	BuffSpell5	string	outer	Form of Defense VI 
      /declare	BuffSpellName5	string	outer	Cold Iron Shield
      /declare	BuffSpellGem5	string	outer	item

      /declare	BuffSpell6	string	outer	Familiar: Icy Gelidran  
      /declare	BuffSpellName6	string	outer	Familiar of King Gelaqua
      /declare	BuffSpellGem6	string	outer	item

      /Call Start
   }

   /if (!${solo} && !${Raid.Member[${Me}].ID} && ${Group.Member[1].ID}) {
      /echo Starting buffs from the Group set...

|- Group buff section.
|  -This number represents how many buffs spells you will define for this section.  If you add or remove spells to this
|   section, be sure to edit this number so that it matches.
      /declare	BuffSpells	int	outer	12

|- This is where you enter the names of the buff spells you wish to use when you are in a group.
|  -BuffSpellName1 is where you enter the name of the item or spell you wish to cast.
|  -BuffSpell1 is where you enter the name of the resulting icon in the buff bar.
|  -BuffSpellGem1 is where you enter the name of the Gem the spell is to be memorized in.  It is also used to define if a
|   alternate ability or item is used  to cast the spell.
|  -You may add or remove as many spells as you like.  Simply continue by adding new /declare statements and
|   changing the number at the end of the items declared (BuffSpell#", BuffSpellName#, BuffSpellGem#).
|  -If you add or remove spells don't forget to change the number that defines the amount of spells (referanced above).
|  -For spells the gem slot value is "gem${MemSlot}".  For items the value is "items" and for alternate abilities the
|   value is "alt".
      /declare	BuffSpell1	string	outer	Malarian Skin Rk. III 
      /declare	BuffSpellName1	string	outer	Malarian Skin Rk. III
      /declare	BuffSpellGem1	string	outer	gem${MemSlot} 

      /declare	BuffSpell2	string	outer	Mental Horror
      /declare	BuffSpellName2	string	outer	Mental Horror
      /declare	BuffSpellGem2	string	outer	gem${MemSlot}

      /declare	BuffSpell3	string	outer	Mindshear Horror Rk. III 
      /declare	BuffSpellName3	string	outer	Mindshear Horror Rk. III
      /declare	BuffSpellGem3	string	outer	gem${MemSlot} 

      /declare	BuffSpell4	string	outer	Drape of Korafax Rk. II 
      /declare	BuffSpellName4	string	outer	Drape of Korafax Rk. II
      /declare	BuffSpellGem4	string	outer	gem${MemSlot} 

      /declare	BuffSpell5	string	outer	Hateful Guard 
      /declare	BuffSpellName5	string	outer	Mask of Lament
      /declare	BuffSpellGem5	string	outer	item 

      /declare	BuffSpell6	string	outer	Form of Defense VI 
      /declare	BuffSpellName6	string	outer	Cold Iron Shield
      /declare	BuffSpellGem6	string	outer	item 

      /declare	BuffSpell7	string	outer	Familiar: Icy Gelidran  
      /declare	BuffSpellName7	string	outer	Familiar of King Gelaqua
      /declare	BuffSpellGem7	string	outer	item

      /declare	BuffSpell8	string	outer	Storm Guard
      /declare	BuffSpellName8	string	outer	Stormeye Band
      /declare	BuffSpellGem8	string	outer	Item

      /declare	BuffSpell9	string	outer	Bobbing Corpse
      /declare	BuffSpellName9	string	outer	Shai`din Revenant Bauble
      /declare	BuffSpellGem9	string	outer	item

      /declare	BuffSpell10	string	outer	Taelosian Guard
      /declare	BuffSpellName10	string	outer	Emerald Ring of Blight
      /declare	BuffSpellGem10	string	outer	item

      /declare	BuffSpell11	string	outer	Aura of Taelosia
      /declare	BuffSpellName11	string	outer	Fingerbone Earring
      /declare	BuffSpellGem11	string	outer	item

      /declare	BuffSpell12	string	outer	Spikecoat
      /declare	BuffSpellName12	string	outer	Girdle of Living Thorns
      /declare	BuffSpellGem12	string	outer	item

|- This line clicks off Shroud of the Blightborn if it finds it in the buff bar.  I do this 
|   because for this set I am using Mental Horror and it will not overwrite Shroud of the Blightborn.
|   Therefore the Shroud of the Blightborn buff needs clicked off if it is there before I cast Mental Horror.
|   I leave it in here as an example of how to do this if you have the same need. Just Replace
|   "Shroud of the Blightborn Rk. III" in the two places it occurs on the line below with the spell 
|   you need removed. If this occurs for you but, not in another section, simply edit the spell 
|   name as described and move the below line to the bottom of the section that section you need the 
|   buff removed at.
|   If you do not have a need for this, You may comment this line out by putting a "|" in front of it.
      /if (${Me.Buff[Shroud of the Blightborn Rk. III].ID}) /nomodkey /notify BuffWindow buff${Math.Calc[${Me.Buff[Shroud of the Blightborn Rk. III].ID}-1].Int} leftmouseup

      /Call Start
   }

|- This is the start of the Solo buff section.    
  /if (${solo} || !${Raid.Member[${Me}].ID} && !${Group.Member[1].ID}) {
     /echo Starting buffs from the Solo set...

|- Solo buff section.
|  -This number represents how many buffs spells you will define for this section.  If you add or remove spells to this
      /declare	BuffSpells	int	outer	16

|- Here is where you define buff spells you want to use when you are solo or have passed the script
|   the "solo" parmeter.  This is a good section to use items or vendor purchased Potion Buffs that provide buffs you
|   can't get when you are not grouped such as Haste, Clarity, HP's etc.
|  -BuffSpellName1 is where you enter the name of the item or spell you wish to cast.
|  -BuffSpell1 is where you enter the name of the resulting icon in the buff bar.
|  -BuffSpellGem1 is where you enter the name of the Gem the spell is to be memorized in.  It is also used to define if a
|   alternate ability or item is used  to cast the spell.
|  -You may add or remove as many spells as you like.  Simply continue by adding new /declare statements and
|   changing the number at the end of the items declared (BuffSpell#", BuffSpellName#, BuffSpellGem#).
|  -If you add or remove spells don't forget to change the number that defines the amount of spells (referanced above).
|  -For spells the gem slot value is "gem${MemSlot}".  For items the value is "items" and for alternate abilities the
|   value is "alt".
      /declare	BuffSpell1	string	outer	Malarian Skin Rk. III 
      /declare	BuffSpellName1	string	outer	Malarian Skin Rk. III
      /declare	BuffSpellGem1	string	outer	gem${MemSlot} 

      /declare	BuffSpell2	string	outer	Shroud of the Blightborn Rk. III 
      /declare	BuffSpellName2	string	outer	Shroud of the Blightborn Rk. III 
      /declare	BuffSpellGem2	string	outer	gem${MemSlot}

      /declare	BuffSpell3	string	outer	Mindshear Horror Rk. III 
      /declare	BuffSpellName3	string	outer	Mindshear Horror Rk. III
      /declare	BuffSpellGem3	string	outer	gem${MemSlot} 

      /declare	BuffSpell4	string	outer	Drape of Korafax Rk. II 
      /declare	BuffSpellName4	string	outer	Drape of Korafax Rk. II
      /declare	BuffSpellGem4	string	outer	gem${MemSlot} 

      /declare	BuffSpell5	string	outer	Hateful Guard 
      /declare	BuffSpellName5	string	outer	Mask of Lament
      /declare	BuffSpellGem5	string	outer	item 

      /declare	BuffSpell6	string	outer	Form of Defense VI 
      /declare	BuffSpellName6	string	outer	Cold Iron Shield
      /declare	BuffSpellGem6	string	outer	item 

      /declare	BuffSpell7	string	outer	Familiar: Dragon Sage
      /declare	BuffSpellName7	string	outer	Fimiliar of Lord Nagafen
      /declare	BuffSpellGem7	string	outer	item

      /declare	BuffSpell8	string	outer	Storm Guard
      /declare	BuffSpellName8	string	outer	Stormeye Band
      /declare	BuffSpellGem8	string	outer	Item

      /declare	BuffSpell9	string	outer	Bobbing Corpse
      /declare	BuffSpellName9	string	outer	Shai`din Revenant Bauble
      /declare	BuffSpellGem9	string	outer	item

      /declare	BuffSpell10	string	outer	Taelosian Guard
      /declare	BuffSpellName10	string	outer	Emerald Ring of Blight
      /declare	BuffSpellGem10	string	outer	item

      /declare	BuffSpell11	string	outer	Aura of Taelosia
      /declare	BuffSpellName11	string	outer	Fingerbone Earring
      /declare	BuffSpellGem11	string	outer	item

      /declare	BuffSpell12	string	outer	Arch Shielding
      /declare	BuffSpellName12	string	outer	Tri-Plated Golden Hackle Hammer
      /declare	BuffSpellGem12	string	outer	item

      /declare	BuffSpell13	string	outer	Symbol of Vitality
      /declare	BuffSpellName13	string	outer	Orb of Duskmold
      /declare	BuffSpellGem13	string	outer	item

      /declare	BuffSpell14	string	outer	Twitching Speed
      /declare	BuffSpellName14	string	outer	Lizardscale Plated Girdle
      /declare	BuffSpellGem14	string	outer	item

      /declare	BuffSpell15	string	outer	Turtle Skin
      /declare	BuffSpellName15	string	outer	Lodizal Shell Boots
      /declare	BuffSpellGem15	string	outer	item

      /declare	BuffSpell16	string	outer	Elixir of Clarity XIV
      /declare	BuffSpellName16	string	outer	Distillate of Clarity XIV
      /declare	BuffSpellGem16	string	outer	item

      /Call Start
  }
/endmacro
/return
|-------------------------------------------------------------------------------- 
|Code: Start
|-------------------------------------------------------------------------------- 
Sub Start
   /squelch /target clear 
   /call CastBuffs
   /if (${CastPet}) {
      /echo Casting Pet...
      /call SummonPet
   } else /echo Not casting Pet.
   /echo Buffing Complete!
   /memspell ${MemSlot} "${DefaultGem}"
/endmacro

|-------------------------------------------------------------------------------- 
|Code: Cast Buffs 
|-------------------------------------------------------------------------------- 
Sub CastBuffs
   /for BuffSub 1 to ${BuffSpells} 
      /if (${Me.Buff[${BuffSpell${BuffSub}}].Duration}<2) { 
         /target Myself
         /call Cast "${BuffSpellName${BuffSub}}" ${BuffSpellGem${BuffSub}} 
      }
   /next BuffSub
/return

|-------------------------------------------------------------------------------- 
|Code: Cast Pet
|-------------------------------------------------------------------------------- 
Sub SummonPet
   /if (!${Me.Pet.ID}) {
      /call Cast "${PetSpell}" ${PetSpellGem}
      /pet Ghold
   }
   /if (!${Me.PetBuff[${PetBuff}]}) /call Cast "${PetBuffName}" ${PetBuffGem}

|- After casting the pet the script attempts to use the AA ability "Suspend Minion" then, cast the pet again.
|   if you do not have this ability or do not wish the script to do this comment out the following lines down to 
|   but not including "/return";
   /if (${Me.Pet.ID}) {
      /call Cast "Suspended Minion" alt
   }
   /if (!${Me.Pet.ID}) {
      /call Cast "${PetSpell}" ${PetSpellGem}
      /pet Ghold
   }
   /if (!${Me.PetBuff[${PetBuff}]}) /call Cast "${PetBuffName}" ${PetBuffGem}
/return