Thread Tools Display Modes
05-01-11, 04:57 AM   #1
Moto600
A Defias Bandit
Join Date: May 2011
Posts: 2
COMBAT_LOG_EVENT_UNFILTERED help :)

Can anyone help me to get this work for 4.1

Code:
local CatataIA = CreateFrame("Frame","CatataIA",UIParent)
CatataIA:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
local announce = 1
interrupt_spells = {57994, 80965, 80964, 6552, 2139, 1766, 47528, 47476, 853, 15487, 16979, 12809, 100}
CatataIA:SetScript("OnEvent", function(self,event,...)
	local timestamp, event_type, hide_Caster, source_GUID, source_name, source_flags, dest_GUID, dest_name, dest_flags = select(1, ...)
	if (event_type == "SPELL_INTERRUPT") then
		local source_spellID, source_spellName, source_spellSchool,target_spellID, target_spellName, target_spellSchool = select(9, ...)
		 if (tContains(interrupt_spells, source_spellID)) then
		 end
		if(GetUnitName("player") == source_name) then
			SendChatMessage("KICKED >" .. dest_name .. "< " .. "")
			-- if(GetNumRaidMembers()==0) then
				-- SendChatMessage("KICKED >" .. dest_name .. "< " .. "")
			-- else
				-- SendChatMessage("KICKED >" .. dest_name .. "< " .. "")
			-- end
		end
	end
    if (event_type == "SPELL_CAST_SUCCESS") then
		local source_spellID, source_spellName, source_spellSchool,target_spellID, target_spellName, target_spellSchool = select(9, ...)
        if (tContains(interrupt_spells, source_spellID)) then
            if (source_name == GetUnitName("player") and announce == 1) then
            end
        end
    end
end)
yours Carmen<3
  Reply With Quote
05-01-11, 07:08 AM   #2
liquidbase
A Warpwood Thunder Caller
 
liquidbase's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2010
Posts: 97
You must alter the parameters for COMBAT_LOG_EVENT_UNFILTERED from

Code:
local timestamp, event_type, hide_Caster, source_GUID, source_name, source_flags, dest_GUID, dest_name, dest_flags = select(1, ...)
to

Code:
local timestamp, eventType, hideCaster, sourceGUID, sourceName, sourceFlags, destGUID, destName, destFlags = select(1, ...)
  Reply With Quote
05-01-11, 07:15 AM   #3
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,360
the name of the variable is irrelevant, you just need to shift the parameter selection 1 position.

select(9, to select(10, in a couple places.
  Reply With Quote
05-01-11, 07:25 AM   #4
Ketho
A Pyroguard Emberseer
 
Ketho's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,026
sorry, but I just have to say it. that whole addon is a mess
  Reply With Quote
05-01-11, 08:19 AM   #5
Moto600
A Defias Bandit
Join Date: May 2011
Posts: 2
@ Dridzt
THX <3 nice

@ Ketho
but it work^^

carmen
  Reply With Quote
05-01-11, 12:20 PM   #6
Vlad
A Molten Giant
 
Vlad's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 793
Wrote for fun. Also wouldn't it be best to remove interrupt matching and just let it report any kind of interrupt the player does toward a target?

Code:
local interrupts = {
  ["100"] = 1, -- Charge
  ["853"] = 1, -- Hammer of Justice
  ["1766"] = 1, -- Kick
  ["2139"] = 1, -- Counterspell
  ["6552"] = 1, -- Pummel
  ["12809"] = 1, -- Concussion Blow
  ["15487"] = 1, -- Silence
  ["47476"] = 1, -- Strangulate
  ["47528"] = 1, -- Mind Freeze
  ["57994"] = 1, -- Wind Shear
  ["80964"] = 1, -- Skull Bash (Bear Form)
  ["80965"] = 1, -- Skull Bash (Cat Form)
}
local addon = CreateFrame("Frame")
addon:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
addon:SetScript("OnEvent", function(...)
  local timestamp, eventType, hideCaster, sGUID, sName, sFlags, dGUID, dName, dFlags = select(3, ...)
  if sName == UnitName("player") and eventType == "SPELL_INTERRUPT" then
    local spellId, spellName, spellSchool, espellId, espellName, espellSchool = select(12, ...)
    if interrupts[tostring(spellId)] then
      local chat = GetRealNumRaidMembers() > 0 and "RAID" or GetRealNumPartyMembers() > 1 and "PARTY" or "YELL"
      SendChatMessage(format("--- Interrupted %s's %s ---", dName, spellName), chat)
    end
  end
end)
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » COMBAT_LOG_EVENT_UNFILTERED help :)


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