WoW:API UnitGetGuildXP: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
mNo edit summary
m (Move page script moved page API UnitGetGuildXP to API UnitGetGuildXP without leaving a redirect)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{stub/API}}
{{wowapi}} __NOTOC__
{{Wowapi}}
Retrieves the Guild XP information of the unit.
''From Blizzard_GuildUI.lua:''
currentXP, nextLevelXP, dailyXP, maxDailyXP, unitWeeklyXP, unitTotalXP = UnitGetGuildXP("unit")


local currentXP, remainingXP, dailyXP, maxDailyXP = UnitGetGuildXP("player");
== Arguments ==
;unit : String - The [[UnitId]] to query.


variable names seem to explain it all
== Returns ==
:currentXP, nextLevelXP, dailyXP, maxDailyXP, unitWeeklyXP, unitTotalXP
;currentXP : Number - The amount of Guild XP for the current level.
;nextLevelXP : Number - The amount of Guild XP to reach the next level. The total Guild XP is this value plus currentXP.
;dailyXP : Number - The amount of Guild XP obtained towards the daily maximum.
;maxDailyXP : Number - The maximum Guild XP cap for the day. The total remaining for the day is this value minus dailyXP.
;unitWeeklyXP : Number - The amount of Guild XP contributed by the target this week.
;unitTotalXP : Number - The total amount of Guild XP contributed by the target.
 
== Example ==
local currentXP, nextLevelXP, dailyXP, maxDailyXP, unitWeeklyXP, unitTotalXP = UnitGetGuildXP("player");
print("Current Guild XP: " .. currentXP .. ", total: " .. (nextLevelXP + currentXP) .. ", daily: " .. dailyXP .. ", daily max: " .. maxDailyXP);
print("Player weekly contribution: " .. unitWeeklyXP .. ", total contribution: " .. unitTotalXP);
 
<big>'''Result'''</big>
Current Guild XP: 18592302, total: 26530000, daily: 5550302, daily max: 6246000
Player weekly contribution: 19088, total contribution: 29099957
 
== Details ==
: The values returned by this function are only updated after the {{api|GUILD_XP_UPDATE|t=e}} event has fired. You can use the {{api|QueryGuildXP}} function to request an update.

Latest revision as of 04:47, 15 August 2023

WoW API < UnitGetGuildXP

Retrieves the Guild XP information of the unit.

currentXP, nextLevelXP, dailyXP, maxDailyXP, unitWeeklyXP, unitTotalXP = UnitGetGuildXP("unit")

Arguments[edit]

unit
String - The UnitId to query.

Returns[edit]

currentXP, nextLevelXP, dailyXP, maxDailyXP, unitWeeklyXP, unitTotalXP
currentXP
Number - The amount of Guild XP for the current level.
nextLevelXP
Number - The amount of Guild XP to reach the next level. The total Guild XP is this value plus currentXP.
dailyXP
Number - The amount of Guild XP obtained towards the daily maximum.
maxDailyXP
Number - The maximum Guild XP cap for the day. The total remaining for the day is this value minus dailyXP.
unitWeeklyXP
Number - The amount of Guild XP contributed by the target this week.
unitTotalXP
Number - The total amount of Guild XP contributed by the target.

Example[edit]

local currentXP, nextLevelXP, dailyXP, maxDailyXP, unitWeeklyXP, unitTotalXP = UnitGetGuildXP("player");
print("Current Guild XP: " .. currentXP .. ", total: " .. (nextLevelXP + currentXP) .. ", daily: " .. dailyXP .. ", daily max: " .. maxDailyXP);
print("Player weekly contribution: " .. unitWeeklyXP .. ", total contribution: " .. unitTotalXP);

Result

Current Guild XP: 18592302, total: 26530000, daily: 5550302, daily max: 6246000
Player weekly contribution: 19088, total contribution: 29099957

Details[edit]

The values returned by this function are only updated after the GUILD_XP_UPDATE event has fired. You can use the QueryGuildXP function to request an update.