PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: bliskner on 25 May, 2004, 19:32:59

Title: Ignore pm script
Post by: bliskner on 25 May, 2004, 19:32:59
hi, i'm looking for a script that will ignore a private message that i recieve if it is of a certain form. ie if the message contains xxxxxx then ignore the message and don't pop it up.

is there any way to do this? using bcdc++ vers 0.401
thx
Title:
Post by: nErBoS on 25 May, 2004, 23:35:24
Hi,

You are requesting for a hub script or a client script ???

Best regards, nErBoS
Title:
Post by: bliskner on 26 May, 2004, 10:12:04
client side pls

but i don't even know if it is possible

client is BCDC v401b
Title:
Post by: nErBoS on 26 May, 2004, 12:49:12
Hi,

Not expert on that part but i think is possible, wait for the experts :)

Best regards, nErBoS
Title:
Post by: plop on 26 May, 2004, 15:14:51
here is 1.
--// vim:ts=4:sw=4:noet
--//
--// the second argument decides in which order the scripts are run
--// use numbers when you need order, else you can just use a _unique_ identifier

-- the array of forbidden things
trigs = { "fuck", "weingarten", "ip.com", "ass.org", "dns2go", "yhub", "servemp3.net", "mine,nu"}

dcpp:setListener( "pm", "pmfilter",
function( hub, user, text )
local s = string.lower( text )
if not user:isOp() then
            for i=1,table.getn(trigs) do
                if string.find(s, trigs[i]) then
                   return 1
                end
            end
        end
end
)
DC():PrintDebug( "  ** Loaded pm_filter.lua **" )
plop