Thread Tools Display Modes
04-15-16, 01:29 PM   #1
suipsyco
A Deviate Faerie Dragon
Join Date: Apr 2016
Posts: 13
Dungeon IDs

A guildy asked me about adding a reporting function for LFR lockouts to my addon. Problem is LFR isnt in the /raidinfo tables so I've been searching for an alternative.

I found GetLFGDungeonEncounterInfo() which seems to work, however blizzard doesn't seem to have held to it's API conventions for this command. the dungeon ID's for Hellfire LFR should be 982-986 if I have that correct, however, rather than the bosses in each encounter being 1-3 like in previous expansions I think the numbers are 1-13 for all bosses i.e Archi is (986, 13) rather than (986,1).

However, if I run GetLFGDungeonNumEncounters() for each of these LFR dungeon ID's it returns that I've completed them all, which I haven't.

tl;dr For Highmaul, Blackrock, and Hellfire LFRs, how can I return the name of the section of the LFR, and whether they have been completed

Some code I ran to get my information: (I'm sure there's a more concise way to write these, feel free to correct them :P)

Check if LFR's were complete
Code:
/run for i = 1,5 do local t = {982,983,984,985,986} print(GetLFGDungeonNumEncounters(t[1])) end
Print out what bosses in hellfire had been completed
Code:
/run for i= 1,13 do local t = {982,982,982,983,983,983,984,984,984,985,985,985,986}; local n,_,l = GetLFGDungeonEncounterInfo(t[i], i) print(n,l and "\124cff00ff00Completed" or "\124cffff0000Not Completed") end
-Note: Fel Lord and Soc were the wrong ones for me for this.
  Reply With Quote
04-15-16, 04:03 PM   #2
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
I think you're going to have to store the index of the encounter that each section of the raid starts on, as well as the number of encounters, and use GetLFGDungeonEncounterInfo to determine what's been completed.

Your first /run command will print the same thing 5 times because you have GetLFGDungeonNumEncounters(t[1]) instead of GetLFGDungeonNumEncounters(t[i]). Not that it matters much, since it gives you all 13 bosses regardless.

You can get the name of the section from GetLFGDungeonInfo, though.
  Reply With Quote
04-15-16, 04:25 PM   #3
suipsyco
A Deviate Faerie Dragon
Join Date: Apr 2016
Posts: 13
Thanks for pointing out the 1-i issue, that made that line work better, but its the other line thats not giving results, and thats the more important line
  Reply With Quote
04-16-16, 10:29 AM   #4
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
If you output GetLFGDungeonInfo alongside the boss names and compare it to the HFC page on wowhead you'll notice Blizzard's idea of what order the 13 bosses are in doesn't match.

The function inexplicably doesn't return valid information for bosses outside of the wing despite listing all 13 of them, so you'll have to make sure you have the right dungeon ID for the right boss number.

Here's an example that's kind of pushing the macro limit, but should output the bosses in the correct order with valid data.
Lua Code:
  1. /run for i,v in pairs({{982,1},{982,2},{982,3},{983,5},{983,4},{983,6},{984,7},{984,8},{984,11},{985,9},{985,10},{985,12},{986,13}})do local n,_,x=GetLFGDungeonEncounterInfo(v[1],v[2])print(GetLFGDungeonInfo(v[1])..':',n,(x and''or'Not ')..'Completed')end
  Reply With Quote
04-16-16, 05:25 PM   #5
Hiketeia
An Aku'mai Servant
 
Hiketeia's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2016
Posts: 33
I looked in LFRFrame.lua and it seems to be using SearchLFGGetEncounterResults() after using SearchLFGGetResults() get get the indexes to the bosses. Doesn't seem to be a great way either, but it does display that icon with the tooltip showing which bosses you've already done.

I'm still pretty new at this though so not sure if that'll help or lead you down the wrong path.
  Reply With Quote
04-16-16, 05:39 PM   #6
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
Originally Posted by Hiketeia View Post
I looked in LFRFrame.lua and it seems to be using SearchLFGGetEncounterResults() after using SearchLFGGetResults() get get the indexes to the bosses.
I believe the SearchLFG functions are actually for the newish raid browser for groups that other players are hosting manually, rather than the automatic LFR system.

The LFG files in framexml are incredibly confusing.
  Reply With Quote
04-16-16, 07:05 PM   #7
Hiketeia
An Aku'mai Servant
 
Hiketeia's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2016
Posts: 33
Originally Posted by semlar View Post
I believe the SearchLFG functions are actually for the newish raid browser for groups that other players are hosting manually, rather than the automatic LFR system.

The LFG files in framexml are incredibly confusing.
Oh, that makes much more sense! I see now yeah, I should have been looking at LFGFrame.lua instead /blush

The LFGRewardsFrameEncounterList_OnEnter() is populating the tooltip I was thinking of - not anything new then what is already in the thread, sorry.
  Reply With Quote
04-17-16, 12:10 AM   #8
suipsyco
A Deviate Faerie Dragon
Join Date: Apr 2016
Posts: 13
Semlar, I'll look into that some more but the error in my macro results just make me more confused with what you put, I figure out they were in a wrong order of some sort, but the boss names all printed correctly with the way I had it, just the completion status for two of the bosses was wrong, I'll do more tests on what you put and what I put though
  Reply With Quote
04-17-16, 12:11 PM   #9
Vrul
A Scalebane Royal Guard
 
Vrul's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2007
Posts: 404
Here's a small bit of code to show the basics of what you need:
Lua Code:
  1. local function UpdateInstanceInfo()
  2.     for index = 1, GetNumRFDungeons() do
  3.         local dungeonID = GetRFDungeonInfo(index)
  4.         local numEncounters, numCompleted = GetLFGDungeonNumEncounters(dungeonID)
  5.         if numCompleted > 0 then
  6.             local dungeonName = GetLFGDungeonInfo(dungeonID)
  7.             local completedEncounterText = "Encounters completed in " .. dungeonName .. ":\n"
  8.             for encounterID = 1, numEncounters do
  9.                 local encounterName, _, isCompleted = GetLFGDungeonEncounterInfo(dungeonID, encounterID)
  10.                 if isCompleted then
  11.                     completedEncounterText = completedEncounterText .. encounterName .. "\n"
  12.                 end
  13.             end
  14.             print(completedEncounterText)
  15.         end
  16.     end
  17. end
  18.  
  19. local frame = CreateFrame('Frame')
  20. frame:SetScript('OnEvent', function(self, event)
  21.     self:UnregisterEvent(event)
  22.     UpdateInstanceInfo()
  23. end)
  24. frame:RegisterEvent('UPDATE_INSTANCE_INFO')
  25. RequestRaidInfo()
Keep in mind you should not call UpdateInstanceInfo without first calling RequestRaidInfo and waiting for the event UPDATE_INSTANCE_INFO or your results won't reflect any bosses killed since the last request.

And here is semlar's macro shrunk some for those that prefer macros in preparation for 4-digit dungeon IDs:
Lua Code:
  1. /run local d={982,1,982,2,982,3,983,4,983,5,983,6,984,7,984,8,984,11,985,9,985,10,985,12,986,13}for i=1,#d,2 do local n,_,x=GetLFGDungeonEncounterInfo(d[i],d[i+1])print(GetLFGDungeonInfo(d[i])..':',n,(x and''or'not ')..'completed')end
  Reply With Quote
04-19-16, 03:01 PM   #10
suipsyco
A Deviate Faerie Dragon
Join Date: Apr 2016
Posts: 13
Vrul, that last macro you posted does exactly what my guildy wanted! Thanks! I hate to bother you again, but I want to add color to the completed and not completed lines.
I have this macro:
Code:
/run for i=1,GetNumSavedInstances() do local n,_,_,d,l = GetSavedInstanceInfo(i) if d==23 then print(n,l and "Completed" or "\124cffff0000Not Completed") end end
Which add the color in fine, but when I try to add color to your macro, I can only get the red "Not Complete" working, any ideas?
  Reply With Quote
04-19-16, 05:31 PM   #11
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
Macros have a character limit of 255.

The one I posted is exactly 255 characters long; Vrul rewrote it to be 234 characters which leaves you with 21 characters which is just barely enough to color one of the strings.

You asked why your macro wasn't working but didn't post it, so we have no way to know what's wrong with it, but odds are you exceeded the character limit.

This will color it but is presumably what you already have.
Lua Code:
  1. /run local d={982,1,982,2,982,3,983,4,983,5,983,6,984,7,984,8,984,11,985,9,985,10,985,12,986,13}for i=1,#d,2 do local n,_,x=GetLFGDungeonEncounterInfo(d[i],d[i+1])print(GetLFGDungeonInfo(d[i])..':',n,(x and''or'\124cffff0000not ')..'completed')end

For anything more complex you'll either need to run an addon that lets you write extended macros, or turn this into an addon.
  Reply With Quote
04-20-16, 01:39 AM   #12
suipsyco
A Deviate Faerie Dragon
Join Date: Apr 2016
Posts: 13
See things like the character limit, I would never have thought of.
The macro you posted colors the "Not completed", but not the "completed"
The original macro is:
Code:
/run for i=1,GetNumSavedInstances() do local n,_,_,d,l = GetSavedInstanceInfo(i) if d==23 then print(n,l and "\124cff00ff00Completed" or "\124cffff0000Not Completed") end end
I didn't create it, I modified this one to report in the chat of choice (party, say, etc). This works fine for mythics, but since the LFR information isn't stored the same way(as far as i could tell), it wouldn't work

Last edited by suipsyco : 04-20-16 at 01:42 AM.
  Reply With Quote
04-16-20, 06:40 AM   #13
spanky0312
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Mar 2013
Posts: 11
I know this is old post, but where do I find the LFR ID's.

Like Hellfire is 982, 9832, 9843, 985 and 986.
But I have no idea where to get this.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Dungeon IDs

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