WoW:API UnitXP: Difference between revisions
Jump to navigation
Jump to search
UnitXP - Documentation by VelvetPaw
(Noted that this function does not work for hunter pets) |
m (→Example) |
||
Line 20: | Line 20: | ||
XP = UnitXP("player") | XP = UnitXP("player") | ||
XPMax = UnitXPMax("player") | XPMax = UnitXPMax("player") | ||
DEFAULT_CHAT_FRAME:AddMessage("Your XP is currently at "..floor( (XP / XPMax)*100 ).."%." | DEFAULT_CHAT_FRAME:AddMessage("Your XP is currently at "..floor( (XP / XPMax)*100 ).."%.",1,0,0) | ||
== Info == | == Info == |
Revision as of 09:21, 15 September 2007
Return the current XP of a "unit" - only seems to work with "player".
XP = UnitXP("unit")
Parameters
Arguments
- ("unit")
- unit
- String - The UnitId to select as a target.
Returns
- XP
- XP
- Numeric - Returns the current XP points of the "unit".
Example
XP = UnitXP("player") XPMax = UnitXPMax("player") DEFAULT_CHAT_FRAME:AddMessage("Your XP is currently at "..floor( (XP / XPMax)*100 ).."%.",1,0,0)
Info
DEFAULT_CHAT_FRAME:AddMessage("text",r,g,b)
- ScrollingMessageFrame:AddMessage("text",r,g,b,id)
- Valid Frame names:
DEFAULT_CHAT_FRAME
ChatFrame1 - ChatFrame7
UnitXPMax("unit")
- UnitXPMax("unit") - Returns the number of experience points the specified unit needs to reach their next level.
floor(value)
- floor(value) - Returns the floor of value.
Note
This does not work for hunter pets, use GetPetExperience() for that.