Page 1 of 1

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

Posted: Sun Oct 10, 2004 10:06 pm
by Vayeco Dynn
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

Posted: Sat Oct 16, 2004 3:26 pm
by Vayeco Dynn
Has anyone found this of use? It was requested, I figured some people would enjoy it...

Posted: Sat Oct 16, 2004 11:37 pm
by Boredbard
Its pretty cool, only think i might have done differently would be use an ini

Posted: Sun Oct 17, 2004 11:18 am
by Night Hawk
Why....
Just a waste of space. It's no different than opening th mac file.

Posted: Sun Oct 17, 2004 12:07 pm
by A_Druid_00
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.

Posted: Mon Oct 18, 2004 10:01 pm
by Longstone
It's perfect thank you.

Posted: Wed Oct 20, 2004 11:18 pm
by Vayeco Dynn
Hmm I'll investigate the inc idea. Customizable ini file using toon names...

Posted: Thu Oct 21, 2004 1:45 pm
by Boredbard
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).