![]() |
| |||||||
| Home | GzP Upload | GzP Arcade | Register | vbBux / vbPlaza | All Albums | FAQ | Donate | Members List | Calendar | Mark Forums Read |
![]() |
| | Thread Tools | Display Modes |
| | #1 |
| 2.718281828459045 ![]() | AntiSpam Script Well I've heard reports that there is a bit of spamming taking place in the realm of FlyFF. No one likes spammers, so I've decided to post a quick and dirty AntiSpam script for any GMs that happen across this thread, which I'm quite sure they will. A few things to note. I'm not sure if /ban is the correct command, so if it is not replace it with whatever is. Feel free to add entries to the blacklist as necessary, following the correct regular expression syntax. This is not for normal players, so please do not post bug reports. Code: ---------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------
---------------------------- FlyFF Automaton - AntiSpam Script ------------------------------
--------------------- Copyright (C) 2008 by dBased. All rights reserved. --------------------
---------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------
-------------------------------------------------
------------------- Variables -------------------
-------------------------------------------------
local AntiSpam = { }
AntiSpam.Commands = { }
AntiSpam.Enabled = true
-------------------------------------------------
-------------------------------------------------
-------------------------------------------------
------------------- Blacklist -------------------
-------------------------------------------------
AntiSpam.Blacklist = {
"www(.*)mercsell(.*)com",
"www(.*)mmodo(.*)com",
"www(.*)plsale(.*)com"
}
-------------------------------------------------
-------------------------------------------------
-------------------------------------------------
------------------- Processor -------------------
-------------------------------------------------
function AntiSpam.ProcessEvent ( Source, Text )
if ( not AntiSpam.Enabled ) then return end
Input = Text:lower ()
for k,Entry in pairs(AntiSpam.Blacklist) do
if ( Input:find ( Entry:lower () ) ~= nil ) then
ChatF ( "/ban %s", Source )
Log ( NAME_Warning, string.format ( "Banned %s for uttering: %s", Source, Text ) )
break
end
end
end
-------------------------------------------------
-------------------------------------------------
-------------------------------------------------
----------------- Event Handlers ----------------
-------------------------------------------------
function AntiSpam.OnChat ( Actor, Text )
if ( Actor == nil ) then return end
AntiSpam.ProcessEvent ( Actor:Get ( "Name" ), Text )
end
function AntiSpam.OnSay ( Source, Destination, Text )
AntiSpam.ProcessEvent ( Source, Text )
end
function AntiSpam.OnWhisper ( Source, Destination, Text )
AntiSpam.ProcessEvent ( Source, Text )
end
function AntiSpam.OnUnload ()
RemoveCommand ( "AntiSpam" )
end
-------------------------------------------------
-------------------------------------------------
-------------------------------------------------
--------------- Command Handling ----------------
-------------------------------------------------
function AntiSpam.FindCommand ( CommandName )
if ( CommandName:len () == 0 ) then return nil end
for k, Command in pairs(AntiSpam.Commands) do
if ( k:lower () == CommandName:lower () ) then return Command end
end
return nil
end
function AntiSpam.CommandHandler ( Arguments, Device )
if ( Arguments:len () == 0 ) then return false end
local ArgsPrefix = Arguments:match ( "%w+%s*" )
local CommandName = ArgsPrefix:match ( "%w+" )
local CommandArguments = Arguments:sub ( ArgsPrefix:len () + 1 )
local Command = AntiSpam.FindCommand ( CommandName )
if ( Command ~=nil ) then
Command ( CommandArguments, Device )
else
Log ( NAME_Critical, "Error: No such command exists!", Device )
end
return true
end
-------------------------------------------------
-------------------------------------------------
-------------------------------------------------
------------------- Commands --------------------
-------------------------------------------------
function AntiSpam.Commands.Enable ( Arguments, Device )
AntiSpam.Enabled = true
Log ( NAME_Log, "AntiSpam enabled!", Device )
end
function AntiSpam.Commands.Disable ( Arguments, Device )
AntiSpam.Enabled = false
Log ( NAME_Log, "AntiSpam disabled!", Device )
end
-------------------------------------------------
-------------------------------------------------
-------------------------------------------------
----------------- Registration ------------------
-------------------------------------------------
Register ( AntiSpam, "AntiSpam" )
AddCommand ( AntiSpam.CommandHandler, "AntiSpam", "<Command> <Arguments>", "Executes an AntiSpam command!" )
-------------------------------------------------
-------------------------------------------------
---------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------
__________________ ![]() Last edited by nForce; 06-24-2008 at 01:50 AM. |
| | |
| The Following 3 Users Say Thank You to nForce For This Useful Post: |
| Sponsored Links |
| |
| | #2 |
| Lurker | Re: AntiSpam Script Nice one but if gms meet ppl like me who spam shout for other ppl or just use many different spams that lil script wont work as they need to add all the spam messages to blacklist ^^ its a pretty nice idea but i dont think it will help alot ;) |
| | |
| | #5 |
| Registered User | Re: AntiSpam Script |
| | |
| | #6 | |
| 2.718281828459045 ![]() | Re: AntiSpam Script Quote:
In other words, although FlyFF Automaton does not allow a player to achieve any powers beyond that of a normal player, it does allow tasks to be automated, including administrative tasks if you do have GM privileges. Your post is a clear indication of your lack of understanding in this area. Simply because they have administrative privileges on the server, does not imply that it comes with a tool set to automate tasks as well. While, that may be possible, from what I've heard it is not the case.
__________________ ![]() | |
| | |
| | #7 |
| Registered User | Re: AntiSpam Script Nice release nForce. (; I'll use this script for the lame people :E Kthxbye~ |
| | |
| | #8 |
| Registered User | Re: AntiSpam Script Even though you are not a GM, work for Gala/Aeonsoft or anything... They should pay you... And hire you... This is beautiful work and shouldn't only be recognized by the gaming/cheating community, but the ****ing producers should bow down to your ass. You know more about their game than they do >_> |
| | |
| | #9 | ||
| Registered User | Re: AntiSpam Script why not? they are humans too. :P Quote:
Quote:
| ||
| | |
| | #10 | |
| Registered User | Re: AntiSpam Script Quote:
K ![]() | |
| | |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |