• 0

    posted a message on FuBar_AddonSpamFu - Official Thread
    cerbul> Your best bet is, of course, to use addons which have version tracking. The main reason for this is that without any broadcast/reply mechanism, you can not be certain someone doesn't have a particular addon (the addon might just not send any data) in the general case.

    In any particular case you can be reasonably certain someone does not, indeed, have that addon if the addon should have sent some data.

    I will give you some code - set up in two macros - that you can use in order to see who has and who hasn't a particular addon. There are one requirement here, and it is that you NEED to know the prefixes of the addons. I'd recommend checking out the AddonSpamFu code for that (it's in the first 500 lines of the lua file). Another assumption I make is that this is for a raid.


    Setup macro (run once):
    /run if not F then local f = CreateFrame("Frame") F = f f:RegisterEvent("CHAT_MSG_ADDON") f.l={} f:SetScript("OnEvent", function() if not f.l[arg1] then f.l[arg1] = {} end f.l[arg1][arg4] = true end) end


    Check macro (run when you want to check who hasn't a particular prefix):
    /run local p = {"CaN"} local l = F.l for k,v in pairs(p) do if l[v] then for i=1,GetNumRaidMembers() do n=UnitName("raid"..i) if not l[v][n] then m = n..", " end end m=m.." lack" else m="no one has" end ChatFrame1:AddMessage(m.." "..v) end


    To change what addons to look for, change the p = {"CaN"} to p = {prefix,prefix}. CaN is Cartographer Notes, which while fun, is not entirely appropriate in raids, IMHO.
    IMPORTANT NOTE! The number of prefixes you can add in the macro are HIGHLY limited due to the 255 character max macro limit. I would recommend you to only have a maximum of 2 or 3 prefixes (full disclosure - maximum size is p = {12345678901234567890} so remember that.

    Fake edit:
    I have attached a completely drycoded addon that does what the macros do. Note that this addon will eat memory (not enormous amounts, but some) and is thus only recommended to use in raids. It might be possible to load on demand, but I haven't had much experience with that. The lua file contains some helper information at the very top.

    Hope this helps!
    Posted in: FuBar AddOns
  • 0

    posted a message on SpamSentry - Ace2 release
    Load on demand addons are not getting demanded to be loaded, causing all calls in SpamSentry/core.lua to SS_Report to cause failures.
    Posted in: General AddOns
  • 0

    posted a message on Automaton
    Fix for battleground window messing up regular WoW UI elements:
    Change line 144 in Queue.lua from:
    BattlefieldFrame:Hide()
    to
    HideUIPanel(BattlefieldFrame)

    This will prevent the UI panel stuff from messing up Escape not clearing current target.
    Posted in: General AddOns
  • 0

    posted a message on Automaton
    There's a bug in the Gossip module.
    It affects all quests where you have multiple quests completed to the same quest NPC and where the quest data lacks priority.

    The quest where I encountered this was "More Spore Sacs" and "More Tendrils!" from Fahssn but it should be possible to recreate by attempting to turn in any 2 quests at one and the same NPC, where both quests lack the priority property.

    Because all quests lack priority, the quest chosen will be nil - and thus causes a nil error when 'self:Debug("ActiveQuest: "..quests[quest][1])' is executed.

    My solution was to replace the following code:
    function module:CheckQuests(quests, func)
    	if table.getn(quests) > 1 then
    		local quest, priority = nil, 0
    		for k,v in pairs(quests) do
    			self:Debug(k,v)
    			if QuestData[v[1]].priority and QuestData[v[1]].priority > priority then
    				priority = QuestData[v[1]].priority
    				quest = k
    			end
    		end
    		self:Debug("ActiveQuest: "..quests[quest][1])
    with this:
    function module:CheckQuests(quests, func)
    	if table.getn(quests) > 1 then
    		local quest, priority = nil, 0
    		for k,v in pairs(quests) do
    			self:Debug(k,v)
    			if QuestData[v[1]].priority and QuestData[v[1]].priority > priority then
    				priority = QuestData[v[1]].priority
    				quest = k
    			end
    		end
    		if not quest then 
    			quest = 1
    		end
    		self:Debug("ActiveQuest: "..quests[quest][1])
    This quick fix checks to see if quest is nil/false, and if so, simply chooses the first quest. This should work, but only as long as 1 works as an index. It will also fail if false is used as a key in the quests table, of course.
    Posted in: General AddOns
  • 0

    posted a message on FuBar_AddonSpamFu - Official Thread
    You can get the addon name from AceComm if you are willing to add a special-case for it.

    When someone sends stuff, you will get the AceComm hash (the "k?" - which probably has more chars to it).

    The hash can be used to get the prefix - which in most AceComm:d addons is its name.

    Thus, when checking the name, you could do a simple lookup. Note that I am not at all clear on how to retrieve an/the AceComm instance, but I am guessing that someone out there can do it, hence the RetrieveAceCommInstance function.

    function DoAceCommPrefixLookup(messagePrefix)
    	local AceComm = RetrieveAceCommInstance()
    	if ( AceComm ) and ( type(AceComm.prefixHashToText) == "table" ) then
    		local realPrefix = AceComm.prefixHashToText[messagePrefix];
    		if ( type(realPrefix) == "string" ) then return realPrefix; end
    	end
    	return messagePrefix;
    end

    I will do some private checking on this when I get home.
    Posted in: FuBar AddOns
  • 0

    posted a message on Is there a good resource for timing Events in Ace?
    This seems like a major problem - I had assumed that you could do a "regular" :RegisterEvent(eventName), :ScheduleRepeatingEvent(eventName, delay) and :CancelScheduledEvent(eventName).

    Is there a reason why this can not be done, or is it a bug?
    Posted in: Lua Code Discussion
  • To post a comment, please or register a new account.