From 40e52fd277c8ef536f113f5e5dac7a8651b0d288 Mon Sep 17 00:00:00 2001 From: "Erik L. Vonderscheer" Date: Sat, 22 Nov 2008 19:10:03 +0000 Subject: [PATCH] TradeFilter v1.1 r12 --- TradeFilter.lua | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/TradeFilter.lua b/TradeFilter.lua index f0dde03..530c1ee 100644 --- a/TradeFilter.lua +++ b/TradeFilter.lua @@ -9,6 +9,11 @@ Basic structure and code ripped from crashmstr (wowzn@crashmstr.com) which was ripped from TasteTheNaimbow (Thank you Guillotine!) Versioning: + v1.1 + - Added Configurable Channel Filtering + - Trade + - General + - LFG v1.0 - Initial release for WotLK - Added Custom Filter option @@ -44,8 +49,8 @@ local L = Rock("LibRockLocale-1.0"):GetTranslationNamespace("TradeFilter") TradeFilter = Rock:NewAddon("TradeFilter", "LibRockDB-1.0", "LibRockConfig-1.0", "LibRockEvent-1.0", "LibRockHook-1.0", "LibRockTimer-1.0", "LibRockConsole-1.0") local MAJOR_VERSION = "1.1b" -local MINOR_VERSION = 000 + tonumber(("$Revision: 11 $"):match("%d+")) -TradeFilter.version = MAJOR_VERSION .. "r" .. MINOR_VERSION +local MINOR_VERSION = 000 + tonumber(("$Revision: 12 $"):match("%d+")) +TradeFilter.version = MAJOR_VERSION .. " r" .. MINOR_VERSION TradeFilter.date = string.sub("$Date: 2008-11-21 12:00:00 -0800 (Fri, 21 Nov 2008) $", 8, 17) TradeFilter:SetDatabase("TradeFilterDB") @@ -64,8 +69,11 @@ TradeFilter:SetDatabaseDefaults('profile', { {"[wW][tT][bBsStT]",true}, {"[lL][fF][wWeE]",true}, {"LFEnchant",true}, - {"LF [eE][nN][cC][hH][aA][nN][tT]",true}, - {"LF [jJ][cC]",true}, + {"[lL][fF] [eE][nN][cC][hH][aA][nN][tT]",true}, + {"[lL][fF] [jJ][cC]",true}, + {"[lL][fF] [dD][pP][sS]",true}, + {"[lL][fF] [tT][aA][nN][kK]",true}, + {"[lL][fF] [hH][eE][aA][lL][eE][rR]",true}, {"[lL][fF]%d[mM]?",true}, {"[lL][fF][gG]",true}, {"AH",true}, @@ -372,23 +380,11 @@ local function PreFilter_OnEvent(...) --[[ Taken from SpamMeNot arg1: chat message arg2: author - arg3: language - arg4: channel name with number ex: "1. General - Stormwind City" - zone is always current zone even if not the same as the - channel name - arg5: target - second player name when two users are passed for a - CHANNEL_NOTICE_USER (E.G. x kicked y) - arg6: AFK/DND/GM "CHAT_FLAG_"..arg6 flags arg7: zone ID used for generic system channels (1 for General, 2 for Trade, 22 for LocalDefense, 23 for WorldDefense and 26 for LFG) not used for custom channels or if you joined an Out-Of-Zone channel ex: "General - Stormwind City" arg8: channel number - arg9: channel name without number (this is _sometimes_ in lowercase) - zone is always current zone even if not the same as the - channel name - arg11: spam id ]] local zoneID = select(8, ...) if (zoneID == 2 and TradeFilter:IsFilterTrade()) then @@ -408,7 +404,6 @@ local function PreFilter_OnEvent(...) elseif (zoneID == 1 and not TradeFilter:IsFilterLFG()) then filtered = false end - return filtered end -- 1.7.9.5