1. #1
    Deleted

    Please help me with lua code

    Code:
    -- Load Variables
    if type(INSraid) ~= "boolean" then
    	INSraid = false;
    else
    end
    if type(INSparty) ~= "boolean" then
    	INSparty = false;
    else
    end
    if type(INSyell) ~= "boolean" then
    	INSyell = true;
    else
    end
    
    if type(INSsay) ~= "boolean" then
    	INSsay = true;
    else
    end
    
    if type(INSself) ~= "boolean" then
     INSself = true;
    else
    end
    
    if type(INSspell) ~= "boolean" then
     INSspell = true;
    else
    end
    
    if type(INStarget) ~= "boolean" then
     INStarget = true;
    else
    end
    
    -- Define Event Action
    local function OnEvent(self, event, ...)
    	if ( event == "PLAYER_LOGIN" ) then
    		self:UnregisterEvent("PLAYER_LOGIN");
    		self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
    	elseif ( event == "COMBAT_LOG_EVENT_UNFILTERED" ) then
    		local numParty	= GetNumPartyMembers();
    		
    		local timestamp, eventType, hideCaster, sourceGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, destRaidFlags, spellID, spellName, _, extraskillID, extraskillname = ...; 
    		if (eventType == "SPELL_INTERRUPT") and sourceName == UnitName("player") then
    			intmsg = ("Interrupted");
    			if(INStarget == true) then
    				intmsg = (intmsg.." "..destName)
    			end
    
    			if(INSspell == true) then
    				if(INStarget == true) then
    					intmsg = (intmsg.."'s "..GetSpellLink(extraskillID))
    				else
    					intmsg = (intmsg.." "..GetSpellLink(extraskillID))
    				end
    			end
    
    			if UnitInRaid("player") and (INSraid == true) then
    				SendChatMessage(intmsg, "RAID")
    			elseif UnitInParty("player") and (INSparty == true) and (numParty > 0) then
    				SendChatMessage(intmsg, "PARTY")
    			end
    			if (INSyell == true) then
    				SendChatMessage(intmsg, "YELL")
    			end
    			if (INSsay == true) then
    				SendChatMessage(intmsg, "SAY")
    			end
    			if (INSself == true) then
    				print(intmsg)
    			end
    		end
    	end;
    end
    
    -- Register Event
    local SuccessfulInterruptAnnouncer = CreateFrame("Frame")
    SuccessfulInterruptAnnouncer:RegisterEvent("PLAYER_LOGIN")
    SuccessfulInterruptAnnouncer:SetScript("OnEvent", OnEvent)
    I have this part of the code but doesn't work with some interrupts lately. What should I change to make it work? Thanks

  2. #2
    Deleted
    What interrupts doesn't it work with?

    Also, holy global leak batman.
    What did the poor namespace do to you to deserve being mutilated like that?

  3. #3
    Deleted
    Spell Lock, gag order, Avenger's Shield
    What about namespace?

  4. #4
    Quote Originally Posted by Treeston View Post
    Also, holy global leak batman.
    What did the poor namespace do to you to deserve being mutilated like that?
    At least he prefixed "INS" in the variables ^^

    Quote Originally Posted by arapis View Post
    Spell Lock, gag order, Avenger's Shield
    If it doesn't show up these certain spells then I'm thinking the SPELL_INTERRUPT event didn't fire; or it's only silencing instead of interrupting. otherwise I don't know :s

  5. #5
    Deleted
    Any help please? What should i change?

  6. #6
    When you say it doesn't work for Gag Order, do you mean it doesn't work in conjunction with Heroic Throw or does it not work with Pummel either?

    If the former my thought is similar to Ketho, silences aren't triggering the SPELL_INTERRUPT event. I believe silence effects put a debuff on the target, perhaps you can check for that.
    Psuedocode only as I can't post real code yet but,

    if eventType == "SPELL_AURA_APPLIED" and destName == UnitName("target") and spellID == (id's of silence debuffs) then

    Might work for you. Now if these spells don't actually put a debuff on the target then this is useless and I'll try and think of something else

  7. #7
    Deleted
    i got this error now after adding it actually
    Code:
    Message: ...lInterruptAnnouncer\SuccessfulInterruptAnnouncer.lua:83: attempt to concatenate a nil value
    Time: 10/15/11 16:34:29
    Count: 10
    Stack: ...lInterruptAnnouncer\SuccessfulInterruptAnnouncer.lua:83: in function <...lInterruptAnnouncer\SuccessfulInterruptAnnouncer.lua:36>
    
    Locals: self = <unnamed> {
    0 = <userdata>
    }
    event = "COMBAT_LOG_EVENT_UNFILTERED"
    numParty = 4
    timestamp = 1318689275.11
    eventType = "SPELL_AURA_APPLIED"
    hideCaster = false
    sourceGUID = "0x05000000040A7517"
    sourceName = "Daroyce-Frostmane"
    sourceFlags = 1298
    sourceRaidFlags = 0
    destGUID = "0xF130191A00007668"
    destName = "Anguished Dead"
    destFlags = 68168
    destRaidFlags = 0
    spellID = 31935
    spellName = "Avenger's Shield"
    _ = 2
    extraskillID = "DEBUFF"
    extraskillname = nil
    (*temporary) = "Interrupted"
    (*temporary) = " "
    (*temporary) = nil
    (*temporary) = "DEBUFF"
    (*temporary) = "attempt to concatenate a nil value"
    -- Load Variables
    if type(INSraid) ~= "boolean" then
    INSraid = false;
    else
    end
    if type(INSparty) ~= "boolean" then
    INSparty = false;
    else
    end
    if type(INSyell) ~= "boolean" then
    INSyell = true;
    else
    end

    if type(INSsay) ~= "boolean" then
    INSsay = true;
    else
    end

    if type(INSself) ~= "boolean" then
    INSself = true;
    else
    end

    if type(INSspell) ~= "boolean" then
    INSspell = true;
    else
    end

    if type(INStarget) ~= "boolean" then
    INStarget = true;
    else
    end

    Code:
    -- Define Event Action
    local function OnEvent(self, event, ...)
    	if ( event == "PLAYER_LOGIN" ) then
    		self:UnregisterEvent("PLAYER_LOGIN");
    		self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
    	elseif ( event == "COMBAT_LOG_EVENT_UNFILTERED" ) then
    		local numParty	= GetNumPartyMembers();
    		
    		local timestamp, eventType, hideCaster, sourceGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, destRaidFlags, spellID, spellName, _, extraskillID, extraskillname = ...; 
    		if (eventType == "SPELL_INTERRUPT") and sourceName == UnitName("player") then
    			intmsg = ("Interrupted");
    			if(INStarget == true) then
    				intmsg = (intmsg.." "..destName)
    			end
    
    			if(INSspell == true) then
    				if(INStarget == true) then
    					intmsg = (intmsg.."'s "..GetSpellLink(extraskillID))
    				else
    					intmsg = (intmsg.." "..GetSpellLink(extraskillID))
    				end
    			end
    
    			if UnitInRaid("player") and (INSraid == true) then
    				SendChatMessage(intmsg, "RAID")
    			elseif UnitInParty("player") and (INSparty == true) and (numParty > 0) then
    				SendChatMessage(intmsg, "PARTY")
    			end
    			if (INSyell == true) then
    				SendChatMessage(intmsg, "YELL")
    			end
    			if (INSsay == true) then
    				SendChatMessage(intmsg, "SAY")
    			end
    			if (INSself == true) then
    				print(intmsg)
    			end
    		
    		elseif (eventType == "SPELL_AURA_APPLIED") and destName == UnitName("target") and spellID == ("31935" or "24259" or "12311" or "12958") then
    			intmsg = ("Interrupted");
    			if(INStarget == true) then
    				intmsg = (intmsg.." "..destName)
    			end
    
    			if(INSspell == true) then
    				if(INStarget == true) then
    					intmsg = (intmsg.."'s "..GetSpellLink(extraskillID))
    				else
    					intmsg = (intmsg.." "..GetSpellLink(extraskillID))
    				end
    			end
    
    			if UnitInRaid("player") and (INSraid == true) then
    				SendChatMessage(intmsg, "RAID")
    			elseif UnitInParty("player") and (INSparty == true) and (numParty > 0) then
    				SendChatMessage(intmsg, "PARTY")
    			end
    			if (INSyell == true) then
    				SendChatMessage(intmsg, "YELL")
    			end
    			if (INSsay == true) then
    				SendChatMessage(intmsg, "SAY")
    			end
    			if (INSself == true) then
    				print(intmsg)
    			end
    		end
    	end
    end

  8. #8
    Deleted
    There is no extraskillID when using SPELL_AURA_APPLIED.

    Also, (id or id or id or id) will only match the first ID, not all of them. Use (spellID == id) or (spellID == id) or (spellID == id).

  9. #9
    Deleted
    I made it work and thanks for that. When i tested spell lock though (didn't test the others yet) it announces 2 times. I think 1 for interrupt and 1 when the aura fades out :S

  10. #10
    Deleted
    bump bump

  11. #11
    There's a difference between interrupts and silences. Silences are debuffs, that is why you listen for SPELL_AURA_APPLIED events. When you see double messages, it is because you are using a cooldown that is both an interrupt and silence. I added SPELL_AURA_REMOVED and changed the output text a bit. Didn't test it. Good luck with your coding.

    Code:
    -- Define Event Action
    local function OnEvent(self, event, ...)
    	if ( event == "PLAYER_LOGIN" ) then
    		self:UnregisterEvent("PLAYER_LOGIN");
    		self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
    	elseif ( event == "COMBAT_LOG_EVENT_UNFILTERED" ) then
    		local numParty	= GetNumPartyMembers();
    		
    		local timestamp, eventType, hideCaster, sourceGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, destRaidFlags, spellID, spellName, _, extraskillID, extraskillname = ...; 
    		if (eventType == "SPELL_INTERRUPT") and sourceName == UnitName("player") then
    			intmsg = ("Interrupted");
    			if(INStarget == true) then
    				intmsg = (intmsg.." "..destName)
    			end
    
    			if(INSspell == true) then
    				if(INStarget == true) then
    					intmsg = (intmsg.."'s "..GetSpellLink(extraskillID))
    				else
    					intmsg = (intmsg.." "..GetSpellLink(extraskillID))
    				end
    			end
    
    			if UnitInRaid("player") and (INSraid == true) then
    				SendChatMessage(intmsg, "RAID")
    			elseif UnitInParty("player") and (INSparty == true) and (numParty > 0) then
    				SendChatMessage(intmsg, "PARTY")
    			end
    			if (INSyell == true) then
    				SendChatMessage(intmsg, "YELL")
    			end
    			if (INSsay == true) then
    				SendChatMessage(intmsg, "SAY")
    			end
    			if (INSself == true) then
    				print(intmsg)
    			end
    		
    		elseif (eventType == "SPELL_AURA_APPLIED") and destName == UnitName("target") and spellID == ("31935" or "24259" or "12311" or "12958") then
    			intmsg = ("Silence Applied");
    			if(INStarget == true) then
    				intmsg = (intmsg.." "..destName)
    			end
    
    			if(INSspell == true) then
    				if(INStarget == true) then
    					intmsg = (intmsg.."'s "..GetSpellLink(extraskillID))
    				else
    					intmsg = (intmsg.." "..GetSpellLink(extraskillID))
    				end
    			end
    
    			if UnitInRaid("player") and (INSraid == true) then
    				SendChatMessage(intmsg, "RAID")
    			elseif UnitInParty("player") and (INSparty == true) and (numParty > 0) then
    				SendChatMessage(intmsg, "PARTY")
    			end
    			if (INSyell == true) then
    				SendChatMessage(intmsg, "YELL")
    			end
    			if (INSsay == true) then
    				SendChatMessage(intmsg, "SAY")
    			end
    			if (INSself == true) then
    				print(intmsg)
    			end
    		elseif (eventType == "SPELL_AURA_REMOVED") and destName == UnitName("target") and spellID == ("31935" or "24259" or "12311" or "12958") then
    			intmsg = ("Silence Removed");
    			if(INStarget == true) then
    				intmsg = (intmsg.." "..destName)
    			end
    
    			if(INSspell == true) then
    				if(INStarget == true) then
    					intmsg = (intmsg.."'s "..GetSpellLink(extraskillID))
    				else
    					intmsg = (intmsg.." "..GetSpellLink(extraskillID))
    				end
    			end
    
    			if UnitInRaid("player") and (INSraid == true) then
    				SendChatMessage(intmsg, "RAID")
    			elseif UnitInParty("player") and (INSparty == true) and (numParty > 0) then
    				SendChatMessage(intmsg, "PARTY")
    			end
    			if (INSyell == true) then
    				SendChatMessage(intmsg, "YELL")
    			end
    			if (INSsay == true) then
    				SendChatMessage(intmsg, "SAY")
    			end
    			if (INSself == true) then
    				print(intmsg)
    			end
    		end
    	end
    end

  12. #12
    Deleted
    Actually this didn't help...still announces twice, both with message "Silence applied" so it doesn't seem to distinguish the two events :/
    Last edited by mmoce011c47402; 2011-10-23 at 12:55 AM.

  13. #13
    Deleted
    any ideas?

  14. #14
    Not sure what to make of that. If it is in fact announcing "Silence applied" when you use the silence, and then saying "Silence applied" again when the silence fades, that means for some reason the SPELL_AURA_APPLIED event is triggering for both. Does what Woogs posted ever announce "Silence Removed"?

  15. #15
    Deleted
    Yes but it announces silence applied and silence removed at the start and at the end. So 4 announces in total. 2+2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •