WoW:API UnitXP: Difference between revisions

44 bytes removed ,  15 August 2023
m
Move page script moved page API UnitXP to WoW:API UnitXP without leaving a redirect
mNo edit summary
m (Move page script moved page API UnitXP to WoW:API UnitXP without leaving a redirect)
 
(8 intermediate revisions by 8 users not shown)
Line 1: Line 1:
<center>'''UnitXP''' - ''Documentation by VelvetPaw''</center>
{{wowapi}}
 
Return the current XP of a "unit" - only seems to work with "player".
Return the current XP of a "unit" - only seems to work with "player".


Line 19: Line 18:
  XP = UnitXP("player")
  XP = UnitXP("player")
  XPMax = UnitXPMax("player")
  XPMax = UnitXPMax("player")
  DEFAULT_CHAT_FRAME:AddMessage("Your XP is currently at "..floor( XP / XPMax ).."%."),1,0,0)
  DEFAULT_CHAT_FRAME:AddMessage("Your XP is currently at "..floor( (XP / XPMax)*100 ).."%.",1,0,0)


== Info ==
== Info ==
Line 33: Line 32:


:[[API floor|floor(value)]] - Returns the floor of value.
:[[API floor|floor(value)]] - Returns the floor of value.
----
 
__NOTOC__
== Note ==
{{Template:WoW API}}
 
[[Category:API Functions|UnitXP]]
This does '''not''' work for hunter pets, use [[API GetPetExperience|GetPetExperience()]] for that.
[[Category:API Unit Functions|UnitXP]]
Anonymous user