-
Posted by magnusXcaboose on Mon, 21 Jun 2010 18:37:14
I have written the code to CombatTracker XML from Version 1 of the book. The ##Description was changed to ## Notes. The extra i in the first line was removed. When I load the game, the addon shows up in the addon list, yet the frame is not showing. Can anyone help me please?
-
Posted by jnwhiteh on Mon, 21 Jun 2010 22:14:17
Can you please give me some more information. Is there anything in your Logs\FrameXML.log file? Do you have Lua Errors enabled? Are you getting any errors when logging into the game? Have you downloaded the code from this website and compared it to your version to see what might be different?
-
Posted by magnusXcaboose on Mon, 21 Jun 2010 22:24:50
I check my Logs folder. Turns out I had written MiniMap instead of Minimap. It's working now. Thank you very much!
-
Posted by jnwhiteh on Mon, 21 Jun 2010 22:32:36
Glad to hear it!
-
Posted by magnusXcaboose on Tue, 22 Jun 2010 15:52:02
I've hit another snag. When I load the game, the addon shows (I can drag it, click it. It changes to "In Combat"). But the "end_ time = GetTime()" and "start_ time = GetTime()" lines don't seem to be working, since I am having 19000-ish as my time, rather than 12. But I do know that it's going into the loop, since it showed the damage done as 0.01, up from 0.00 after about a minute of combat, so the "average_ dps = total_ damage / total_ time" line is working. Is there anything I have to do with GetTime() first?
Along with this, the damage counter doesn't reset itself when I re-enter combat. I have the line "total_damage = 0". So the program realizes that I am in combat, but it doesn't reset the counter for damage.
Here's my code for OnEvent.
function CombatTracker_OnEvent(frame, event, ...) if event == "PLAYER_REGEN_ENABLED" then end_time = GetTime() total_time = end_time - start_time average_dps = total_damage / total_time CombatTracker_UpdateText() elseif event == "PLAYER_REGEN_DISABLED" then CombatTrackerFrameText:SetText("In Combat") total_damage = 0 start_time = GetTime() elseif event == "UNIT_COMBAT" then if not InCombatLockdown() then else local unit,action,modifier,damage,damagetype = ... if unit == "player" and action ~= "HEAL" then total_damage = total_damage + damage end_time = GetTime() total_time = end_time - start_time average_dps = total_damage / total_time CombatTracker_UpdateText() end end end end
-
Posted by magnusXcaboose on Tue, 22 Jun 2010 16:02:01
I think I found the problem.
frame:RegisterEvent("PLAYER_REGEN_ DISABLED")
It had a space there, it should read...
frame:RegisterEvent("PLAYER_REGEN_DISABLED")
Of course I won't be able to test until the servers are back up.
-
Posted by jnwhiteh on Tue, 22 Jun 2010 17:41:09
That would certainly make sense, although it's hard to tell at a glance.