Thread Tools Display Modes
04-30-11, 05:28 AM   #1
SignOfDoom
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Jul 2010
Posts: 18
event for call to arms

hi
im searching for a event that fires after the call to arms has changed. I already tried: "LFG_UPDATE, LFG_ROLE_UPDATE, LFG_QUEUE_STATUS_UPDATE, LFG_UPDATE_RANDOM_INFO" but none of them is working.
Is there any other event i can use to get what i want or do i have to put my function in the onUpdate handler
  Reply With Quote
04-30-11, 12:36 PM   #2
Vlad
A Molten Giant
 
Vlad's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 793
I think this should work (updated when the random LFD is updated):

lua Code:
  1. local f = CreateFrame("Frame")
  2. f:RegisterEvent("LFG_UPDATE_RANDOM_INFO")
  3. f:SetScript("OnEvent", function(f, event)
  4.   local dungeonID = LFDQueueFrame.type
  5.   if type(dungeonID) == "number" then
  6.     for i = 1, LFG_ROLE_NUM_SHORTAGE_TYPES do
  7.       local eligible, forTank, forHealer, forDamage, itemCount, money, xp = GetLFGRoleShortageRewards(dungeonID, i)
  8.       if eligible and (itemCount ~= 0 or money ~= 0 or xp ~= 0) then -- show only if eligible and has a reward
  9.         if forTank then print("Call to Arms: Tank") end
  10.         if forHealer then print("Call to Arms: Healer") end
  11.         if forDamage then print("Call to Arms: DPS") end
  12.       end
  13.     end
  14.   end
  15. end)

Like you suggest a OnUpdate with a sleep timer would be better, because I didn't find a event for this. Blizzard simply updates the CtA information when the frame is shown and player toggles between the various dungeon types. The API is what gets the new data from the server, not that bad tough. Keeping it on a 5 sec loop should be plenty.

Last edited by Vlad : 04-30-11 at 12:38 PM.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » event for call to arms


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