Thread Tools Display Modes
06-04-12, 02:18 PM   #1
Caetan0
A Warpwood Thunder Caller
Join Date: Aug 2011
Posts: 99
verify achievement

friends, You know you tell me if there are any command line that checks if the player possesses certain achievement?
  Reply With Quote
06-05-12, 12:22 AM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
You can find a list of all achievement-related WoW API functions here:
http://www.wowpedia.org/World_of_Warcraft_API#Achievement_Functions

I highly recommend you bookmark the following page, which contains links to the above page and many other helpful references for WoW API functions, events, and more:
http://www.wowpedia.org/Portal:Interface_customization

For your specific question, the function you want is GetAchievementInfo, which takes the achievement ID (the number in the achievement's URL on wowhead.com) and returns lots of information about the achievement. The fourth return value is a boolean (true/false) value indicating whether or not you have completed the achievement.

For example, this command:
Code:
/run local _, name, _, completed = GetAchievementInfo(4826) print(string.format("%s is %s.", name, completed and "complete" or "not complete"))
...will print "Level 85 is complete." if you've completed the Level 85 achievement or "Level 85 is not complete." if you haven't.

Really, though, I can't see this being very useful. You should already have a general idea of which achievements you've completed, and if you're not sure, it's probably faster to just find it in the Achievements window than to go find its ID number and use a /run command.

Also, there are plenty of addons that will show you whether you've completed an achievement when you're looking at a tooltip for the achievement (eg. if you click on the achievement link in chat).

If you're looking for ways to see if another player (not yourself) has completed an achievement, you would need to use the the inspect API, not the achievement API. However, as the inspect API is very complicated, very fragile, and somewhat buggy, I would absolutely not recommend trying to work with it for a beginner, and am not going to provide any help with it. I'd suggest using an addon like Examiner for this.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
06-05-12, 12:56 PM   #3
Caetan0
A Warpwood Thunder Caller
Join Date: Aug 2011
Posts: 99
Thank you my friend, What I am "trying" to do is check one of conquest and if the player in my guild has this achievement it will be promoted to the rank 9.

Code:
        if rank >= 9 then
            if level == 85 and completed == GetAchievementInfo(399) then
                if reallyPromote then
                    SetGuildMemberRank(i, 9)
                end
            end
        end
In case, the guild member is promoted only if it has completed the conquest of "Just the Two of Us: 1550." The code is right?
  Reply With Quote
06-05-12, 05:45 PM   #4
unlimit
Lookin' Good
 
unlimit's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 484
Originally Posted by Caetan0 View Post
Thank you my friend, What I am "trying" to do is check one of conquest and if the player in my guild has this achievement it will be promoted to the rank 9.
As Phanx said, this would require you to use the inspect API, not the achievement API.

Originally Posted by Phanx View Post
If you're looking for ways to see if another player (not yourself) has completed an achievement, you would need to use the the inspect API, not the achievement API. However, as the inspect API is very complicated, very fragile, and somewhat buggy, I would absolutely not recommend trying to work with it for a beginner, and am not going to provide any help with it. I'd suggest using an addon like Examiner for this.
Something like this seems kind of like a waste of time, why not just have them link you the achievement when they get it, then you promote them?
__________________


kúdan: im playing pantheon
JRCapablanca: no youre not
** Pantheon has been Banned. **
  Reply With Quote
06-05-12, 07:03 PM   #5
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by Caetan0 View Post
... check one of conquest and if the player in my guild has this achievement it will be promoted to the rank 9. ... The code is right?
No. You did not read my entire post. The function I gave an example for only works for yourself. I clearly stated that if you want to get information about other players' achievements you must use the inspection API, which is a separate set of functions and events.

Also, it is only possible to inspect characters which are within ~15 yards of your character, so what you are describing is not possible.

This is why you should always describe your request clearly and completely. If you had explained what you wanted to do in the first place, I would have just told you it wasn't possible, instead of wasting my time writing a long explanation with code examples and links to resources.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Search/Requests » verify achievement

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off