1. #1

    Announcing addon not working as expected

    Hello i need your help :< I try create my addon and i get problem with script for announce trinket and wotf in party one each extract from SaySapped
    if i active(playing arena/bg's) I get a lot to announce more than 10 time and AddOn Memory more 4mb if inactive(slacking) my addon memory 40~kb
    how i can fix it ?
    sorry for my very bad english
    Thx

  2. #2
    Deleted
    Well, there's not much we can do without seeing the code. Could you post it (using [code][/code] tags)?

  3. #3
    Last edited by lawomous; 2012-03-31 at 05:38 PM.

  4. #4
    Wow, that code was horrible to read. Give this a shot:
    Code:
    local spellIds = {
    	[42292] = "SPELL_CAST_SUCCESS",
    	[7744] = "SPELL_CAST_SUCCESS",
    };
    
    local f = CreateFrame("frame");
    f:SetScript("OnEvent", function(self, event, ...) f[event](f, ...); end);
    f:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED");
    
    
    
    function f:COMBAT_LOG_EVENT_UNFILTERED(...)
    	local _, event, _, sourceGuid, _, _, _, _, _, _, _, spellId, spellName = select(1, ...);
    	if ( sourceGuid == UnitGUID("player") and event == spellIds[spellId] ) then
    		if ( GetNumPartyMembers() > 0 ) then -- not sure about returns
    			SendChatMessage(spellName.." used!", "PARTY");
    		end
    	end
    end
    Last edited by Woogs; 2012-03-31 at 11:03 AM. Reason: small logic change

  5. #5
    same problem if i active playing -
    Last edited by lawomous; 2012-03-31 at 05:39 PM.

  6. #6
    I tested it this afternoon. Works fine for me.

  7. #7
    if you using only this script in lua file then yes work is fine but if added this script in my addon then be spam over10 msg in chat. i search solution this problem except creation of the new addon only with trinket announce :<
    Code:
    function events:UNIT_SPELLCAST_SUCCEEDED(unitID, spell, rank, lineID, spellID)
        if not trinkets[unitID] then
            return
        end
        if spellID == 59752 or spellID == 42292 then
            CooldownFrame_SetTimer(trinkets[unitID], GetTime(), 120, 1)
            SendChatMessage("Trinket used by: "..GetUnitName(unitID, true), "PARTY")
        elseif spellID == 7744 then
            CooldownFrame_SetTimer(trinkets[unitID], GetTime(), 45, 1)
            SendChatMessage("WotF used by: "..GetUnitName(unitID, true), "PARTY")
        end
    end
    this is good work on arena versus enemy without spam etc maybe from this can extract ?
    Last edited by pedrox; 2012-03-31 at 08:33 PM.

  8. #8
    Code:
    	
    	if spellID == 7744 and source == pName then -- WILL OF THE FORSAKEN
    				spellinfo = GetSpellInfo(spellID)
    				spelllinkinfo = GetSpellLink(spellID)
    				RSA_Replacements = {["[SPELL]"] = spellinfo, ["[LINK]"] = spelllinkinfo, ["[TARGET]"] = source,}
    				if RSA.db.profile.General.Spells.WOTF.Messages.Start ~= "" then
    					if RSA.db.profile.General.Spells.WOTF.Local == true then
    						RSA_Print_LibSink(string.gsub(RSA.db.profile.General.Spells.WOTF.Messages.Start, ".%a+.", RSA_String_Replace))
    					end
    					if RSA.db.profile.General.Spells.WOTF.CustomChannel.Enabled == true then
    						RSA_Print_Channel(string.gsub(RSA.db.profile.General.Spells.WOTF.Messages.Start, ".%a+.", RSA_String_Replace), RSA.db.profile.General.Spells.WOTF.CustomChannel.Channel)
    					end
    					if RSA.db.profile.General.Spells.WOTF.Smart.Say == true then
    						RSA_Print_Say(string.gsub(RSA.db.profile.General.Spells.WOTF.Messages.Start, ".%a+.", RSA_String_Replace))
    					end
    					if RSA.db.profile.General.Spells.WOTF.Smart.RaidParty == true then
    						RSA_Print_Smart_RaidParty(string.gsub(RSA.db.profile.General.Spells.WOTF.Messages.Start, ".%a+.", RSA_String_Replace))
    					end
    					if RSA.db.profile.General.Spells.WOTF.Party == true then
    						if RSA.db.profile.General.Spells.WOTF.Smart.RaidParty == true and GetNumRaidMembers() == 0 and InstanceType ~= "arena" then return end
    							RSA_Print_Party(string.gsub(RSA.db.profile.General.Spells.WOTF.Messages.Start, ".%a+.", RSA_String_Replace))
    					end
    					if RSA.db.profile.General.Spells.WOTF.Raid == true then
    						if RSA.db.profile.General.Spells.WOTF.Smart.RaidParty == true and GetNumRaidMembers() > 0 then return end
    						RSA_Print_Raid(string.gsub(RSA.db.profile.General.Spells.WOTF.Messages.Start, ".%a+.", RSA_String_Replace))
    					end
    				end
    From Reali's Spell Announcer good working without spam. Maybe anyone help import and added code for trinket.

  9. #9
    up. problem isn't solved

Posting Permissions

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