View Single Post
12-06-12, 02:20 AM   #23
gmarco
An Onyxian Warder
 
gmarco's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 362
Thanks for the reply.

I fix the code and try but also with these modifications it sometime identified the bosses like players.

I paste a debug from an error of buggrabber.


Code:
7x Remgank-0.5\core.lua:149: bad argument #6 to "string_format" (string expected, got nil)
<in C code>
Remgank-0.5\core.lua:149: in function <Remgank\core.lua:116>

Locals:
self = remgankframe_cleu {
 0 = <userdata>
}
event = "COMBAT_LOG_EVENT_UNFILTERED"
HOSTILE_PLAYER = 320
timeStamp = 1354742499.932
event = "SWING_DAMAGE"
hideCaster = false
sourceGUID = "0xF550EC4B0012073A"
sourceName = "Sha della Rabbia"
sourceFlags = 68168
sourceRaidFlags = 0
destGUID = "0x05000000049A36BF"
destName = "Axilea"
destFlags = 1297
destRaidFlags = 0
prefixParam1 = 493671
prefixParam2 = 212274
dummyparam = 1
suffixParam1 = nil
suffixParam2 = nil
(*temporary) = <func> @FrameXML\RestrictedInfrastructure.lua:116
bit_bor = <func> =[C]:-1
COMBATLOG_OBJECT_REACTION_HOSTILE = 64
COMBATLOG_OBJECT_CONTROL_PLAYER = 256
playerGUID = "0x05000000049A36BF"
bit_band = <func> =[C]:-1
string_format = <func> =[C]:-1
prgname = "|cffffd200remgank|r"
RemGank_Add_Player = <func> @Remgank\core.lua:28

Here is the part of code interested ...

Lua Code:
  1. local HOSTILE_PLAYER = bit_bor(COMBATLOG_OBJECT_REACTION_HOSTILE, COMBATLOG_OBJECT_CONTROL_PLAYER)
  2.     local timeStamp, event, hideCaster, sourceGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, destRaidFlags, prefixParam1, prefixParam2, dummyparam, suffixParam1, suffixParam2 = ...
  3.    
  4.     -- proceed with CLEU handling
  5.     if not playerGUID then
  6.         playerGUID = UnitGUID("player")
  7.     end
  8.  
  9.     -- Since these first two conditions apply no matter which event is
  10.     -- firing, check them first.
  11.     if destGUID == playerGUID and bit_band(sourceFlags, HOSTILE_PLAYER) ~= 0 then
  12.         if event == "SWING_DAMAGE" then
  13.             -- Nest checks inside each other instead of using and, so
  14.             -- that if any check matches (eg. it is this event, but not
  15.             -- the right prefix) the code doesn't keep checking other
  16.             -- things that obviously can never match.
  17.             if prefixParam2 > 0 then
  18.  
  19.                                 --- LINE 149 the one that printed the error above
  20.                 print(string_format("%s: [%s] killed [%s] with %s Melee overkill %s", prgname, sourceName, destName, prefixParam1, suffixParam2))  
  21.  
  22.                 if RemGankDB[sourceName:lower()] == nil then
  23.                     RemGank_Add_Player(sourceName)
  24.                 else   
  25.                     print(string_format("%s: [%s] already present. skipped", prgname, sourceName))
  26.                 end
  27.             end
  28.         elseif event == "SPELL_DAMAGE" or event == "SPELL_PERIODIC_DAMAGE" or event == "RANGE_DAMAGE" then
  29.             if suffixParam2 > 0 then
  30.                 print(string_format("%s: [%s] killed [%s] with %s damage of %s overkill %s", prgname, sourceName, destName, suffixParam1, GetSpellLink(prefixParam1), suffixParam2))
  31.                 if RemGankDB[sourceName:lower()] == nil then
  32.                     RemGank_Add_Player(sourceName)
  33.                 else   
  34.                     print(string_format("%s: [%s] already present. skipped", prgname, sourceName))
  35.                 end
  36.             end
  37.         end
  38.     end

It was a fight with SHA of Anger and I was killed probably by a melee ability.
The addon identified the boss as enemy player :-)

A couple of questions:
1) The error above is due the fact the suffixParam2 is null and this is probably a typo.
Should it be prefixParam2 (prefixParam1 = damage = 493671 prefixParam2 = overkill = 212274) ?

2) The second question. Why addon never mistakes when I am killed by normal mob, but fails on bosses ? It should not be the same check ?
Once identified as enemy player also this http://www.wowhead.com/spell=125311

Thanks again for time and patience in reading this long and boring thread :-)
__________________
This is Unix-Land. In quiet nights, you can hear the Windows machines reboot.

Last edited by gmarco : 12-06-12 at 02:35 AM.
  Reply With Quote