Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Code Gallery (https://forums.graalonline.com/forums/forumdisplay.php?f=179)
-   -   swear filter (https://forums.graalonline.com/forums/showthread.php?t=79524)

[email protected] 04-24-2008 09:12 PM

swear filter
 
talking to someone about it earlier, was fun to try out he he

PHP Code:

function onCreated() {
  
temp.chat "Hello you ****ing queer ****! I hope that you****ing die!!";
  
temp.illegal = {"****ing""queer""****"};

  
temp.token chat.tokenize();
  
temp.len null;
  
temp.res "";
  
  for (
temp.itoken) {
    if (
i in illegal) {
      for (
len 0len i.length(); len++) 
        
res @= randomstring("$""£""#");
    } else 
    for (
temp.cillegal) {
      if (
i.starts(c)) {
        for (
len i.charat(c); len c.length(); len++) 
          
res @= randomstring("$""£""#");
        
res @= i.substring(c.length());
      } else if(
i.ends(c)) {
        
res @= i.substring(0i.length() - c.length());
        for (
len i.charat(c); len c.length(); len++) 
          
res @= randomstring("$""£""#");
      }
    }
    if (
len == null)
      
res @= i;
    
    
temp.output @= res.trim() @ " ";
    
res "";
    
len null;
  }
  
  echo(
output);



Programmer 04-24-2008 09:17 PM

Quote:

Originally Posted by [email protected] (Post 1387540)
talking to someone about it earlier, was fun to try out he he

PHP Code:

function onCreated() {
  
temp.chat "Hello you ****ing queer ****!";
  
temp.illegal = {"****ing""queer""****"};

  
temp.token chat.tokenize();
  
temp.len null;
  
temp.res "";
  
  for (
temp.itoken) {
    if (
i in illegal) {
      for (
len 0len i.length(); len++) 
        
res @= randomstring("$""£""#");
    } else 
    for (
temp.cillegal) {
      if (
i.starts(c)) {
        for (
len i.charat(c); len c.length(); len++) 
          
res @= randomstring("$""£""#");
        
res @= i.substring(c.length());
      }
    }
    if (
len == null)
      
res @= i;
    
    
temp.output @= res.trim() @ " ";
    
res "";
    
len null;
  }
  
  echo(
output);



Looks good, but I highly suggest you not use the Euro sign ... its not supported on some machines.

Crow 04-24-2008 09:40 PM

Quote:

Originally Posted by Programmer (Post 1387542)
Looks good, but I highly suggest you not use the Euro sign ... its not supported on some machines.

That's not the Euro sign ._.'

[email protected] 04-24-2008 09:42 PM

whats the euro sign...? lol.......

Programmer 04-24-2008 09:47 PM

Quote:

Originally Posted by Crow (Post 1387554)
That's not the Euro sign ._.'

Pound sign, sorry.

Crow 04-24-2008 09:47 PM

Quote:

Originally Posted by [email protected] (Post 1387556)
whats the euro sign...? lol.......

This is Euro -> €
But I guess Programmer was referring to £.

Edit: :)

Desear 04-24-2008 10:04 PM

Would be nice if their could actually be an option to disable the swear filter for more mature players, and such. That way it will satisfy the trash talkers, and the people who don't want to see it.

By any chance is that scripting making curse words appear like this, "@$$#" or something?

[email protected] 04-24-2008 10:12 PM

yes

Tigairius 04-24-2008 10:20 PM

It's okay, but why not just use:
http://graal.net/index.php/Creation/Dev/Word_Filter

cbk1994 04-25-2008 02:00 AM

Swear filters are useless, there are any number of ways to get past them.


All times are GMT +2. The time now is 04:39 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.