Mage Pet Equipping Macro

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

Moderator: MacroQuest Developers

Gnits
a snow griffon
a snow griffon
Posts: 371
Joined: Fri Jun 03, 2005 7:56 pm

Mage Pet Equipping Macro

Post by Gnits » Mon Jul 11, 2005 6:37 am

After having loved the wait4rez.mac that was created here, i got to thinking what else would i do after a rez and created a second macro to be called (optionally from that) that would bring my magician pet up from the ground up.

(Shout outs to that auther and the author of the 'another mage auto macro', though i didnt go back and check their names at this moment and finally the author of swapcast which enabled me a more effective means to get the toys out of my inventory every time.)

This macro needs the spell_routines.inc.

Code: Select all


| ------------- Startup new pet after rez --------------
| 1) Click rod (checks rod for existance, if not casts it and inventories it)
| 2) Summon Pet
| 3) Click Mana regen buffs
| 4) wait 30seconds
| 5) Cast Pet Toys
| 6) Give toys to pet

#include spell_routines.inc

Sub RezNewPet
  /call ClickRodWithCheck
  /call SumPet
  /call cast "Elemental Simulcram"
  /delay 55
  /memspell 9 "Phantom Shield"
  /delay 25
  /call cast "Phantom Shield"
  /delay 65
  /call EquipPet
  /call cast "Symbol of Ancient Summoning" item
  /delay 35
  /call cast "Symbol of Ancient Summoning" item
  /delay 35
  /call cast  "Elemental Fury"
  /delay 53
  /call cast "Staff of Elemental Essence" item
  /delay 10
  /loadspells "Raid Pet - Fire"

/return

Sub SumPet 
  /echo Summoning a pet to kill with!!
  /memspell 8 "Child of Water"
  /delay 15
  /call cast "Child of Water" 
/return 

Sub ClickRodWithCheck	
  :nolookingatself
  /target myself
  /delay 8
  /if (${FindItem[${item}].InvSlot}==0) { 
  /call cast "Magi`kot's Pants of Convergence" item 
  /delay 2 
  /autoinv 
  } 
  /call cast "Rod of Mystical Transvergance" item 
 
 
/return 

Sub EquipPet

|
|  Summon the toys and inventory
|

  /loadspell "Pet Toys - Staves"
  /delay 65
  /call cast "Summon Crystal Belt"
  /delay 62
  /autoinv
  /call cast "Summon Staff of the North Wind"
  /delay 62
  /autoinv
  /call cast "Summon Staff of the North Wind"
  /delay 62
  /autoinv
  /call cast "Muzzle of Mardu"
  /delay 62
  /autoinv
  
|
|   Give toys to pet
|
  /target ${Me.Pet}
  /delay 4
  /Call GetItem "Crystal Belt"
| Open Trade window with pet
:opentrade
  /click left target
  /delay 4
  /if (!${Window[GiveWnd].Open}) /goto :opentrade


  /Call GetItem "North Wind"
  /notify GiveWnd GVW_MyItemSlot1 leftmouseup
  /delay 8 

  /Call GetItem "North Wind"
  /notify GiveWnd GVW_MyItemSlot2 leftmouseup
  /delay 8 

  /Call GetItem "Muzzle"
  /notify GiveWnd GVW_MyItemSlot3 leftmouseup
  /delay 8 

  /notify GiveWnd GVW_Give_Button leftmouseup
  /return



Sub WaitCursor(slot, pack) 
   /declare item local 
   /declare timeout timer 5 
   /varset item ${Cursor.ID} 
   /if (${Defined[pack]}) /goto :waitloop2 
   :waitloop1
      /echo Waitloop1 ${slot} ${pack}
      /nomod /itemnotify ${slot} leftmouseup 
      /if ((${item} == ${Cursor.ID}) && (${timeout} > 0)) /goto :waitloop1 
      /goto :donewaiting 
   :waitloop2
      |/Echo Waitloop2 ${slot} ${pack}
      /nomod /itemnotify in ${pack} ${slot} leftmouseup 
      /if ((${item} == ${Cursor.ID}) && (${timeout} > 0)) /goto :waitloop2 
   :donewaiting 
/return 

Sub GetItem(item, equipslot) 
   /declare inventoryslot int local 
   /declare pack local 
   /declare packslot int local 
   /declare leaveopen int local 0 
   /declare packnumber int local 0 
   /declare leavetwisting int local 0 

   /varset inventoryslot ${FindItem[${item}].InvSlot} 
   /if (!${inventoryslot}) /goto :notfound
 
   :packcountloop
   /if (${inventoryslot}>250 && ${inventoryslot}<331) { 
      /varset packnumber ${Math.Calc[${packnumber}+1]} 
      /varset inventoryslot ${Math.Calc[${inventoryslot}-10]} 
      /goto :packcountloop 
      } 
   /if (${packnumber} > 0) { 
      /varset pack pack${packnumber} 
      /varset packslot ${Math.Calc[${inventoryslot}-240]} 
      /goto :foundit 
      } 

   :notinpack 
      /goto :end 

   :foundit 
      /echo Found IT '${FindItem[${item}].Name}'
      /if (!${Window[${pack}].Open}) { 
         /nomod /itemnotify ${pack} rightmouseup 
         /varset leaveopen 0 
         } 

      /call WaitCursor ${packslot} ${pack} 
      /goto :end 
   :notfound 
      /echo ${item} not found in inventory. 
   :end
   /if (${leaveopen} == 0) /nomod /itemnotify ${pack} rightmouseup
/return

As for the wait4rez.mac

I added 2 lines to it complete the process.

Changed:

Code: Select all

#include magefunctions.inc

sub main(pet)
And added JUST before the termination of the macro

Code: Select all

   /if (${pet.Equal[pet]}) /call RezNewPet
This assumes that you already have elemental simulcram memmed. As it takes 45 seconds to recycle you would need it memmed quickly after a death. This is another modification to wait4rez i made before i got to creating this one. I tested the macro under full mana conditions and will be checking it (hopefully not too soon) under newly rez conditions.

this way either i run (/mac rez) or i run (/mac rez pet) depending on which i want to do. More automation to come as i add other mage specific features.

ToDo:
1) Automated Malo without other actions (one that keeps trying til its done, THEN announces it).

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

Post by Teh_Hidden » Mon Jul 11, 2005 11:14 pm

Maybe I missed it, as I was scrolling through quickly...but where is your "Sub Main"?

This looks like a nice snippet, but needs to be adjusted slightly to make it a macro!

Code: Select all


Sub Main
  /call ClickRodWithCheck
  /call SumPet
  /call cast "Elemental Simulcram"
  /delay 55
  /memspell 9 "Phantom Shield"
  /delay 25
  /call cast "Phantom Shield"
  /delay 65
  /call EquipPet
  /call cast "Symbol of Ancient Summoning" item
  /delay 35
  /call cast "Symbol of Ancient Summoning" item
  /delay 35
  /call cast  "Elemental Fury"
  /delay 53
  /call cast "Staff of Elemental Essence" item
  /delay 10
  /loadspells "Raid Pet - Fire"

/return
Also, I may be wierd like this, but I prefer to have all of the stuff where you are casting in what would be your main sub to different subs. I've found that it can make the code easier to follow, easier to error check, and easier to modify. Again, my personal preference. But here's how I'd add it:

Code: Select all


Sub Main
  /call ClickRodWithCheck
  /call SumPet
  /call Spells1
  /call EquipPet
  /loadspells "Raid Pet - Fire"

/return

Sub Spells1
  /call cast "Elemental Simulcram"
  /delay 55
  /memspell 9 "Phantom Shield"
  /delay 25
  /call cast "Phantom Shield"
  /delay 65
/return

Sub Spells2
/call cast "Symbol of Ancient Summoning" item
  /delay 35
  /call cast "Symbol of Ancient Summoning" item
  /delay 35
  /call cast  "Elemental Fury"
  /delay 53
  /call cast "Staff of Elemental Essence" item
  /delay 10
/return

Also, with a macro that depends on a lot of precision, such as this one, I'd recommend adding in events that check for interrupted spells, not having enough mana, or fizzles, that restart the macro at a certain point. One method I've seen is to have each sub set a variable to a different number, then have each event pause 10s, then run through a check of all the possible variable values, then jump over to the correct sub. It's fairly simple to set up, and can prevent some of the stoppage that can occur if, say, your mod rod fizzles, or you don't have enough mana for a pet, etc.

I'll not be the first one to say that some of my coding sucks, but I hope I'm able to convey a rough idea, at least, of how I think you could improve this.

Gnits
a snow griffon
a snow griffon
Posts: 371
Joined: Fri Jun 03, 2005 7:56 pm

Post by Gnits » Tue Jul 12, 2005 12:07 am

You are correct there IS no sub main, on purpose

Call it an object, its not meant to be called directly.

I use this as my mechanism

Code: Select all

#include magefunctions.inc

sub main(magesub, param1, param2)
  /call ${magesub} ${param1}
  /return

and i use that to gain access to the other code and make it reusable.

EDIT: And as i add more functions this code allows me direct access to it. I do like your thought about splitting up the spells, i will do that at some point. I was working on my malosinia routine tonight.

ionsf
a ghoul
a ghoul
Posts: 94
Joined: Wed Jan 14, 2004 10:19 pm

Re: Mage Pet Equipping Macro

Post by ionsf » Wed Apr 29, 2020 1:22 pm

Is there an updated version of something like this?
The used to say something inappropriate. I'm a decade and half older now.

GoldenFrog
a ghoul
a ghoul
Posts: 87
Joined: Mon Jan 31, 2005 5:58 pm

Re: Mage Pet Equipping Macro

Post by GoldenFrog » Thu May 14, 2020 3:05 pm

I know the macro above is from 2005, but did you try it, updating all the spells/items to your modern equivalents?

xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Mage Pet Equipping Macro

Post by xyilla » Sat May 31, 2025 8:27 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Mage Pet Equipping Macro

Post by xyilla » Sat May 31, 2025 8:28 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Mage Pet Equipping Macro

Post by xyilla » Sat May 31, 2025 8:29 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Mage Pet Equipping Macro

Post by xyilla » Sat May 31, 2025 9:06 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Mage Pet Equipping Macro

Post by xyilla » Sat May 31, 2025 9:07 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Mage Pet Equipping Macro

Post by xyilla » Sat May 31, 2025 9:08 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Mage Pet Equipping Macro

Post by xyilla » Sat May 31, 2025 9:09 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Mage Pet Equipping Macro

Post by xyilla » Sat May 31, 2025 9:46 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Mage Pet Equipping Macro

Post by xyilla » Sat May 31, 2025 9:47 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Mage Pet Equipping Macro

Post by xyilla » Sat May 31, 2025 10:24 pm