WoWInterface

WoWInterface (http://www.wowinterface.com/forums/index.php)
-   Macro Help (http://www.wowinterface.com/forums/forumdisplay.php?f=140)
-   -   function to check if pet is ferocity or tenacity (http://www.wowinterface.com/forums/showthread.php?t=42703)

Aalwein 02-26-12 09:17 AM

function to check if pet is ferocity or tenacity
 
Does anyone know if there is a function for check what type of pet you have out? Something like:

PetClass() - returns Ferocity, Tenacity, or Cunning

If not, is there a function to check to see if a spell exists? For example, I could run SpellExists('Dash') and if it returns 1 that means it's Ferocity or Cunning, if it returns 0 that means it's Tenacity.

I'm basically trying to make a macro that I can run that will toggle between passive and defensive/assist - defensive if I have a Tenacity pet out, assist if I have a Cunning or Ferocity pet out. I've got something like this in mind:

Code:

/petfollow [@pettarget,exists]
/petpassive [@pettarget,exists]
/script if PetClass() = 'Tenacity' then
  /petdefensive [@pettarget,noexists] else /petassist [@pettarget,noexists]

If I can just check to see if a spell exists, I'd just do a function check to see if "Thunderstomp" exists and go from there.

p3lim 02-26-12 09:27 AM

The closest you can get is the following:
Code:

/petpassive [pet:Wolf]
/petdefensive [pet:Bear]
/petassist [pet:Cat]

http://www.wowwiki.com/Making_a_macro#Conditionals

Aalwein 02-26-12 11:16 AM

Oh that will work well enough. I could just put a few lines with each type of pet I use. Thank you for pointing me there.

SDPhantom 02-26-12 01:02 PM

Quote:

Originally Posted by Aalwein (Post 253111)
Code:

/petfollow [@pettarget,exists]
/petpassive [@pettarget,exists]
/script if PetClass() = 'Tenacity' then
  /petdefensive [@pettarget,noexists] else /petassist [@pettarget,noexists]

If I can just check to see if a spell exists, I'd just do a function check to see if "Thunderstomp" exists and go from there.

Note a couple things. First, /script runs the argument as Lua code, which throws errors if you try to mix macro commands in it. Also you can use /cast for a spell that isn't available to you currently, the game will cast it if you have it or completely ignore the command if you don't.

Aalwein 02-26-12 10:01 PM

So a macro as such:

Code:

/petfollow
/petpassive [@pettarget,exists]
/petdefensive [@pettarget,noexists,pet:Scorpid/Turtle]
/petassist [@pettarget,noexists,pet:Cat/Wolf/Ravager]

where I can add more pets as I need works great.

For anyone wondering, this is my button to call off my pet should the need arise. I can spam it in combat to call my pet to my side and put it back into its defensive or assist state. I have /petattack bound to my Hunter's Mark.


All times are GMT -6. The time now is 08:40 PM.

vBulletin © 2014, Jelsoft Enterprises Ltd
©2012 ZAM Network LLC