Thread Tools Display Modes
06-16-17, 01:52 AM   #1
scainburger
A Defias Bandit
Join Date: Jun 2017
Posts: 2
Issues with Lua snippet to join LFR

I am using the following Lua to join all LFRs that I have not cleared this week:

Code:
local pLvl = UnitLevel("player")

ClearAllLFGDungeons(LE_LFG_CATEGORY_LFR)

local tank, heal, dps = C_LFGList.GetAvailableRoles() 
SetLFGRoles(1, tank, heal, dps)

for i = 1, GetNumRFDungeons() do
   
   local id, _, _, _, min, max = GetRFDungeonInfo(i)
   
   local total, killed = GetLFGDungeonNumEncounters(id)
   
   if not (pLvl < min or pLvl > max) then 
      
      if killed ~= total and IsLFGDungeonJoinable(id) then
         
         SetLFGDungeon(LE_LFG_CATEGORY_LFR, id) 
         
      end
      
   end
   
end

JoinLFG(LE_LFG_CATEGORY_LFR)
The code works fine, however the issue I am having is that once I enter an LFR, the other queues stop. This is not the same behaviour as manually clicking queue for each LFR on the LFG window. I was wondering if anyone knew of a way to keep the queue going with this code. Thanks
  Reply With Quote
06-16-17, 03:03 AM   #2
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 666
Your code only joins one wing. Your loop basically sets each one in a row, but the join function happens only once, and only to the last wing your loop sets. You can verify everything you're queued for by mousing over the eye on your minimap.

However, there is an antispam limit to joining queues. Your code will only be able to join two queues before not working. You'll have to wait a few seconds before joining more.
  Reply With Quote
06-16-17, 03:35 AM   #3
scainburger
A Defias Bandit
Join Date: Jun 2017
Posts: 2
Originally Posted by Kanegasi View Post
Your code only joins one wing.
That doesn't seem to be the case:



As I understand it, the SetLFGDungeon function flags that instance as "I want to queue for this", then the JoinLFG function queues for everything with that flag.

Last edited by scainburger : 06-16-17 at 03:39 AM.
  Reply With Quote
06-16-17, 06:50 AM   #4
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 666
That's actually interesting. I was not aware it worked that way. I'm not sure what the issue is then.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Issues with Lua snippet to join LFR


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