Thread Tools Display Modes
02-26-12, 09:17 AM   #1
Aalwein
A Flamescale Wyrmkin
 
Aalwein's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 147
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.
__________________
Aalwein | Jaberwocky
Die by the Arrow | YouTube | Facebook | Twitter
  Reply With Quote
02-26-12, 09:27 AM   #2
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
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
  Reply With Quote
02-26-12, 11:16 AM   #3
Aalwein
A Flamescale Wyrmkin
 
Aalwein's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 147
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.
__________________
Aalwein | Jaberwocky
Die by the Arrow | YouTube | Facebook | Twitter
  Reply With Quote
02-26-12, 01:02 PM   #4
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,308
Originally Posted by Aalwein View Post
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.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
02-26-12, 10:01 PM   #5
Aalwein
A Flamescale Wyrmkin
 
Aalwein's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 147
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.
__________________
Aalwein | Jaberwocky
Die by the Arrow | YouTube | Facebook | Twitter
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » Macro Help » function to check if pet is ferocity or tenacity

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off