WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Dungeon IDs (https://www.wowinterface.com/forums/showthread.php?t=53307)

suipsyco 04-15-16 01:29 PM

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.

semlar 04-15-16 04:03 PM

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.

suipsyco 04-15-16 04:25 PM

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

semlar 04-16-16 10:29 AM

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

Hiketeia 04-16-16 05:25 PM

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.

semlar 04-16-16 05:39 PM

Quote:

Originally Posted by Hiketeia (Post 314127)
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.

Hiketeia 04-16-16 07:05 PM

Quote:

Originally Posted by semlar (Post 314129)
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.

suipsyco 04-17-16 12:10 AM

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

Vrul 04-17-16 12:11 PM

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

suipsyco 04-19-16 03:01 PM

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?

semlar 04-19-16 05:31 PM

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.

suipsyco 04-20-16 01:39 AM

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

spanky0312 04-16-20 06:40 AM

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.


All times are GMT -6. The time now is 08:44 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI