Updated Beastlord Assist Macro

Post your completed (working) macros here. Only for macros using MQ2Data syntax!

Moderator: MacroQuest Developers

gonemental21
orc pawn
orc pawn
Posts: 23
Joined: Fri Nov 26, 2004 9:31 am

Updated Beastlord Assist Macro

Post by gonemental21 » Thu May 26, 2005 12:37 am

Code: Select all

||assist.mac
|Beastlord Melee Nuke and Buff macro.
|version 2.2 by Gonemental
|
|Original code taken from rogue-assist.mac written by Grimjack
|Special Thanks to A_Druid_00 for the buffing section 
|
|Added Toggle commands
|Requires Mq2moveutils, Mq2Melee, and Mq2Cast plugins (Avaliable
|through Vip section. Yes that means you need to donate)
#turbo 20
|No casting while invisible
/declare noInvis int outer 1
#include assist.inc
|Events
#Event Pause "[MQ2] Pause#*#"
#Event Nuke "[MQ2] Nuke#*#"
#Event SelfBuffs "[MQ2] Selfbuffs#*#"
#Event PetBuffs "[MQ2] PetBuffs#*#"
#Event Outdoors "#*#You can only cast this spell in the outdoors.#*#"
#Event Zoned "#*#You have entered#*#" 
#Event Slow "[MQ2] Slow#*#"
#Event Debug "[MQ2] Debug#*#"
Sub Main 
/Echo Assist Macro Has Started
	/call Declares
	:Mainloop
	/doevents
	/if (!${Me.Combat} && ${OldTarget} && ${Me.CombatState.Equal[COOLDOWN]}) /varset OldTarget 0
	/if (${Me.Combat} && !${Pause}) {
		/if (${DoSlow}) /call Slowit
		/if (${Nuke}) /call Nuke
		/if (${DoHeal}) /call Healthcheck
		}
	/if (${Me.CombatState.Equal[ACTIVE]} && !${Me.Moving} || ${Me.Mount.ID} && ${Me.CombatState.Equal[RESTING]}) {
		/if (${SelfBuffs} && !${Pause} && ${Me.FreeBuffSlots}>1) /call CheckBuffs
		/if (${PetBuffs} && !${Pause}) /call PetBuffs
		}
	/delay 1s
	/goto :Mainloop
	/return
Sub Healthcheck 
	/declare MyTarget int local
	/if (${Me.Casting.ID} || ${Me.Moving}) /return
		/if (${Me.PctHPs}<=${HealPct} && ${Me.CurrentMana}>${Spell[${HealThingID}].Mana}) {
		/if (${Target.ID}) /varset MyTarget ${Target.ID}
		/target id ${Me.ID}
		/casting "${HealThing}" gem7
		/if (${MyTarget}) /target id ${MyTarget}
	}
	/delay 1s
	/return
Sub Nuke
	/declare n int local
	/for n 1 to ${Nuketotal}
		/if (${Me.PctMana}>${Nuketill} && ${Target.PctHPs}<=${Nukeat} && ${NukeTimer} && ${Me.SpellReady[${SpellNuke[${n}]}]}) {
		/echo Casting "${SpellNuke[${n}]}"
		/casting "${SpellNuke[${n}]}"
		}
	/varset NukeTimer 5s
	/delay 1s
	/next n
	/return
Sub Slowit
	/If ((${Debug})) /echo I Made it to the Slow Routine 
	/if (!${Target.ID} || ${Target.Type.Equal[NPC]}) {
	/If ((${Debug})) /echo Im Sure its no Tank
	:Slow_Loop
	/doevents
	/If (${Debug}) /echo ${Target.PctHPs}<=${SlowAt} && !${MobSlowed} && ${Target.ID}!=${OldTarget}) {
	/if (${Target.PctHPs}<=${SlowAt} && !${MobSlowed} && ${Target.ID}!=${OldTarget}) {
	/If (${Debug}) /echo Passed Slow Conditions 1
	/if (${Me.CurrentMana}<${Spell[${SlowSpellID}].Mana}) {
	/echo Shid ! I don't have mana to Slow ${Target.CleanName} 
			} else {
	/stick pause
	/If (${Debug}) /echo Passed Conditions Casting "${SpellSlow}" gem1 6s
	/casting "${SpellSlow}" gem4 6s 
         /if (${Cast.Return.Equal["CAST_INTERRUPTED"]}) /goto :Slow_Loop 
         /if (${Cast.Return.Equal["CAST_IMMUNE"]}) { 
            /echo *** ${Target.CleanName} is IMMUNE to my slow ! 
            /varset MobSlowed TRUE
            /stick unpause
            /varset OldTarget ${Target.ID) 
         } 
         /if (${Cast.Return.Equal["CAST_RESISTED"]}) { 
            /if (!${FastSlow}) { 
               /echo *** ${Target.CleanName} RESISTED slow ! Trying again asap 
                /goto :Slow_Loop 
             } 
            /varset MobSlowed TRUE
            /stick unpause
            /varset OldTarget ${Target.ID) 
          } 
         /if (${Cast.Return.Equal["CAST_SUCCESS"]}) {  
            /echo *** ${Target.CleanName} is SLOWED 
            /varset MobSlowed TRUE
            /stick unpause
            /varset OldTarget ${Target.ID)  
          } 

      } 
   } 
/delay 1s
/return 

Sub CheckBuffs 
/declare i        int local 
/declare a        int local 
/declare MyTarget int local 

  /for i 1 to ${SelfBuffTotal} 
  /If ((${Debug})) /echo Checking Me for (${Me.Buff[${SelfBuffIcon[${i}]}]})
  /if (${Me.Buff[${SelfBuffIcon[${i}]}].Duration}<10)  { 
    /for a 1 to 20 
    /If ((${Debug})) /echo Checking My Conditions
    /if (${SelfBuffBlock[${i}].Find[${Me.Buff[${a}].Spell}]} || ${NearestSpawn[NPC].Distance}<20) /goto :NextSelfBuff 
    /If ((${Debug})) /echo My Conditions Meet
    /next a 
    /if (!${Outdoors} && !${SelfBuffIndoors[${i}]}) /goto :NextSelfBuff 
    /varset MyTarget ${Target.ID} 
    /squelch /target myself 
    /if (${SelfBuffGem[${i}].Equal[item]}) { 
      /If (${Debug}) /echo Casting "${SelfBuff[${i}]}" item 1s
      /casting "${SelfBuff[${i}]}" item 1s 
    } else /if (${SelfBuffGem[${i}].Equal[alt]} && ${Me.AltAbilityReady[${SelfBuff[${i}]}]}) { 
      /If (${Debug}) /echo Casting "${SelfBuff[${i}]}" alt 1s
      /casting "${SelfBuff[${i}]}" alt 1s 
    } else /if (${Me.CurrentMana}>${Spell[${SelfBuffID[${i}]}].Mana}) { 
      /If (${Debug}) /echo Casting "${SelfBuff[${i}]}" ${SelfBuffGem[${i}]} 1s 
      /casting "${SelfBuffID[${i}]}"|${SelfBuffGem[${i}]} 1s    
    } 
    /target id ${MyTarget} 
  } 
  :NextSelfBuff 
  /doevents 
  /delay 2s
  /next i 
  
} 
/return 

Sub PetBuffs 

/declare i        int local 
/declare a        int local 
/declare MyTarget int local 

  |If we don't have pet, make one      
   /if ( !${Me.Pet.ID} && ${PetSummon}) { 
         /echo Creating new pet 
         /ban activate Pet
         /delay 3
         /casting "${PetSpellName}" gem9 
         /delay 10s 
         /target ${Me.Pet.Name} 
         /casting "Tiny Companion" gem7  
   } 
  /for i 1 to ${PetBuffTotal} 
  /If ((${Debug})) /echo Checking Pet for (!${Me.PetBuff[${PetBuffIcon[${i}]}]})
  /if (!${Me.PetBuff[${PetBuffIcon[${i}]}]})  {
   /for a 1 to 20 
    /If ((${Debug})) /echo Checking Pet Conditions
    /if (${PetBuffBlock[${i}].Find[${Me.PetBuff[${a}]}]} || ${NearestSpawn[NPC].Distance}<20) /goto :NextPetBuff 
    /If ((${Debug})) /echo Pet Conditions Meet
    /next a 
    /if (!${Outdoors} && ${PetBuffIndoors[${i}]}) /goto :NextPetBuff 
    /varset MyTarget ${Target.ID} 
    /squelch /target ${Me.Pet.Name} 
    /if (${PetBuffGem[${i}].Equal[item]}) { 
      /echo Casting "${PetBuff[${i}]}" item 1s
      /casting "${PetBuff[${i}]}" item 1s 
    } else /if (${PetBuffGem[${i}].Equal[alt]} && ${Me.AltAbilityReady[${PetBuff[${i}]}]}) { 
      /echo Casting "${PetBuff[${i}]}" alt 1s
      /casting "${PetBuff[${i}]}" alt 1s 
    } else /if (${Me.CurrentMana}>${Spell[${PetBuffID[${i}]}].Mana}) { 
      /echo Casting "${PetBuffID[${i}]}" ${PetBuffGem[${i}]} 1s
      /casting "${PetBuffID[${i}]}" ${PetBuffGem[${i}]} 1s 
    } 
    /target id ${MyTarget} 
  } 
  :NextPetBuff 
  /doevents 
  /delay 3s
  /next i 
  
} 
/return 


Sub Event_Pause 
/if (${Pause}) { 
  /echo Macro is no longer Paused 
  /varset Pause 0 
} else { 
  /echo Macro is now Paused 
  /varset Pause 1 
} 
/return 

        
Sub Event_Nuke 
/if (!${Nuke}) { 
 /echo Ice bombs Inc 
  /varset Nuke 1 
} else { 
/echo NO Nukes 
  /varset Nuke 0 
} 
/return 

Sub Event_SelfBuffs 
/if (!${SelfBuffs}) { 
  /echo Self Buffing Now 
  /varset SelfBuffs 1 
} else { 
  /echo Buffs on Hold 
  /varset SelfBuffs 0 
} 
/return 

Sub Event_PetBuffs 
/if (!${PetBuffs}) { 
  /echo Buffing Pet Now 
  /varset PetBuffs 1 
} else { 
  /echo Pet Buffs on Hold 
  /varset PetBuffs 0 
} 
/return 

Sub Event_Debug 
/if (!${Debug}) { 
  /echo I love Spam!! Debuggin Now
  /varset Debug 1 
} else { 
  /echo No more Spam!! Debuggin Off 
  /varset Debug 0 
} 
/return 

Sub Event_Outdoors 
   /varset Outdoors FALSE 
   /echo setting outdoors False 
/return 

Sub Event_Zoned 
  /varset Outdoors TRUE 
  /echo setting outdoors True 
/return 

Sub Event_Slow 
/if (!${DoSlow}) { 
    /echo Now Casting Slow 
  /varset DoSlow 1 
} else { 
   /echo No Longer Casting Slow 
  /varset DoSlow 0 
} 
/return 
Last edited by gonemental21 on Fri Sep 29, 2006 12:02 am, edited 15 times in total.

gonemental21
orc pawn
orc pawn
Posts: 23
Joined: Fri Nov 26, 2004 9:31 am

Post by gonemental21 » Thu May 26, 2005 12:38 am

Save this as Assist.inc on the same folder with macro

Code: Select all

Sub Declares 
|Alias's
/squelch /alias /pause		/echo Pause 
/squelch /alias /Nuke		/echo Nuke 
/squelch /alias /Selfbuffs	/echo Selfbuffs 
/squelch /alias /Petbuffs	/echo PetBuffs  
/squelch /alias /slow		/echo slow
/squelch /alias /debug		/echo debug

|Selfbuff 
   /declare SelfBuffTotal int outer 
   /declare SelfBuffs bool outer 
   /declare SelfBuffBlock[7] string outer 
   /declare SelfBuffIndoors[7] bool outer 
   /declare SelfBuffGem[7] string outer 
   /declare SelfBuffIcon[7] string outer 
   /declare SelfBuff[7] string outer 
   /declare SelfBuffID[7] int outer 
|Petbuff 
   /declare PetBuffTotal int outer 
   /declare PetBuffs bool outer 
   /declare PetBuffCount[7] bool outer 
   /declare PetBuffBlock[7] string outer 
   /declare PetBuffIndoors[7] bool outer 
   /declare PetBuffGem[7] string outer 
   /declare PetBuffIcon[7] string outer 
   /declare PetBuff[7] string outer 
   /declare PetBuffID[7]      int outer 
   /declare PetSpellName string outer 
   /declare PetSummon bool outer 
|MISC 
   /declare Outdoors bool outer 
   /declare Pause bool outer
   /declare DoHeal bool outer
   /declare HealGem string outer 
   /declare HealPct int outer 
   /declare HealThingID outer
   /declare HealThing string outer
   /declare Debug int outer  
|NUKE
   /declare Nuke outer 
   /declare Nuketill outer
   /declare Nuketotal int outer
   /declare Nukeat string outer
   /declare SpellNuke[3] string outer
   /declare NukeTimer timer outer 
|Slow    
   /declare DoSlow bool outer
   /declare SpellSlow string outer
   /declare SlowSpellID int outer
   /declare OldTarget int outer
   /declare MobSlowed bool outer
   /declare SlowAt int outer
   
| 1=True=ON 0=False=OFF 
|-------------------------------------- 
|Edit this if you would like to Nuke 
   /varset Nuke 1 
   /varset Nuketill 50 
   /varset SpellNuke[2] Frost Spear
   /varset SpellNuke[1] Glacier Spear
   /varset SpellNuke[3] Trushar's Frost
   /varset Nukeat 90 
   /varset Nuketotal 3 
|Edit this if you would like to buff 
   /varset SelfBuffs 0 
   /varset PetBuffs 0 
   /varset PetBuffTotal 7 
   /varset PetSummon 1 
   /varset SelfBuffTotal 7
|Edit this to Enable Slow
   /varset DoSlow 0
   /varset SpellSlow Sha's Revenge
   /varset OldTarget 0 
   /varset SlowAt 100
   /varset MobSlowed FALSE
|Edit this to change autoheal 
   /varset DoHeal 1 
   /varset HealThing Muada's Mending 
   /varset HealGem gem3 
   /varset HealPct 50
|Misc
   /varset Pause 0 
   /varset Outdoors 1
   /varset Debug 0 
|---------------------------------------  

| Buffs 
/varset SelfBuff[1] Spiritual Ascendance 
/varset SelfBuffIcon[1] Spiritual Ascendance 
/varset SelfBuffGem[1] gem8 
/varset SelfBuffIndoors[1] 1 
/varset SelfBuffBlock[1] "" 
/varset SelfBuff[2] Ferocity of Irionu 
/varset SelfBuffIcon[2] Ferocity of Irionu 
/varset SelfBuffGem[2] gem6 
/varset SelfBuffIndoors[2] 1 
/varset SelfBuffBlock[2] "" 
/varset SelfBuff[3] Infusion of Spirit 
/varset SelfBuffIcon[3] Infusion of Spirit 
/varset SelfBuffGem[3] gem9 
/varset SelfBuffIndoors[3] 1 
/varset SelfBuffBlock[3] Focus of the Seventh|Focus of Soul|Wunshi's Focusing|Talisman of Wunshi 
/varset SelfBuff[4] Spiritual Vitality 
/varset SelfBuffIcon[4] Spiritual Vitality 
/varset SelfBuffGem[4] gem9 
/varset SelfBuffIndoors[4] 1 
/varset SelfBuffBlock[4] Brell's Stalwart Shield|Howl of the Predator|Brell's Brawny Bulwark 
/varset SelfBuff[5] Focus of Alladnu 
/varset SelfBuffIcon[5] Focus of Alladnu 
/varset SelfBuffGem[5] gem9 
/varset SelfBuffIndoors[5] 1 
/varset SelfBuffBlock[5] Focus of the Seventh|Focus of Soul|Wunshi's Focusing|Talisman of Wunshi 
/varset SelfBuff[6] Celerity
/varset SelfBuffIcon[6] Celerity
/varset SelfBuffGem[6] gem9 
/varset SelfBuffIndoors[6] 1 
/varset SelfBuffBlock[6] Vallon's Quickening|Speed of Salik|Hastening of Salik 
/varset SelfBuff[7] Feral Vigor 
/varset SelfBuffIcon[7] Feral Vigor 
/varset SelfBuffGem[7] gem9 
/varset SelfBuffIndoors[7] 1 
/varset SelfBuffBlock[7] Replenishment|Blessing of Replenishment 
|-------------------------------- 
|Pet Buff Stuff 
/varset PetSpellName Spirit of Rashara 
/varset PetBuff[1] Growl of the Beast 
/varset PetBuffIcon[1] Growl of the Beast 
/varset PetBuffGem[1] gem9 
/varset PetBuffIndoors[1] 1 
/varset PetBuffBlock[1] "" 
/varset PetBuff[2] Spirit of Irionu 
/varset PetBuffIcon[2] Spirit of Irionu 
/varset PetBuffGem[2] gem9 
/varset PetBuffIndoors[2] 1 
/varset PetBuffBlock[2] "" 
/varset PetBuff[3] Infusion of Spirit 
/varset PetBuffIcon[3] Infusion of Spirit 
/varset PetBuffGem[3] gem9 
/varset PetBuffIndoors[3] 1 
/varset PetBuffBlock[3] Focus of the Seventh|Focus of Soul|Wunshi`s Focusing|Talisman of Wunshi 
/varset PetBuff[4] Focus of Alladnu 
/varset PetBuffIcon[4] Focus of Alladnu 
/varset PetBuffGem[4] gem9 
/varset PetBuffIndoors[4] 1 
/varset PetBuffBlock[4] Focus of the Seventh|Focus of Soul|Wunshi`s Focusing|Talisman of Wunshi 
/varset PetBuff[5] Spirit of Wolf 
/varset PetBuffIcon[5] Spirit of Wolf 
/varset PetBuffGem[5] gem9 
/varset PetBuffIndoors[5] 1 
/varset PetBuffBlock[5] Spirit of Eagle|Flight of Eagles 
/varset PetBuff[6] Hobble of Spirits 
/varset PetBuffIcon[6] Hobble of Spirits 
/varset PetBuffGem[6] alt 
/varset PetBuffIndoors[6] 1 
/varset PetBuffBlock[6] "" 
/varset PetBuff[7] Savage Lord's Totem 
/varset PetBuffIcon[7] Savage Wildcaller's Blessing 
/varset PetBuffGem[7] item 
/varset PetBuffIndoors[7] 1 
/varset PetBuffBlock[7] "" 

|SelfBuffIDS 
/declare i int local 

/if (${SelfBuffTotal}) { 
  /for i 1 to ${SelfBuffTotal} 
  /if (${SelfBuffGem[${i}].Equal[item]}) { 
    /varset SelfBuffID[${i}] ${Spell[${SelfBuffIcon[${i}]}].ID} 
  } else /if (${SelfBuffGem[${i}].Equal[alt]}) { 
    /varset SelfBuffID[${i}] ${Spell[${SelfBuffIcon[${i}]}].ID} 
  } else /varset SelfBuffID[${i}] ${Me.Book[${Me.Book[${SelfBuffIcon[${i}]}]}].ID} 
  /next i 
} 
/if (${PetBuffTotal}) { 
  /for i 1 to ${PetBuffTotal} 
  /if (${PetBuffGem[${i}].Equal[item]}) { 
    /varset PetBuffID[${i}] ${Spell[${PetBuffIcon[${i}]}].ID} 
  } else /if (${PetBuffGem[${i}].Equal[alt]}) { 
    /varset PetBuffID[${i}] ${Spell[${PetBuffIcon[${i}]}].ID} 
  } else /varset PetBuffID[${i}] ${Me.Book[${Me.Book[${PetBuffIcon[${i}]}]}].ID} 
  /next i 
} 
/varset SlowSpellID ${Me.Book[${Me.Book[${SpellSlow}]}].ID}
/varset HealThingID ${Me.Book[${Me.Book[${HealThing}]}].ID}  

/return 
Last edited by gonemental21 on Fri Sep 29, 2006 12:00 am, edited 7 times in total.

A_Druid_00
Macro Maker Extraordinaire
Posts: 2378
Joined: Tue Jul 13, 2004 12:45 pm
Location: Rolling on the Lawn Farting

Post by A_Druid_00 » Thu May 26, 2005 8:34 am

Good stuff man, I hated seeing all the work I put into my buffing setup being underutilized. The stacking and buff counting additions to the routine makes dealing with situations where a lot of buffs are flying around a LOT easier. That, and the indoor code makes it possible to put SoW into your buff routine without spamming yourself indoors.

Just noticed though, your indoors flag will never get set. You need events to trigger the indoor flag, and an indoors variable to toggle when the event fires. I made an Event_Zoned flag to reset the indoor flag to outdoors every time I zoned as well. I tried using the zone type as a solid indicator as to whether mounts/lev/sow were allowed instead of event driven, but I never was quite able to figure out what each zone type corresponded to since it returned just an integer.
[quote]<DigitalMocking> man, A_Druid_00 really does love those long ass if statements
<dont_know_at_all> i don't use his macro because i'm frightened of it[/quote]
[quote][12:45] <dont_know_at_all> never use a macro when you can really fuck up things with a plugin[/quote]

Teh_Hidden
a lesser mummy
a lesser mummy
Posts: 43
Joined: Wed Mar 16, 2005 12:42 am

Post by Teh_Hidden » Thu May 26, 2005 10:41 am

Or you could set the macro to cast jboots/sow/whatever immediately on zonein, then add a custom event to varset the indoor/outdoor depending on whether the result is that the zone is indoors, or the spell lands.

Perhaps make A_Druid_00's Event_Zoned, then have that activate the jboots/sow/whatever, which would in turn activate the event I described above.

A_Druid_00
Macro Maker Extraordinaire
Posts: 2378
Joined: Tue Jul 13, 2004 12:45 pm
Location: Rolling on the Lawn Farting

Post by A_Druid_00 » Thu May 26, 2005 11:01 am

You'd still need to define all the events for indoors zones in that system anyway. The only thing that you'd do is set the indoor/outdoor flag immediately after zoning instead of when the buff wears off. I just opted to do it when the buff is about to fade.

You say toe-may-toe, I say toe-mah-toe
[quote]<DigitalMocking> man, A_Druid_00 really does love those long ass if statements
<dont_know_at_all> i don't use his macro because i'm frightened of it[/quote]
[quote][12:45] <dont_know_at_all> never use a macro when you can really fuck up things with a plugin[/quote]

DigitalMocking
a grimling bloodguard
a grimling bloodguard
Posts: 620
Joined: Mon Apr 04, 2005 5:53 pm

Post by DigitalMocking » Thu May 26, 2005 12:03 pm

Here's a simple indoor/outdoor setup I use for the bard:

Code: Select all

#Event Outdoors    "#*#You can only cast this spell in the outdoors#*#"
#Event Zoned       "#*#You have entered#*#"

Code: Select all

/declare  Outside                outer TRUE

Code: Select all

Sub Event_Outdoors
  /if (${FollowingTank})  { 
    /if (${Me.Gem[${Invis}]} && ${Me.Gem[${Invis}]}!=${InvisGem}) {
      /varset gemnum ${Me.Gem[${Invis}]}
      /notify SpellBookWnd SBW_Spell${gemnum} rightmouseup
      /memspell ${InvisGem} ${Invis}
      /delay 30
    }
    /if (!${Me.Gem[${Invis}]}) {
      /memspell ${InvisGem} ${Invis}
      /delay 30
    }
  }
  /squelch /twist ${InvisGem}
  /varset Outside FALSE
/return

Code: Select all

Sub Event_Zoned
  /varset Outside TRUE
  /call MemSpells
  /varset JustZoned TRUE
  /if (${FollowingTank}) {
    :followtank
    /squelch /target ${tankname}
    /if (!{Target.Name.Equal[${tankname}]) /goto :followtank
    /squelch /stick 20
    /squelch /twist ${TravelGem}
  }
}
/return

A_Druid_00
Macro Maker Extraordinaire
Posts: 2378
Joined: Tue Jul 13, 2004 12:45 pm
Location: Rolling on the Lawn Farting

Post by A_Druid_00 » Thu May 26, 2005 1:07 pm

There's a couple more messages you get indoors besides "You can only cast this spell in the outdoors". But yeah, that's the gist.

I was always more partial to using 1 and 0 as my TRUE and FALSE statements too, but that's just me. Never liked assigning a string for a value that only has 2 logical possibilities.
[quote]<DigitalMocking> man, A_Druid_00 really does love those long ass if statements
<dont_know_at_all> i don't use his macro because i'm frightened of it[/quote]
[quote][12:45] <dont_know_at_all> never use a macro when you can really fuck up things with a plugin[/quote]

gonemental21
orc pawn
orc pawn
Posts: 23
Joined: Fri Nov 26, 2004 9:31 am

Update

Post by gonemental21 » Fri May 27, 2005 11:19 am

Im working on setting up Pet summoning and Pet buffing next. I want to test it over weekend and will post it Tuesday.

User avatar
fearless
Not a Psychic
Posts: 2684
Joined: Wed Mar 10, 2004 3:52 pm

Post by fearless » Fri May 27, 2005 12:06 pm

Code: Select all

/declare PetSummon outer 1
/declare PetSpell outer Bstlord Pet
/declare PetBuff1 outer Bstlord Pet 1
/declare PetBuff2 outer Bstlord Pet 2
/declare PetBuff3 outer Bstlord Pet 3
/declare PetBuffGem outer gem8

Sub Main
:Foreverloop
  /if ( !${Me.Combat} && ${NearestSpawn[NPC].Distance}>70 ) /call PetCheck
  /delay 3
/goto :Foreverloop
/end

Sub PetCheck
  /if ( ${PetSummon}==1 && !${Me.Pet.ID} ) {
    /if ( ${Spell["${PetSpell}"].Mana} < ${Me.CurrentMana} ) {
      /call cast "${PetSpell}" ${PetBuffGem}
    }
  }

  /if ( ${Me.Pet.ID} && !${Me.PetBuff["${PetBuff1}"]} && ${Me.Pet.Distance}<100 ) {
    /if ( ${Spell["${PetBuff1}"].Mana} < ${Me.CurrentMana} ) {
      /call cast "${PetBuff1}" ${PetBuffGem}
    }
  }

  /if ( ${Me.Pet.ID} && !${Me.PetBuff["${PetBuff2}"]} && ${Me.Pet.Distance}<100 ) {
    /if ( ${Spell["${PetBuff2}"].Mana} < ${Me.CurrentMana} ) {
      /call cast "${PetBuff2}" ${PetBuffGem}
    }
  }

  /if ( ${Me.Pet.ID} && !${Me.PetBuff["${PetBuff2}"]} && ${Me.Pet.Distance}<100 ) {
    /if ( ${Spell["${PetBuff2}"].Mana} < ${Me.CurrentMana} ) {
      /call cast "${PetBuff2}" ${PetBuffGem}
    }
  }

/return
Reading . . . it's not just for me.

[url=http://www.catb.org/~esr/faqs/smart-questions.html]How To Ask Questions The Smart Way[/url]
[quote="Ccomp5950"]Fearless showed me the light, you too shall learn.[/quote]

A_Druid_00
Macro Maker Extraordinaire
Posts: 2378
Joined: Tue Jul 13, 2004 12:45 pm
Location: Rolling on the Lawn Farting

Post by A_Druid_00 » Fri May 27, 2005 12:49 pm

Code: Select all

/declare PetSummon outer 1 
/declare PetSpell outer Bstlord Pet
/declare PetSpellGem outer gem8
/declare PetBuff[3] outer
/declare PetBuffGem[3] outer

/varset PetBuff[1] BlahBlah
/varset PetBuffGem[1] gem1
etc
etc

Sub Main 
:Foreverloop 
  /if ( !${Me.Combat} && ${NearestSpawn[NPC].Distance}>70 ) /call PetCheck 
  /delay 3 
/goto :Foreverloop 
/end 

Sub PetCheck 
  /if ( ${PetSummon}==1 && !${Me.Pet.ID} ) { 
    /if ( ${Spell["${PetSpell}"].Mana} < ${Me.CurrentMana} ) { 
      /call cast "${PetSpell}" ${PetBuffGem} 
    } 
  } 
/for i 1 to 3
  /if ( ${Me.Pet.ID} && !${Me.PetBuff["${PetBuff[${i}]"]} && ${Me.Pet.Distance}<100 ) { 
    /if ( ${Spell["${PetBuff[${i}]}"].Mana} < ${Me.CurrentMana} ) { 
      /call cast "${PetBuff[${i}]}" ${PetBuffGem[${i}]} 
    } 
  } 
/next i
/return
Of course, I'd probably also reference the Me.CurrentMana check against the Pet Buff ID in an array instead of the spell name, but you get my drift. I'd proably add the Pet Buffing portion to the Self Buff checking Sub as well, maybe even the pet summoning portion as well.
[quote]<DigitalMocking> man, A_Druid_00 really does love those long ass if statements
<dont_know_at_all> i don't use his macro because i'm frightened of it[/quote]
[quote][12:45] <dont_know_at_all> never use a macro when you can really fuck up things with a plugin[/quote]

gonemental21
orc pawn
orc pawn
Posts: 23
Joined: Fri Nov 26, 2004 9:31 am

New Stuff

Post by gonemental21 » Wed Jun 01, 2005 11:46 pm

This is what I have so far. Worked fine last night. Let me know if you have any problems.
Thanks for the code and the help Fearless and A_Druid_00

A_Druid_00
Macro Maker Extraordinaire
Posts: 2378
Joined: Tue Jul 13, 2004 12:45 pm
Location: Rolling on the Lawn Farting

Post by A_Druid_00 » Thu Jun 02, 2005 8:05 am

Minor peeve, but a few of your sections are doing the same function on multiple lines, like your healthcheck sub. If you're going to /return for multiple conditions, use an OR statement and condense it to one line like so:

Code: Select all

Sub Healthcheck 
   /if (!${DoHeal} || ${Me.Casting.ID} || ${Me.Moving}) /return 
   /if (${Me.PctHPs}<=90) { 
      /if (${Me.Combat}) { 
         /if (!${Target.ID}) { 
            /delay 5s 
            /cast "${HealThing}" 
         } 
      } 
   } 
/return 
I still don't think this code will ever work, even after this change, because it looks like you'll only heal if you're in combat and have no target. I'd suggest something like:

Code: Select all

/declare HealGem string outer
/declare HealPct int outer
/declare HealThingID int outer
/varset HealThingID ${Me.Book[${Me.Book[${HealThing}]}].ID}

Sub Healthcheck
/declare MyTarget int local

/if (!${DoHeal} || ${Me.Casting.ID} || ${Me.Moving}) /return 
/if (${Me.PctHPs}<=${HealPct} && ${Me.CurrentMana}>${Spell[${HealThingID}].Mana}) { 
   /if (${Target.ID}) /varset MyTarget ${Target.ID}
   /target id ${Me.ID}
   /call Cast "${HealThing}" ${HealGem}
   /if (${MyTarget}) /target id ${MyTarget}
} 
/return 
Now it will only cast if you have healing turned on, you aren't casting, you aren't moving, your HPs are below the HealPct, and you have enough mana to cast the heal. It will also store your current target local (if you have one) and re-target it after you cast your heal. Yeah, I know, I rule.

Also, you still aren't setting your spell IDs for your buffs, etc. You have them declared, but since they never get set, your macro thinks the mana cost for each spell is 0, since it's NULL. Look at the /varset HealSpellID line I have above. You need to do something like that for every buff/spell you declare an ID for. The easiest way is with a /for loop that sets it to ${Me.Book[${Me.Book[${SelfBuffIcon[${i}]}]}].ID}. Look at the SelfBuffID section of RaidDruid to see how I have it set up to set the ID based on whether it's a spell, alt, or item.

I know it seems like a lot of trouble to go through for somthing so trivial, but you'll thank me when you're oom and trying to chain cast buffs on yourself after a rez. Using the spell ID is the best way to go, or you'll be kicking youself in the ass when you get a spell that has the exact same name as a mob AE, like I did with Glacier Breath. Well that, and it's presumably a faster lookup.
[quote]<DigitalMocking> man, A_Druid_00 really does love those long ass if statements
<dont_know_at_all> i don't use his macro because i'm frightened of it[/quote]
[quote][12:45] <dont_know_at_all> never use a macro when you can really fuck up things with a plugin[/quote]

User avatar
Night Hawk
a grimling bloodguard
a grimling bloodguard
Posts: 590
Joined: Fri Aug 13, 2004 4:56 pm

Post by Night Hawk » Thu Jun 02, 2005 11:21 am

gonemental21 wrote:Im working on setting up Pet summoning and Pet buffing next. I want to test it over weekend and will post it Tuesday.
You should check out this snippet:
http://macroquest2.com/phpBB2/viewtopic.php?t=9903

Works great for me ;)

A_Druid_00
Macro Maker Extraordinaire
Posts: 2378
Joined: Tue Jul 13, 2004 12:45 pm
Location: Rolling on the Lawn Farting

Post by A_Druid_00 » Thu Jun 02, 2005 12:32 pm

I never did quite get the hang of that inc, I suck :?
[quote]<DigitalMocking> man, A_Druid_00 really does love those long ass if statements
<dont_know_at_all> i don't use his macro because i'm frightened of it[/quote]
[quote][12:45] <dont_know_at_all> never use a macro when you can really fuck up things with a plugin[/quote]

Clueless
a hill giant
a hill giant
Posts: 163
Joined: Fri Jun 03, 2005 2:36 pm

Post by Clueless » Fri Jun 03, 2005 2:40 pm

What is the trigger for combat?

I have him in a group with a tank and a healer. I activated the macro and he started buffing himself, created a pet all no problem. I just can't seem to get him to take notice of the mobs the MT pulls into camp. I see a reference in "main" for HP % but we passed that on all the mobs without it triggering anything. I know I am missing something simple but can't figure it out.

P.S. MQ2 can't seem to find Arag's Celerity in the spell book. I replaced all the spells listed and changed the number of pet buffs with no problem. I can put any lower level pet haste spell in that same spot and it works great. I copied and pasted Arag's Celelrity and insured case was right and still get the "spell not found in your spellbook" error