WoWInterface SVN NoGuild

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk
    from Rev 10 to Rev 9
    Reverse comparison

Rev 10 → Rev 9

NoGuild.lua
12,32 → 12,27
local L1 = {
"<", ">", "%%", "%*", "%d/%d", "%d%-%d", "%d:%d%d", "%d ?[ap]m",
"bank tab",
"free guild repair", "free repair",
"fast track", "free guild repair", "free repair",
"guild", "giuld", "gulid",
"le?ve?l ?25",
"main raid", "member", "memeber",
"perk", "progressio?ng?", "pv[ep] guild",
"mount up", "mr. popularity", "mumble",
"perk",
"recruit", "reqruit",
"mumble", "teamspeak", "ventrilo",
"http", "www", ".com", ".net", ".org",
"teamspeak",
"ventrilo",
"monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday",
"tues", "thurs?",
-- German
"%d ?uhr",
"bankfächern", "bewerbung",
"gilde[n%s]", "gildenboni", "gildenname", "gildensatzung", "gildenstamm",
"levelboni", "levelgilde",
"pv[ep]%-?gilde",
"raid%-?tage", "raidgilde", "raidorientert", "raidzeit", "rekrutier",
"stammplatz", "stufe ?25", "%f[%a]such[et] .*gilde%f[%A]",
"gilde[n%s]", "raid%-?tage",
"montag", "dienstag", "mittwoch", "donnerstag", "freitag", "samstag", "sonntag",
}
 
-- And probably at least one of these words.
local L2 = {
"[{}]",
"[^i]le?ve?l? ?%d",
"active", "applicant", "apply",
"casual", "consider[ei][dn]g?", "content", "core",
"casual", "consider[ei][dn]g?", "core",
"exceptional", "e?xpe?r?i?e?n?c?e?",
"farm", "fill", "focus", "fun",
"goal",
47,33 → 42,22
"laid back", "looking",
"member",
"newly formed", "nice",
"pacific", "player", "progression", "pve", "pvp",
"raid", "rbg", "realm", "repu?t?a?t?i?o?n?", "roster",
"pacific", "progression", "pve", "pvp",
"raid", "rbg", "repu?t?a?t?i?o?n?", "roster",
"server time", "skilled", "social",
"tabard", "times",
"unlock",
"ventr?i?l?o?",
"want", "we are", "we plan t?on?", "weekend", "weekly", "would you like",
-- German
"18 jahren",
"aktive", "anfänger", "atmosphäre", "aufz?u?bau", "bock",
"entsprechend", "erfahren", "farmen", "gründe", "hoffe", "interesse", "klasse",
"leveln", "lust", "möchte", "motivierte", "pflichten",
"sozial", "spaß", "spieler", "stamm",
"verplichtung", "verstärkung", "wilkommen",
"atmosphäre", "farmen", "interesse", "leveln", "pflichten", "spaß", "verstärkung",
}
 
-- Guild spam usually does not contain these words.
local OK = {
"|hachivement", "|hinstancelock", "|hitem", "|hquest", "|htrade",
"arena", "[235]v[235]", " [235]s",
"challenge mode", "cm gold", "flex", "^lf ", "lfm", "lfg", "scenario", -- "tank", "heal", "dps",
"ffa", "no reserve",
-- "galak", "%f[%a]sha%f[%A]", "%f[%a]soo%f[%A]",
"^lf", "lfm", "lfg", "tank", "heal", "dps", "scenario", "ffa", "no reserve",
"|ha?c?h?[iq][tu]?e[vms]", -- achievement/item/quest OK
"wt[bs]",
-- German
"heute", "morgen",
"gildengruppe", " id ", "kaufe", "rbg push", "szenario", "vk ",
}
 
------------------------------------------------------------------------
102,28 → 86,6
 
local seen, last, result = {}
 
local function check(message)
local score = 0
local messagelower = gsub(strlower(message), "{.-}", "")
for i = 1, #L1 do
if strfind(messagelower, L1[i]) then
score = score + 3
end
end
for i = 1, #L2 do
if strfind(messagelower, L2[i]) then
score = score + 1
end
end
for i = 1, #OK do
if strfind(messagelower, OK[i]) then
score = score - 4
end
end
return score
end
GuildSpamScore = check
 
local function exspaminate(self, event, message, sender, _, _, _, flag, _, channelID, _, _, line, guid)
if line == last then
return result
162,10 → 124,10
end
 
local score = 0
local messagelower = gsub(strlower(message), "{.-}", "")
local messagelower = strlower(message)
for i = 1, #L1 do
if strfind(messagelower, L1[i]) then
score = score + 3
score = score + 2
end
end
for i = 1, #L2 do
204,17 → 166,8
addon:SetScript("OnEvent", function(self, event)
if event == "PLAYER_LOGIN" then
-- Spammers love that "personal touch"
local name = UnitName("player")
tinsert(L1, strlower(name))
tinsert(L1, (UnitName("player")))
 
-- Fast Track, Mount Up, Mr. Popularity
for _, spell in ipairs({ 78631, 78633, 78634 }) do
local name = GetSpellInfo(spell)
if name then
tinsert(L1, strlower(name))
end
end
 
self:UnregisterEvent("PLAYER_LOGIN")
self:RegisterEvent("DISABLE_DECLINE_GUILD_INVITE")
self:RegisterEvent("ENABLE_DECLINE_GUILD_INVITE")
222,16 → 175,6
self:RegisterEvent("PLAYER_LOGOUT")
 
elseif event == "PLAYER_LOGOUT" then
-- Remove duplicate log entries
local seen = {}
for i = #NoGuildMessages, 1, -1 do
local message = NoGuildMessages[i]
if seen[message] then
tremove(NoGuildMessages, i)
else
seen[message] = true
end
end
-- Truncate log
while #NoGuildMessages > 100 do
tremove(NoGuildMessages, #NoGuildMessages)
NoGuild.toc
1,5 → 1,5
## Interface: 50400
## Version: 5.4.2.wowi:revision
## Version: 5.4.1.wowi:revision
 
## Title: NoGuild
## Notes: Block guild solicitations in whispers and public chat channels.
11,7 → 11,6
## X-Email: addons@phanx.net
## X-License: Public Domain
## X-CompatibleLocales: deDE, enUS, esES, esMX, frFR, itIT, ptBR, koKR, ruRU, zhCN, zhTW
## X-Localizations: deDE, enUS
## X-Website: http://www.wowinterface.com/downloads/info22644-NoGuild.html
## X-Curse-Project-Name: noguild
## X-WoWI-ID: 22644