FANDOM


 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<center>'''HasPetUI''' ''-Documentation by AlexanderYoshi-''</center>
+
{{wowapi}}
  +
Returns <tt>1</tt> if the player has a pet User Interface.
   
Returns true if the player has a pet User Interface.
+
hasUI, isHunterPet = HasPetUI();
 
hasUI = HasPetUI();
 
   
 
----
 
----
Line 11: Line 11:
 
;''Returns''
 
;''Returns''
   
:hasUI
+
:hasUI, isHunterPet
:;hasUI :Boolean - <tt>true</tt> if the player has a pet User Interface.
+
:;hasUI :The number <tt>1</tt> if the player has a pet User Interface, <tt>nil</tt> if he does not.
  +
:;isHunterPet :The number <tt>1</tt> if the pet is a hunter pet, <tt>nil</tt> if it is not.
   
 
----
 
----
Line 18: Line 18:
 
if ( HasPetUI() ) then DoPetStuff(); end
 
if ( HasPetUI() ) then DoPetStuff(); end
   
;''Result''
+
;''Example''
true | false
+
local hasUI, isHunterPet = HasPetUI();
+
if hasUI then
----
+
if isHunterPet then
;''Description''
+
DoHunterPetStuff(); -- For hunters
+
else
: Returns true if the player has a pet User Interface.
+
DoMinionStuff(); -- For Warlock minions
  +
end
  +
end
   
 
----
 
----
{{WoW API}}
+
;''Known Issues''
  +
Does not work for Frost Mages' Water Elemental pets. Even with a Water Elemental out (and the Pet UI showing), HasPetUI() returns nil,nil

Latest revision as of 21:37, May 31, 2010

WoW API < HasPetUI

Returns 1 if the player has a pet User Interface.

hasUI, isHunterPet = HasPetUI();

Arguments
none

Returns
hasUI, isHunterPet
hasUI 
The number 1 if the player has a pet User Interface, nil if he does not.
isHunterPet 
The number 1 if the pet is a hunter pet, nil if it is not.

Example
 if ( HasPetUI() ) then DoPetStuff(); end
Example
 local hasUI, isHunterPet = HasPetUI();
 if hasUI then
   if isHunterPet then
     DoHunterPetStuff(); -- For hunters
   else
     DoMinionStuff(); -- For Warlock minions
   end
 end

Known Issues

Does not work for Frost Mages' Water Elemental pets. Even with a Water Elemental out (and the Pet UI showing), HasPetUI() returns nil,nil

Community content is available under CC-BY-SA unless otherwise noted.