Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > Code Gallery
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 03-03-2008, 12:12 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Chat Filter

I find it the best thing since the slice of bread!

PHP Code:
//#CLIENTSIDE
function onPlayerChats()
{
  if (
player.chat == "unstick me")
  {
    return 
false;
  }
  
  
temp.filters = {
    { {
"no""nah""nay"}, {"ar""yar matey""aye laddy"}},
    { {
"hello""hi""hey""hiya"}, {"'ey matey""avast"}},
    { {
"***"}, {"scallywag""scallywag"}},
    { {
"****"}, {"arrrrrrrrg""fuk""arrg""arrrrrrrrrrrrrrrrrrrg"}},
    { {
"nig""******""ngr""nigro""negro"}, {"blackskinned folk""blacker folk""cursed people"}},
    { {
"****"}, {"scurvy""davey jones waste"}},
    { {
"****""****""dik"}, {"mast""treasure chest"}},
    { {
"douchebag"}, {"waterdog""water dog"}},
    { {
"daz"}, {"black beard""blackbeard"}},
    { {
"staf""staff"}, {"crew""maties"}},
    { {
"vulcan"}, {"deckboy""deck boy"}},
    { {
"yes""yeah""yea"}, {"yar""yaaar"}},
    { {
"people""person""guy""man"}, {"folk""mate"}},
    { {
"there"}, {"ahoy"}},
    { {
"money""cash"}, {"dubloon""dubloons"}}
  };
  
  
temp.chat player.chat.tokenize();
  
  for (
temp.itemp.chat)
  {
    for (
temp.ftemp.filters)
    {
      for (
temp.gtemp.f[0])
      {
        
temp.newChat false;
        
        if (
temp.== temp.i.lower())
        {
          
temp.newChat randomstring(temp.f[1]);
        }
          else
        if (
temp.i.lower().starts(temp.g))
        {
          
temp.newChat randomstring(temp.f[1]) @ temp.i.substring(temp.g.length());
        }
          else
        if (
temp.i.lower().ends(temp.g))
        {
          
temp.newChat temp.i.substring(0temp.g.length()) @ randomstring(temp.f[1]);
        }          
        
        if (
temp.newChat != false)
        {
          
temp.chat.replace(temp.ctemp.newChat);
        }
        
      }
    }
    
temp.c++;
  }
  
  
temp.newChat "";
  
  for (
temp.ctemp.chat)
  {
    
temp.newChat @= temp." ";
  }

  
player.chat temp.newChat;

__________________
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 06:01 PM.


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