PetToys.mac

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

Moderator: MacroQuest Developers

hiipii
a ghoul
a ghoul
Posts: 93
Joined: Sat Jun 19, 2004 5:01 pm

PetToys.mac

Post by hiipii » Thu Jul 08, 2004 7:29 pm

I searched for a macro to make pet toys and give them to pet nd couldn't find anything. So I set out to making my own and now a couple hours later it's done. Please post any improvements and feel free to use this in your macros!

*oh yea make sure to have spellcast.inc from the snippets forum

Code: Select all

|PetToys.mac
|/mac PetToys [fire|cold|magic] [pet|<target>]

#include spellcast.inc

sub main
/declare WepType string outer

|-----------------------------------
|determine fire cold or magic 

/if (!${Param0.Equal[fire]}&&!${Param0.Equal[cold]}&&!${Param0.Equal[magic]}) { 
   /echo Did not select weapon type...defaulting to cold. 
   /varset WepType "Blade of The Kedge"
}
/if (${Param0.Equal[fire]}) {
   /varset WepType "Fist of Ixiblat" 
      }
/if (${Param0.Equal[cold]}) {
   /varset WepType "Blade of The Kedge"
      }
/if (${Param0.Equal[magic]}) {
   /varset WepType "Blade of Walnan"
      }
|-----------------------------------
|give to pet or current target?

/if (${Param1.Equal[pet]}) {
   /target ${Me.Pet}
   /goto :target
      } 
/if (${Param1.Equal[target]}) /goto :target
/if (${Defined[Param1]}) {
   /target ${Param1}
/if (!${Defined[Param1]}&&!{Target.ID}) {
   /echo Error getting target ending macro.
   /endmacro
      }


:target
/call MakeToys
/call GiveToPet
/echo have a nice day!
/return

|-----------------------------
|Have to memspells before beginning to cast 
|because you canot mem spells with items in your hand
|-----------------------------
sub MakeToys
/echo memming spells
/memspell 6 "Muzzle of Mardu"
/delay 3s
/memspell 7 "Girdle of Magi'Kot"
/delay 3s
/memspell 8 ${WepType}
/delay 3s
/echo casting pet toys
/call cast "Muzzle of Mardu"
/call cast "Girdle of Magi'Kot"
/call cast ${WepType}	
/call cast ${WepType}
/return

|-----------------------------
sub GiveToPet
/echo Giving ${Target} their pet toys!
/click left target
/delay 1s
/click left target
/delay 1s
/click left target
/delay 1s
/click left target

/if (${Target.Type.Equal[NPC]}) {
   /notify GiveWnd GVW_Give_Button leftmouseup
      } else {
   /notify TradeWnd TRDW_Trade_Button leftmouseup
/return

Last edited by hiipii on Thu Jul 08, 2004 11:29 pm, edited 3 times in total.

Drumstix42
a grimling bloodguard
a grimling bloodguard
Posts: 808
Joined: Mon May 03, 2004 4:25 pm

Re: PetToys.mac

Post by Drumstix42 » Thu Jul 08, 2004 9:48 pm

/if (${Param1.Equal[pet]}) {
/target ${Me.Pet}
}
Here's just a little suggested change. Just incase you aren't target someone, you could type in their name, and if Param 1 is undefined, it'll end the macro.

Code: Select all

/if (${Param1.Equal[pet]}) {
   /target ${Me.Pet}
} else /if (!${Defined[Param1]}) {
   /echo Target undefined.
   /endmacro
} else {
   /target pc "${Param1}"
}
And before your 3 if's about Param0, you could throw in a:

Code: Select all

/if (!${Param0.Equal[fire]}||!${Param0.Equal[cold]}||!${Param0.Equal[magic]}) {
   /echo Incorrect parameters for Param 0.
   /endmacro
}
avoiding spelling errors, or forgetting to put it in ;)

hiipii
a ghoul
a ghoul
Posts: 93
Joined: Sat Jun 19, 2004 5:01 pm

Post by hiipii » Thu Jul 08, 2004 11:27 pm

Took some of your advice Drumstix helps out a lot although I made the macro default to cold weapon. Also added the ability for it to actually hit trade when giving to pcs. Also if Param1 is undefined it will give weapons to target.

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

Post by Boredbard » Sun Jul 11, 2004 2:14 pm

This is kind of a cool toy. I'll go put it through the riggors of a raid or two and see how it holds up :P

hiipii
a ghoul
a ghoul
Posts: 93
Joined: Sat Jun 19, 2004 5:01 pm

Post by hiipii » Sun Jul 11, 2004 9:22 pm

Ok first I have a question. Every once in a while the macro mems "Muzzle of Mardu" in slot 5 then doesnt mem the other spells. Anyone know what causes this or how to fix it?

Secondly I decided to convert this to an inc file as well for use with other macros. If anyone wanted to see what it was here you go.

Make sure to use spellcast.inc on your main macro.

Code: Select all

|PetToys.inc
|/call PetToys [fire|cold|magic] [pet|<target>]


sub PetToys
/declare WepType string outer

|-----------------------------------
|determine fire cold or magic 

/if (!${Param0.Equal[fire]}&&!${Param0.Equal[cold]}&&!${Param0.Equal[magic]}) { 
   /echo Did not select weapon type...defaulting to cold. 
   /varset WepType "Blade of The Kedge"
}
/if (${Param0.Equal[fire]}) {
   /varset WepType "Fist of Ixiblat" 
      }
/if (${Param0.Equal[cold]}) {
   /varset WepType "Blade of The Kedge"
      }
/if (${Param0.Equal[magic]}) {
   /varset WepType "Blade of Walnan"
      }
|-----------------------------------
|give to pet or current target?

/if (${Param1.Equal[pet]}) {
   /target ${Me.Pet}
   /goto :target
      } 
/if (${Param1.Equal[target]}) /goto :target
/if (${Defined[Param1]}) {
   /target ${Param1}
/if (!${Defined[Param1]}&&!{Target.ID}) {
   /echo Error getting target ending macro.
   /endmacro
      }


:target
/call MakeToys
/call GiveToPet
/echo have a nice day!
/return

|-----------------------------
|Have to memspells before beginning to cast 
|because you canot mem spells with items in your hand
|-----------------------------
sub MakeToys
/echo memming spells
/memspell 6 "Muzzle of Mardu"
/delay 3s
/memspell 7 "Girdle of Magi'Kot"
/delay 3s
/memspell 8 ${WepType}
/delay 3s
/echo casting pet toys
/call cast "Muzzle of Mardu"
/call cast "Girdle of Magi'Kot"
/call cast ${WepType}	
/call cast ${WepType}
/return

|-----------------------------
sub GiveToPet
/echo Giving ${Target} their pet toys!
/click left target
/delay 1s
/click left target
/delay 1s
/click left target
/delay 1s
/click left target
/delay 1s
/if (${Target.Type.Equal[NPC]}) {
   /notify GiveWnd GVW_Give_Button leftmouseup
      } else {
   /notify TradeWnd TRDW_Trade_Button leftmouseup
/return


User avatar
SukMage
a ghoul
a ghoul
Posts: 88
Joined: Fri Jun 04, 2004 5:08 pm

Post by SukMage » Fri Jul 23, 2004 5:17 pm

Having the same problem with muzzle of mardu memming in 6 and not the others in 7 & 8. Any ideas?

Drumstix42
a grimling bloodguard
a grimling bloodguard
Posts: 808
Joined: Mon May 03, 2004 4:25 pm

Post by Drumstix42 » Fri Jul 23, 2004 7:03 pm

EQ lag, you lagging, ect I would guess.

Using delays for things like meming spells isn't great, I learned that a while ago.

Instead of delaying x number of seconds after each line of /memspell

put:

/call SpellWindow

and put this in your mac:

Code: Select all

Sub SpellWindow
   :SpellBookOpen
    /delay 1s
    /if (${Window[SpellBookWnd].Open}) /goto :SpellBookOpen
/return
Should work great for ya. If not, dunno what else the problem might be.

Edit: 2 other notes I remember.

If you like time effiency you can try this instead of just /delay 1 in the Sub:

Code: Select all

/delay 1s !${Window[SpellBookWnd].Open}
... but not sure if that syntax works for sure.

And the other thing, for an extra check to make sure the spell window is closed. Either put:

Code: Select all

/book
At the beggining of the sub, or at the end you could put:

Code: Select all

/if (${Window[SpellBookWnd].Open}) /book