Friday, April 13, 2012

API GetAchievementInfo problem

[:1]Hi,

I'm trying to create an Addon for Guildmasters. For this, I want this Addon to list wich Raids and Heroic Donjon's are clened.

To do this, my addon needs to chech Achievement Infos :

IDNumber, Name, Points, Completed, Month, Day, Year, Description, Flags, Image, RewardText = GetAchievementInfo(achievementID)

source from WowWiki.

I tryied with Achievement ID 2888 and the stored Data in "Description" is correct but :

The Boolean value of "Completed" is anyway "False" even Achievement done or not.

I hope somebody knows about this problem :-) and can help me.

Y.G|||Here's the entire code :

function dbxs()



DEFAULT_CHAT_FRAME:AddMessage("Command: " .. "Execution de DBXS v. 1.0");



local Category = GetAchievementCategory(2888);

local IDNumber, Name, Points, Completed, Month, Day, Year, Description, Flags, Image, RewardText = GetAchievementInfo(Category, 1);

local fini = "Pas termin?";



DEFAULT_CHAT_FRAME:AddMessage("Category ID : " .. Category) ;

DEFAULT_CHAT_FRAME:AddMessage("Achievement ID at Index 1 : " .. IDNumber .. " " .. Description) ;



if (Completed == true) then

fini = "true";

elseif (Completed == false) then

fini = "false";

elseif (Completed == 1) then

fini = "1";

elseif (Completed == 0) then

fini = "0";

else

fini = "DBX99";

end



message("Etat : " .. fini);



end



I also tried before :

local IDNumber, Name, Points, Completed, Month, Day, Year, Description, Flags, Image, RewardText = GetAchievementInfo(2888);

But anyway, the Achievements are done and "Completed" returns False, why ?

Thanks

Y.G.|||Or knows somebody how to get the information if an Achievement is done ?

Maybe I^m don^t using the right stuff ^^.

Bye

Y.G.|||Quote:








Or knows somebody how to get the information if an Achievement is done ?

Maybe I^m don^t using the right stuff ^^.

Bye

Y.G.




Seems pretty straight forward to me...

In a simple test-


Code:
/script a,b,c,d=GetAchievementInfo(614)
/script print(d)

614 is "For the Alliance" and returned true on a toon that completed it and false on a toon that didn't...

No comments:

Post a Comment