Page 1 of 1

Anti Swear Plugin

Posted: 22 Apr 2008 23:54
by UNP-Gadget
Hi all,
Is there anybody out there who can write an anti Swear plugin for Aseco. We have a 60 man server but there seems to be lots of idiots out there who are determined to spoil it for others by swearing on screen etc.

Thanks in advance!

Re: Anti Swear Plugin

Posted: 23 Apr 2008 01:45
by Assembler Maniac
Which version of aseco are you running?

If it's 2.0, then chatbot has a way to define kick/ban words.

Re: Anti Swear Plugin

Posted: 23 Apr 2008 06:58
by Archmage
Hmm... Example:

[Newbie] Hello Sirs, cann someone please be so kind and assist me with a short question that I want to ask you. Any help would be highly appricated and I would be very thankfull.
[Swearer] FUCCK U azzlicking pik!

User Newbie kicked, because of using the swear-word "ass". User Swearer isn't using any swear-word and therefore he remains on the server. Is this really what you want?

Re: Anti Swear Plugin

Posted: 23 Apr 2008 09:09
by Xymph
Then don't enter a short string like "ass" that can occur within many other words in the list. :wink:
But still, any badwords filter will get circumvented by players that really want to, and can inadvertently catch phrases by players who didn't mean to curse. I don't think it's really possible to avoid that.

Btw, XASECO also has a filter, in the main Jfreu plugin.

Re: Anti Swear Plugin

Posted: 23 Apr 2008 10:05
by lgrfbs-sweden
as not working so fine :?
have same "error" as Archmage writed about ....

Re: Anti Swear Plugin

Posted: 23 Apr 2008 19:08
by Basti504
I use the following script on my server (aseco tmf). I only put very dirty words in the list, all other is up to the admin in the game. It also explanes to the user why he got kicked.

Code: Select all

<?php
class Bad extends Plugin {
  
   function CheckForBadWords($command) {
	
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//array with dirty words :O
$badwords = array( "---"
            ,"---"
	,"---"
	,"---"
	,"---"
	,"---"
            ,"---"
            ,"---"
            ,"----"
            );

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

	if ( $command[0] == 0 || substr($command[2], 0, 1) == '/' )
	{
		return;
	}
    
	
	$loginid = $command[0]; 
	$login = $command[1]; 
	$message = $command[2]; 
	$player = $command['author']->nickname; 
	
	echo $message;
	
		foreach ($badwords as $word){
		
			if (stristr($message, $word)){
				
				//explain
				$this->Aseco->client->query("ChatSendServerMessageToLogin", '$ff0>> $i$w$f00          ! ATTENTION !', $login);
				$this->Aseco->client->query("ChatSendServerMessageToLogin", '$ff0>> $i$w$f00          ! ATTENTION !', $login);
				$this->Aseco->client->query("ChatSendServerMessageToLogin", '$ff0>> $i$0f3You broke the server rules, by swearing with bad words. You will be automatically kicked from the server!', $login);
				
				//kick
				$this->kickPlayer($aseco, $login, $player);
				
			}
		}
	
  }
  
 function kickPlayer($aseco, $login, $player){
	//sleep(3);
	$this->Aseco->client->query("ChatSendServerMessage", '$ff0>> Server kicked cursing player $fff' . $player . ' $z$ff0!');
    $this->Aseco->client->query('Kick', $login);
}
  
 }

$_PLUGIN = new Bad();
$_PLUGIN->setAuthor('-');
$_PLUGIN->setVersion(1.0);
$_PLUGIN->addEvent('onChat', 'CheckForBadWords');
$_PLUGIN->setDescription('Bad Words.');
?>

Re: Anti Swear Plugin

Posted: 23 Apr 2008 19:12
by f*ckfish
With the new chatstream functions you get new possibilities in handling swear words, you can for example just replace the swear word and send the modified line to the chat. So there may be no need for instant kicking anymore. We'll see when a plugin like this is available.

Re: Anti Swear Plugin

Posted: 23 Apr 2008 20:05
by Zengrath
I had a similiar problem other day.. One guy out of the blue said this really awfull thing on my server, immediately after 2 or 3 others did the same thing. of course chatbot kicked them but the fact that it still went through is what bothered me.

I normaly do not care about cussing at all, but being the admin/owner on a server it bothers me more becuase i feel i'm responsible.

Is there a way to have chatbot kick them without the text reaching the server?

Re: Anti Swear Plugin

Posted: 23 Apr 2008 20:20
by Retodon8
Xymph wrote:Then don't enter a short string like "ass" that can occur within many other words in the list. :wink:
I remember playing a tiny bit of Ultima Online and keep seeing the word "gl@$ß", or something like that.
I really didn't get what that did in a Fantasy game, until I suddenly realised the word "glass" includes the word "ass".
Not sure what's wrong with donkeys, but oh well.