Thread Tools Display Modes
07-17-14, 09:25 PM   #1
morpheusxeno
A Flamescale Wyrmkin
 
morpheusxeno's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 126
Tired of trolls...

I am looking for some help for modifying a small bit of code I found on MMO-Champions

It was originally for announcing who lusted. Well I figure I could also use this to announce who is also being a jack ass and trolling in the raid. I have found the amount of trolling in LFR these days to excessive and annoying.

I have this code so far

-- This file is loaded from "NoTroll.toc"

local spellIds = {
[2825] = "Bloodlust",
[32182] = "Heroism",
[80353] = "Time Warp",
[13159] = "Aspect of Fail",
[41450] = "Blessing of Piss me off",
[73325] = "Leap of Fail",
[34477] = "MD",
[20736] = "Distracting Shot",
[62124] = "Reckoning * paladin",
[56222] = "Dark Command",
[49576] = "Death Grip",
[2649] = "Generic hunter growl",
[39270] = "main target growl",
[103128] = "suffering",
};


local f = CreateFrame("Frame");
f:SetScript("OnEvent", function(self, event, ...) self[event](self, ...); end);
f:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED");


f.COMBAT_LOG_EVENT_UNFILTERED = function(self, _, logEvent, _, _, sourceLogName, _, _, _, _, _, _, spellId, spellName)
if ( logEvent == "SPELL_CAST_SUCCESS" and spellIds[spellId] ~= nil ) then
print(sourceLogName, "used", spellName);
end
end;
I am looking to do a little bit more with it though. I would like it to have toggles with a GUI and simple check boxes that allow it to announce to raid chat or none for each item listed.

I would also like it to announce when the boss is pulled and by who. I know there is an addon called WhoPulled but I wasnt exactly looking to steal work. I would just like it it announce with a yell %t PULLED!!!
__________________
My mother-in-law fell down a wishing well. I was amazed; I never knew they worked...

Last edited by morpheusxeno : 07-18-14 at 08:14 AM.
  Reply With Quote
07-18-14, 03:00 PM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
For simple cast detection like that, I'd recommend using UNIT_SPELLCAST_SUCCEEDED instead of CLEU -- it fires a lot less often. Your event processing is also overkill for an addon handling a single event. Finally, if you're planning to publish this, I'd suggest using localized spell names instead of cutesy euphemisms or abbreviations.

This doesn't incorporate any "who pulled" announcement but it does add toggles for each spell:

Code:
local ADDON,  = ...

local db = {
	[2825]   = true, -- Bloodlust
	[32182]  = true, -- Heroism
	[80353]  = true, -- Time Warp
	[13159]  = true, -- Aspect of Fail
	[41450]  = true, -- Blessing of Piss me off
	[73325]  = true, -- Leap of Fail
	[34477]  = true, -- MD
	[20736]  = true, -- Distracting Shot
	[62124]  = true, -- Reckoning * paladin
	[56222]  = true, -- Dark Command
	[49576]  = true, -- Death Grip
	[2649]   = true, -- Generic hunter growl
	[39270]  = true, -- main target growl
	[103128] = true, -- suffering
}

local f = CreateFrame("Frame", "NoTroll", InterfaceOptionsFramePanelContainer)

-- Main addon logic

f:RegisterEvent("PLAYER_LOGIN")
f:SetScript("OnEvent", function(self, event)
	NoTrollDB = NoTrollDB or db
	db = NoTrollDB
	self:UnregisterEvent("PLAYER_LOGIN")

	self:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED")
	self:SetScript("OnEvent", function(self, event, unit, spellName, _, _, spellID)
		if db[spellID] then
			local name = GetUnitName(unit, false) -- Use true to show the realm name
			print("|cffffff9a[NoTroll]|r", name, "used", spellName)
		end
	end)
end)

-- Options panel

f:Hide()
f:SetScript("OnShow", function(self)
	local title = self:CreateFontString(nil, "ARTWORK", "GameFontNormalLarge")
	title:SetPoint("TOPLEFT", 16, -16)
	title:SetPoint(self.name)

	local notes = Options:CreateFontString(nil, "ARTWORK", "GameFontHighlightSmall")
	notes:SetPoint("TOPLEFT", title, "BOTTOMLEFT", 0, -8)
	notes:SetPoint("RIGHT", -32, 0)
	notes:SetHeight(32)
	notes:SetJustifyH("LEFT")
	notes:SetJustifyV("TOP")
	notes:SetText(GetAddOnMetadata(ADDON, "Notes"))

	local spellNameToID, sortedSpells = {}
	for id in pairs(db) do
		local name = GetSpellInfo(id)
		if name then
			spellNameToID[name] = id
			tinsert(sortedSpells, name)
		end
	end
	sort(sortedSpells)
	
	local boxes = {}
	local breakpoint = 1 + floor(#sortedSpells / 2)
	local function ClickBox(self)
		local checked = not not self:GetChecked()
		PlaySound(checked and "igMainMenuOptionCheckBoxOn" or "igMainmenuOptionCheckBoxOff")
		db[self.id] = checked
	end

	for i = 1, #sortedSpells do
		local spell = sortedSpells[i]
		
		local box = CreateFrame("CheckButton", "$parentCheckbox"..i, self, "InterfaceOptionsCheckButtonTemplate")
		box:SetScript("OnClick", ClickBox)
		box.Text:SetText(spell)
		box:SetHitRectInsets(0, -1 * max(box.Text:GetStringWidth(), 100), 0, 0) -- Make whole label clickable instead only the first 100px
		box.id = spellNameToID[spell]
		
		if i == 1 then
			box:SetPoint("TOPLEFT", notes, "BOTTOMLEFT", 0, -16)
		elseif i == breakpoint then
			box:SetPoint("TOPLEFT", notes, "BOTTOM", 0, -16)
		else
			box:SetPoint("TOPLEFT", boxes[i - 1], "BOTTOMLEFT", 0, -8)
		end
		
		boxes[i] = box
	end
	
	function self:refresh()
		for i = 1, #boxes do
			local box = boxes[i]
			box:SetChecked(db[box.id])
		end
	end
	
	self:SetScript("OnShow", nil)
	self:refresh()
end)

-- Register the options panel:

f.name = GetAddOnMetadata(ADDON, "Title")
InterfaceOptions_AddCategory(f)

-- Create a slash command to open the options panel:

_G["SLASH_"..ADDON.."1"] = "/notroll"
SlashCmdList[ADDON] = function()
	InterfaceOptionsFrame_OpenToCategory(f)
	InterfaceOptionsFrame_OpenToCategory(f)
	-- It's called twice on purpose, to work around the long-standing
	-- Blizzard bug that opens the options window to the wrong panel
	-- under certain conditions.
end
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
07-18-14, 05:02 PM   #3
morpheusxeno
A Flamescale Wyrmkin
 
morpheusxeno's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 126
Thanks Phanx you the man. I remember you helping me before on a few things. I am at work right now so I will be testing this when I get home. Appreciate the work you have done.

I do plan on publicly posting it. You are right I should probably fix the foul lanugage lol! I do want the general population to benifit from the mod and hopefully reduce the raid trolling.
__________________
My mother-in-law fell down a wishing well. I was amazed; I never knew they worked...

Last edited by morpheusxeno : 07-18-14 at 05:08 PM.
  Reply With Quote
07-18-14, 08:29 PM   #4
morpheusxeno
A Flamescale Wyrmkin
 
morpheusxeno's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 126
/notroll isnt working. Something preventing the addon loading properly? I have looked through all the code to see if there was an error of any sort. Couldnt find anything thought I am not that great at LUA...
__________________
My mother-in-law fell down a wishing well. I was amazed; I never knew they worked...

Last edited by morpheusxeno : 07-18-14 at 08:47 PM.
  Reply With Quote
07-18-14, 08:40 PM   #5
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by morpheusxeno View Post
Thanks Phanx you the man
Fail..


Originally Posted by morpheusxeno View Post
/notroll isnt working. Something preventing the addon loading properly?
Misplaced comma on the first line, turn your error messages on.
  Reply With Quote
07-18-14, 09:25 PM   #6
morpheusxeno
A Flamescale Wyrmkin
 
morpheusxeno's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 126
Wha? Woman?

I removed the comma. Addon now opens the Addon manager UI thinger :P

Doesnt have anything inside it though, The window is empty.
Attached Thumbnails
Click image for larger version

Name:	WoWScrnShot_071814_213020.jpg
Views:	251
Size:	124.0 KB
ID:	8148  
__________________
My mother-in-law fell down a wishing well. I was amazed; I never knew they worked...

Last edited by morpheusxeno : 07-18-14 at 09:36 PM.
  Reply With Quote
07-18-14, 10:03 PM   #7
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Originally Posted by morpheusxeno View Post
Wha? Woman?
Women do exist on the internet.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
07-19-14, 03:05 AM   #8
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Morpheus first go to your interface settings under help/other and enable "show lua errors".
Second hit /reload.

Once you fixed all the tiny Lua errors that are left you will sit at

NoTroll.lua
Lua Code:
  1. local ADDON, engine = ...
  2.  
  3. --NoTroll = engine
  4.  
  5. local db = {
  6.     [2825]   = true, -- Bloodlust
  7.     [32182]  = true, -- Heroism
  8.     [80353]  = true, -- Time Warp
  9.     [13159]  = true, -- Aspect of Fail
  10.     [41450]  = true, -- Blessing of Piss me off
  11.     [73325]  = true, -- Leap of Fail
  12.     [34477]  = true, -- MD
  13.     [20736]  = true, -- Distracting Shot
  14.     [62124]  = true, -- Reckoning * paladin
  15.     [56222]  = true, -- Dark Command
  16.     [49576]  = true, -- Death Grip
  17.     [2649]   = true, -- Generic hunter growl
  18.     [39270]  = true, -- main target growl
  19.     [103128] = true, -- suffering
  20. }
  21.  
  22. local f = CreateFrame("Frame", nil, InterfaceOptionsFramePanelContainer)
  23.  
  24. -- Main addon logic
  25.  
  26. f:RegisterEvent("PLAYER_LOGIN")
  27. f:SetScript("OnEvent", function(self, event)
  28.     NoTrollDB = NoTrollDB or db
  29.     db = NoTrollDB
  30.     self:UnregisterEvent("PLAYER_LOGIN")
  31.  
  32.     self:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED")
  33.     self:SetScript("OnEvent", function(self, event, unit, spellName, _, _, spellID)
  34.         if db[spellID] then
  35.             local name = GetUnitName(unit, false) -- Use true to show the realm name
  36.             print("|cffffff9a[NoTroll]|r", name, "used", spellName)
  37.         end
  38.     end)
  39. end)
  40.  
  41. -- Options panel
  42.  
  43. f:Hide()
  44. f:SetScript("OnShow", function(self)
  45.     local title = self:CreateFontString(nil, "ARTWORK", "GameFontNormalLarge")
  46.     title:SetPoint("TOPLEFT", 16, -16)
  47.     title:SetText(self.name)
  48.  
  49.     local notes = self:CreateFontString(nil, "ARTWORK", "GameFontHighlightSmall")
  50.     notes:SetPoint("TOPLEFT", title, "BOTTOMLEFT", 0, -8)
  51.     notes:SetPoint("RIGHT", -32, 0)
  52.     notes:SetHeight(32)
  53.     notes:SetJustifyH("LEFT")
  54.     notes:SetJustifyV("TOP")
  55.     notes:SetText(GetAddOnMetadata(ADDON, "Notes"))
  56.  
  57.     local spellNameToID, sortedSpells = {}, {}
  58.     for id in pairs(db) do
  59.         local name = GetSpellInfo(id)
  60.         if name then
  61.             spellNameToID[name] = id
  62.             tinsert(sortedSpells, name)
  63.         end
  64.     end
  65.     sort(sortedSpells)
  66.    
  67.     local boxes = {}
  68.     local breakpoint = 1 + floor(#sortedSpells / 2)
  69.     local function ClickBox(self)
  70.         local checked = not not self:GetChecked()
  71.         PlaySound(checked and "igMainMenuOptionCheckBoxOn" or "igMainmenuOptionCheckBoxOff")
  72.         db[self.id] = checked
  73.     end
  74.  
  75.     for i = 1, #sortedSpells do
  76.         local spell = sortedSpells[i]
  77.        
  78.         local box = CreateFrame("CheckButton", "$parentCheckbox"..i, self, "InterfaceOptionsCheckButtonTemplate")
  79.         box:SetScript("OnClick", ClickBox)
  80.         box.Text:SetText(spell)
  81.         box:SetHitRectInsets(0, -1 * max(box.Text:GetStringWidth(), 100), 0, 0) -- Make whole label clickable instead only the first 100px
  82.         box.id = spellNameToID[spell]
  83.        
  84.         if i == 1 then
  85.             box:SetPoint("TOPLEFT", notes, "BOTTOMLEFT", 0, -16)
  86.         elseif i == breakpoint then
  87.             box:SetPoint("TOPLEFT", notes, "BOTTOM", 0, -16)
  88.         else
  89.             box:SetPoint("TOPLEFT", boxes[i - 1], "BOTTOMLEFT", 0, -8)
  90.         end
  91.        
  92.         boxes[i] = box
  93.     end
  94.    
  95.     function self:refresh()
  96.         for i = 1, #boxes do
  97.             local box = boxes[i]
  98.             box:SetChecked(db[box.id])
  99.         end
  100.     end
  101.    
  102.     self:SetScript("OnShow", nil)
  103.     self:refresh()
  104. end)
  105.  
  106. -- Register the options panel:
  107.  
  108. f.name = GetAddOnMetadata(ADDON, "Title")
  109. InterfaceOptions_AddCategory(f)
  110.  
  111. -- Create a slash command to open the options panel:
  112.  
  113. _G["SLASH_"..ADDON.."1"] = "/notroll"
  114. SlashCmdList[ADDON] = function()
  115.     InterfaceOptionsFrame_OpenToCategory(f)
  116.     InterfaceOptionsFrame_OpenToCategory(f)
  117.     -- It's called twice on purpose, to work around the long-standing
  118.     -- Blizzard bug that opens the options window to the wrong panel
  119.     -- under certain conditions.
  120. end

NoTroll.toc
Code:
## Interface: 50400
## Author: Phanx
## Title: NoTroll
## Notes: I no has do dat!
## SavedVariables: NoTrollDB 

NoTroll.lua
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)

Last edited by zork : 07-19-14 at 03:35 AM.
  Reply With Quote
07-19-14, 09:00 AM   #9
morpheusxeno
A Flamescale Wyrmkin
 
morpheusxeno's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 126
This.
Is.
Fantastic.

I thank you guys AND WOMAN for the code. I have learned a decent bit. I am still trying to find mods that have simple ways of announcing when a boss is pulled. I can only find the mod WhoPulled, but its too much code for me to go through to understand the basics of it. I would like something similar to who pulled written but so much easier. Just an announcement. Not all the extra stuff.

With the new changes I couldn't see in the UI where it allows me to change the output to YELL,SAY,RAID,INSTANCE,PARTY
__________________
My mother-in-law fell down a wishing well. I was amazed; I never knew they worked...

Last edited by morpheusxeno : 07-19-14 at 09:02 AM.
  Reply With Quote
07-19-14, 09:43 AM   #10
Tim
A Rage Talon Dragon Guard
 
Tim's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 308
To send to a specific channel - http://wowpedia.org/API_SendChatMessage

In the example posted on the page
Code:
SendChatMessage("Hello Bob!", "WHISPER", 7, "Bob")
"Hello Bob!" is the message
"WHISPER" is the channel and with whispers you need to provide the 4th parameter "Bob"
7 is the language type, if you don't want any specific language you can set that to nil
"Bob" is the 4th parameter and only needed when using whispers

The only 2 parameters needed to be set when sending to channels are the message and channel, the rest you can ignore.

For example using zork's example to tell you what was casted..
Code:
print("|cffffff9a[NoTroll]|r", name, "used", spellName)
To send a message to a channel you would do
Code:
SendChatMessage("|cffffff9a[NoTroll]|r "..name.." used "..spellName, "SAY")
__________________
AddOns: Tim @ WoWInterface
Characters: Mage, Priest, Devoker, Pally
Battle Tag: Mysterio#11164
Current PC Setup: PCPartPicker List
  Reply With Quote
07-19-14, 07:45 PM   #11
morpheusxeno
A Flamescale Wyrmkin
 
morpheusxeno's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 126
How do I add the UI Elements to control what chat channel each announcement are sent to?
__________________
My mother-in-law fell down a wishing well. I was amazed; I never knew they worked...

Last edited by morpheusxeno : 07-19-14 at 07:55 PM.
  Reply With Quote
07-19-14, 09:56 PM   #12
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Please do not list me as an author in the TOC file (or anywhere else). If you want to include a small "thanks for the help" credit somewhere, that's fine, but I don't want your users coming to me for help with the addon.

Originally Posted by morpheusxeno View Post
How do I add the UI Elements to control what chat channel each announcement are sent to?
You'd need to add either a dropdown menu for each item, or change the checkbox to a series of radio buttons. In either case, the options layout I previously posted will not work for this. You'll need to change it so that each item occupies a full row so there's space for additional controls. I might work something up for you later since this can use the same codebase I'm using in the aura options panel for my oUF layout and won't require much effort to adapt.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.

Last edited by Phanx : 07-19-14 at 09:59 PM.
  Reply With Quote
07-19-14, 10:00 PM   #13
morpheusxeno
A Flamescale Wyrmkin
 
morpheusxeno's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 126
Alright I will make sure its not included. I will definitely include thanks though. Possible help with the others?
You'll need to change it so that each item occupies a full row so there's space for additional controls. I might work something up for you later since this can use the same codebase I'm using in the aura options panel for my oUF layout and won't require much effort to adapt.
Thank you Thank you!
__________________
My mother-in-law fell down a wishing well. I was amazed; I never knew they worked...
  Reply With Quote
07-19-14, 11:09 PM   #14
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Unrelated, I just noticed your signature, and it made me giggle.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
07-19-14, 11:33 PM   #15
morpheusxeno
A Flamescale Wyrmkin
 
morpheusxeno's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 126
Its inappropriate. I set it when I was drunk or something.

There is a few things that I have noticed with the new coding. It will notify in the chat 2 times every time something happens.

I think we also need to address a few issues. We have been using it for a few raids and somethings are a little quirky.

When a pet growl is on, it doesn't say WHOS Pet growled, If we could change that to %t's pet <name> uses [spell].

How much more difficult would it be to display the spell link of the spell casted? Instead of saying Morpheusxeno casted MD to actually put the link of the spell instead.

When a player uses a spell in some cases it needs to be addressed like this %t casts Dark Command on <Target>
It will help pin point easier when some one is abusing another player.
__________________
My mother-in-law fell down a wishing well. I was amazed; I never knew they worked...

Last edited by morpheusxeno : 07-20-14 at 08:59 AM. Reason: prevent double posting
  Reply With Quote
07-20-14, 01:10 PM   #16
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
New version with improved config UI, spell links in messages, and sending to channels. Did not actually test what happens when a spell is cast since my level 1 trial account testing character doesn't have any spells and can't form a group.

http://pastebin.com/QmkusGk9
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
07-20-14, 01:17 PM   #17
morpheusxeno
A Flamescale Wyrmkin
 
morpheusxeno's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 126
Are you USA or EU :P

I will test the new code when I get home, Thank you very much.
__________________
My mother-in-law fell down a wishing well. I was amazed; I never knew they worked...
  Reply With Quote
07-20-14, 01:27 PM   #18
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
I'm in the US, but I don't really have a fixed schedule of any kind (sleep or work, much to my boss' dismay) and I was most recently playing on EU servers.

Originally Posted by morpheusxeno View Post
It will notify in the chat 2 times every time something happens.
Let me know if this is still happening with the new code. It just occurred to me that this will happen if you are targeting the player who cast the spell (once for "target" and once for "raid14" for example) so I'll add a fix for that, but I'm not sure why UNIT_SPELLCAST_SUCCEEDED would fire twice for the same spell otherwise... I guess I'll just add a general "don't send the same message twice in a row" filter.

Edit: Added, see link at bottom.

Originally Posted by morpheusxeno View Post
When a pet growl is on, it doesn't say WHOS Pet growled, If we could change that to %t's pet <name> uses [spell].
Will post a new version shortly with this.

Edit: See link at bottom.

Originally Posted by morpheusxeno View Post
How much more difficult would it be to display the spell link of the spell casted? Instead of saying Morpheusxeno casted MD to actually put the link of the spell instead.
Already in the new code. It will also (in theory) link the player name if it's announcing only to yourself, and locally change the player name to a link in channel announcements. Note that it's not possible to send player links to other players, so it only shows a link in your chat frame.

Originally Posted by morpheusxeno View Post
When a player uses a spell in some cases it needs to be addressed like this %t casts Dark Command on <Target> It will help pin point easier when some one is abusing another player.
The problem with this is that you'd have to go back to using the combat log, which can be thousands of events per second in raid combat. However, you could work around this if the spell(s) in question place a buff or debuff on the target player... let me know if they do.

----------

Edit: New version with changes noted above. No errors on login or in the config panel, but I still didn't test the actual spell announce functionality. Also realized it depends on my dropdown widget lib, so if you're not currently using one of my addons that includes it, you'll need to drop a copy of it into the addon folder and add them to the TOC file. Stick a copy of LibStub in there too; the odds of you not having any libraries with a copy of LibStub already are pretty much zero, but you should have one in the addon for distribution.

http://pastebin.com/1HbNqCtX

Going out to lunch now... will be back in a few hours, but I might go to sleep afterwards, so it might be longer.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.

Last edited by Phanx : 07-20-14 at 01:37 PM.
  Reply With Quote
07-20-14, 06:50 PM   #19
morpheusxeno
A Flamescale Wyrmkin
 
morpheusxeno's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 126
Everything loaded up great, tested with SAY

Used blood lust and got this error

Message: Interface\AddOns\NoTroll\NoTroll.lua:93: bad argument #1 to 'strmatch' (string expected, got nil)
Time: 07/20/14 21:36:12
Count: 1
Stack: [C]: ?
[C]: in function `strmatch'
Interface\AddOns\NoTroll\NoTroll.lua:93: in function `filterFunc'
Interface\AddOns\ElvUI\modules\chat\chat.lua:776: in function `ChatFrame_MessageEventHandler'
Interface\AddOns\ElvUI\modules\chat\chat.lua:1176: in function <Interface\AddOns\ElvUI\modules\chat\chat.lua:1169>

Locals:
The new changes are god damn amazing. You do great work, I would love to see what you own UI looks like
__________________
My mother-in-law fell down a wishing well. I was amazed; I never knew they worked...

Last edited by morpheusxeno : 07-20-14 at 09:38 PM.
  Reply With Quote
07-21-14, 01:28 AM   #20
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Are you sure you have the latest file, and that you reloaded your UI after saving? Line 93 in the last file I linked is just an "end" keyword. I guess it means line 108, but I don't know why it doesn't match... anyway, add this:

Code:
function f:AddLocalMessageLinks(_, message, ...)
        if type(message) ~= "string" then return end
        local name = strmatch(message, ANNOUNCE_PATTERN)
Most likely some other addon you're using is using the chat filter system incorrectly. I had this problem back in Wrath with AtlasLoot somehow causing chat frame AddMessage methods to be sometimes called from somewhere with nil values, but I never bothered to figure out why, and just used this band-aid fix, since it works with minimal overhead and doesn't require digging through other people's code and hoping they care enough to fix their problems.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Search/Requests » Tired of trolls...

Thread Tools
Display Modes

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