Files
OEVGandClaude Opus 5.5 2c58ce2aa3 Merge the ShaguTweaks Extras ClassicAPI modules into ShaguTweaks (3.7)
Bring in 27 module files from Dusk/ShaguTweaks-Extras-ClassicAPI
(8e14bb4): action bar, chat, loot, macro, merchant (Buy Em All),
minimap & world map, tooltip and unit frame modules, with their
textures. Titles are unchanged, so saved toggles carry over.

- Categories: Chat -> Chat & Social, World Map -> Minimap & World Map,
  Merchant & Auction -> Merchant; Macro is a new category.
- Texture paths point at ShaguTweaks\img.
- Not merged: Raid Frames, Bag Item Click and Bag Search Bar (Bagshui
  covers them), Auction Alt-Buy (aux covers it).
- Chat note when the old ShaguTweaks-extras addon is still enabled.
- English translation keys, notices, license copy, asset provenance,
  README, changelog and version 3.7.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019W3rwusM4i1CYaHQAYixJ7
2026-11-02 21:52:53 +00:00

93 lines
2.1 KiB
Lua
Executable File

-- Adapted from TokensWorth/ShaguTweaks-mods (MIT, original copyright GryllsAddons).
local T = ShaguTweaks.T
local Filter = ShaguTweaks.ExtrasChatFilter
local module = ShaguTweaks:register({
title = T["Block NPC Spam"],
description = T["Blocks known repetitive NPC say/yell spam messages."],
expansions = { ["vanilla"] = true, ["tbc"] = nil },
category = T["Chat & Social"],
enabled = nil,
})
local blockedEvents = {
["CHAT_MSG_MONSTER_SAY"] = true,
["CHAT_MSG_MONSTER_YELL"] = true,
}
local blockedNPCs = {}
local npcNames = {
-- enUS
"Tansy Sparkpen",
"Fara Boltbreaker",
"Shellcoin Promoter",
-- ruRU
"Зазывала ярмарки Новолуния",
"Томас Миллер",
"Уильям",
"Донна",
"Жюстина Демалье",
"Мерлис Малаган",
"Лиана Пирс",
"Сюзанна",
"Джейни Аншип",
}
for _, name in pairs(npcNames) do
blockedNPCs[name] = true
blockedNPCs[string.lower(name)] = true
end
local blockedPhrases = {
{ "shellcoin", "invest" },
{ "shells", "trade" },
{ "shells", "money" },
}
local function IsBlockedNPC(sender)
if not sender then return false end
return blockedNPCs[sender] or blockedNPCs[string.lower(sender)] or false
end
local function IsBlockedPhrase(message)
if not message then return false end
local normalized = string.lower(string.gsub(message, "[^A-Za-z0-9]", ""))
for _, phrase in pairs(blockedPhrases) do
local matched = true
for _, word in pairs(phrase) do
if not string.find(normalized, word, 1, true) then
matched = false
break
end
end
if matched then return true end
end
return false
end
local function FilterNPCSpam(event)
if not blockedEvents[event] then return false end
if not arg1 or not arg2 then return false end
return IsBlockedNPC(arg2) or IsBlockedPhrase(arg1)
end
module.enable = function(self)
if Filter then
Filter:Register("BlockNPCSpam", FilterNPCSpam)
end
end
module.disable = function(self)
if Filter then
Filter:Unregister("BlockNPCSpam")
end
end