PetSummoner v1.2 by Vayeco Dynn (8/12/04)

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

Moderator: MacroQuest Developers

Vayeco Dynn
a ghoul
a ghoul
Posts: 113
Joined: Wed Aug 25, 2004 3:00 am

PetSummoner v1.2 by Vayeco Dynn (8/12/04)

Post by Vayeco Dynn » Sun Oct 10, 2004 10:06 pm

I saw a request for this. I already had the components for this together, so I decided to piece it into its own macro.

Summons and buffs a pet.

v1.2 :: Oct 12, 2004
- Removed remnants from the old macro this was in
- Ends when you run out of mana

v1.1 :: Oct 11, 2004
- Added fizzle support

Code: Select all

| Macro :        PetSummoner      |
| Created By:    Vayeco Dynn      |
| Release Date:  Oct 11, 2004     |
| Version:       1.1              |
| Filename:      PetSummmoner.mac |
|---------------------------------|

|----------------------------------------------------------------------|
| Usage:                                                               |
|                                                                      |
| Change RV_PetSpell in Sub Main to whatever your pet summon spell is. |
| Then, for all the buffs you want to use on him, write the following: |
| /call BuffPet "SPELLNAME"                                            |
| Some examples have already been provided. Make sure you save the     |
| file! To then summon and buff your pet, just use /macro PetSummoner  |
|----------------------------------------------------------------------|

#event Fizzle "Your spell fizzles!"
#event Fizzle "Your spell is interrupted."

|-------------------------------------------------------------------------------- 
|SUB: Main
|-------------------------------------------------------------------------------- 
Sub Main

   |:: Change RV_PetSpell to your pet spell ::|
   /declare RV_PetSpell    string outer   Restless Bones
   /declare RV_Fizzled     int outer      0

   /call SummonPet

   |:: Change these buffs to the buffs you want to use on your pet ::|
   /call BuffPet "Spirit Armor"
   /call BuffPet "Buff Numba 2"
   /call BuffPet "Etcetera"

/return

|-------------------------------------------------------------------------------- 
|SUB: Memorize A Spell
|-------------------------------------------------------------------------------- 
Sub MemSpell(int GemSlot, string SpellName)

   /if (!${Defined[GemSlot]} || !${Defined[SpellName]}) {
      /echo /call MemSpell [GemSlot] [SpellName] failed, parameters not given.
      /endmacro
   }

   /if (${Me.Gem[${SpellName}]} == ${GemSlot}) {
      /return
   }

   /if (${Me.Book[${SpellName}]}) {
      /echo Memorizing ${SpellName} into Gem ${GemSlot}
      /memspell ${GemSlot} "${SpellName}"
      /delay 5
      :MemWait
      /if (!${Me.Gem[${GemSlot}].ID}) {
         /delay 1
         /goto :MemWait
      }
   } else {
      /echo You do not have ${SpellName} memorized in your spell book.
      /endmacro
   }
    
/return

|-------------------------------------------------------------------------------- 
|SUB: Cast a Spell
|-------------------------------------------------------------------------------- 
Sub Cast(string SpellName)

   /if (!${Defined[SpellName]}) {
      /echo /call Cast [SpellName] failed, parameters not given.
      /endmacro
   }

   /if (!${Me.Gem[${SpellName}]}) {
      /call MemSpell 8 "${SpellName}"
   }

   /if (${Math.Calc[${Me.CurrentMana} - ${Me.Gem[${Me.Gem[${SpellName}]}].Mana}]} < 0) {
      /echo Not enough mana to cast! Ending macro.
      /endmacro
   }

   /if (${Me.State.NotEqual[STAND]}) {
      /echo Standing in order to cast...
      /stand
      /delay 5
   }

   /keypress forward

   :Recast
   /if (${Me.SpellReady[${SpellName}]}) {
      /echo Casting ${SpellName}...
      /cast "${SpellName}"
   } else {
      /delay 1
      /goto :Recast
   }

   :WaitForCast
   /if (${Me.Casting.ID}) {
      /delay 1
      /goto :WaitForCast
   }

   /delay 2
   /doevents

   /if (${RV_Fizzled}) {
      /varset RV_Fizzled 0
      /goto :Recast
   }

/return

|-------------------------------------------------------------------------------- 
|SUB: Cast On A Target
|-------------------------------------------------------------------------------- 
Sub CastOn(string SpellName)

   /if ((${Target.Distance} > ${Math.Calc[${Me.Gem[${Me.Gem[${SpellName}]}].Range} - 15]}) && (${Me.Gem[${Me.Gem[${SpellName}]}].Range} > 15)) {
      /call MoveToMob ${Math.Calc[${Me.Gem[${Me.Gem[${SpellName}]}].Range} - 15]}
   }
   /call Cast "${SpellName}"

/return

|-------------------------------------------------------------------------------- 
|SUB: Buff a Target
|-------------------------------------------------------------------------------- 
Sub Buff(string TargetName, string SpellName)

   /if (!${Defined[TargetName]} || !${Defined[SpellName]}) {
      /echo /call Buff [TargetName] [SpellName] failed, parameters not given.
      /endmacro
   }

   /if (!${Spawn[${TargetName}].ID}) {
      /echo ${TargetName} is an invalid buff target; it doesn't seem to exist.
      /return
   }

   /if (${Spawn[${TargetName}].Name.Equal[${Me}]}) {

      /if (!${Me.Buff[${SpellName}].ID}) {
         /echo Buffing myself...
         /target ${Me}
         /call CastOn "${SpellName}"
         /keypress esc
      }

   } else /if (${Spawn[${TargetName}].Name.Equal[${Me.Pet}]}) {

      /if (!${Me.PetBuff[${SpellName}]}) {
         /echo Buffing pet...
         /target ${Me.Pet}
         /call CastOn "${SpellName}"
         /keypress esc
      }

   } else {

      /echo Buffing ${TargetName}...
      /target ${TargetName}
      /call CastOn "${SpellName}"
      /keypress esc

   }

/return

|-------------------------------------------------------------------------------- 
|SUB: Summon Pet
|-------------------------------------------------------------------------------- 
Sub SummonPet

   /if (!${Me.Pet.ID}) {
      /echo Summoning a pet...
      /call Cast "${RV_PetSpell}"
   }

/return

|-------------------------------------------------------------------------------- 
|SUB: Buff Pet
|-------------------------------------------------------------------------------- 
Sub BuffPet(string SpellName)

   /call Buff ${Me.Pet} "${SpellName}"

/return

|-------------------------------------------------------------------------------- 
|SUB: Event :: Spell Fizzles
|--------------------------------------------------------------------------------
Sub Event_Fizzle

   /varset RV_Fizzled 1

/return

Vayeco Dynn
a ghoul
a ghoul
Posts: 113
Joined: Wed Aug 25, 2004 3:00 am

Post by Vayeco Dynn » Sat Oct 16, 2004 3:26 pm

Has anyone found this of use? It was requested, I figured some people would enjoy it...

Boredbard
a ghoul
a ghoul
Posts: 89
Joined: Thu Nov 27, 2003 11:49 am

Post by Boredbard » Sat Oct 16, 2004 11:37 pm

Its pretty cool, only think i might have done differently would be use an ini

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

Post by Night Hawk » Sun Oct 17, 2004 11:18 am

Why....
Just a waste of space. It's no different than opening th mac file.

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 » Sun Oct 17, 2004 12:07 pm

Only reason I can think of is for ease of use among multiple toons. I bot a lot of different toons and it would be a ton easier to have a bot ini for each of the pet casters I happen to bot. I use genbot pretty much exclusively for all my toons anyway, but I just thought I'd give the reason I saw.

Of course, I could always just make a modified mac and rename it for each toon I bot, but different strokes for different folks and all.
[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]

Longstone
a lesser mummy
a lesser mummy
Posts: 45
Joined: Sun Oct 10, 2004 3:06 pm

Post by Longstone » Mon Oct 18, 2004 10:01 pm

It's perfect thank you.

Vayeco Dynn
a ghoul
a ghoul
Posts: 113
Joined: Wed Aug 25, 2004 3:00 am

Post by Vayeco Dynn » Wed Oct 20, 2004 11:18 pm

Hmm I'll investigate the inc idea. Customizable ini file using toon names...

Boredbard
a ghoul
a ghoul
Posts: 89
Joined: Thu Nov 27, 2003 11:49 am

Post by Boredbard » Thu Oct 21, 2004 1:45 pm

Yeah, i'm looking at how Advbot does it, and thinking about adding alot of this code to my advbot so my mage summons and gears out his pet then goes back to the rest of the macro (when you give the bot a gearpet command or something).