-
Posted by Balu90 on Tue, 08 Jun 2010 08:18:53
Hello I'm new in WoW Addon programming and I have a problem with
READY_CHECK_CONFIRM
Event.Problem: The Addon should call the function GetRemainBuffTime() if a player in Raid klicks on the confirm-button. But something seems to wrong with Event Arguments... the var "response" witch should return the status of the RaidMember (Ready or not) doesn't have any value and no error occurs.
Problem: The var "id" with returns the ID of the RaidMember, returns something like "raid4" AND "group4". But I want only the "raid4" without the "group4". Is there any possibility?
Here is the part of the code:
function omega_frame.READY_CHECK(self,event,...) omega_out("ReadCheck starts") end function omega_frame.READY_CHECK_CONFIRM(self,event,...) local id,response = ... if(response == 1) then GetRemainBuffTime(id,response) else GetRemainBuffTime(id,response) end end function omega_frame.READY_CHECK_FINISHED(self,event,...) omega_out("ReadCheck ends") end --> EventHandler endomega_frame:SetScript("OnEvent", function(self, event, ...) self[event](self, ...) end)
I hope someone can help me and sorry for my bad english.
-
Posted by jnwhiteh on Tue, 08 Jun 2010 10:55:36
The issue is in your event dispatch. You're not passing the event to your handlers, but you're expecting it, so your arguments are all off by one. The
event
argument is what containsid
, and theid
argument is what containsresponse
as a result of this. I'd sort that out before anything else. -
Posted by Balu90 on Tue, 08 Jun 2010 16:23:14
I tried:
omega_frame:SetScript("OnEvent", function(self, event, ...) self[event](self, event, ...) end)
but its still not working... I get the Event and the ID but no response...
-
Posted by jnwhiteh on Tue, 08 Jun 2010 16:29:11
Just do, very simply:
/run local f = CreateFrame("Frame"); f:RegisterEvent("READY_CHECK_CONFIRM"); f:SetScript("OnEvent", print)
And what do you see when you get that event?
-
Posted by Balu90 on Tue, 08 Jun 2010 17:05:14
table: 29CAD380 READY_CHECK_CONFIRM raid8 true
Ok it seems that it returns true and false -.-
-
Posted by jnwhiteh on Tue, 08 Jun 2010 20:09:51
If you can confirm that it returns false, I'll update the documentation.
-
Posted by Balu90 on Tue, 08 Jun 2010 20:14:30
Yes I can confirm.
-
Posted by jnwhiteh on Tue, 08 Jun 2010 20:17:48
kk.
-
Posted by Balu90 on Wed, 09 Jun 2010 07:21:33
And many thanks !!
My Addon is now working =)