Page 1 of 1

PetToys.mac

Posted: Thu Jul 08, 2004 7:29 pm
by hiipii
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


Re: PetToys.mac

Posted: Thu Jul 08, 2004 9:48 pm
by Drumstix42
/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 ;)

Posted: Thu Jul 08, 2004 11:27 pm
by hiipii
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.

Posted: Sun Jul 11, 2004 2:14 pm
by Boredbard
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

Posted: Sun Jul 11, 2004 9:22 pm
by hiipii
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


Posted: Fri Jul 23, 2004 5:17 pm
by SukMage
Having the same problem with muzzle of mardu memming in 6 and not the others in 7 & 8. Any ideas?

Posted: Fri Jul 23, 2004 7:03 pm
by Drumstix42
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