Jump to content

Problem with Insane Limits Code


ImportBot

Recommended Posts

Originally Posted by serialkillerz82*:

 

Ok so I found the below code within a closed post. I have added it to my server but when someone says a bad word that is listed nothing happens. My question is does anyone know if it does work? If not anyone know whats wrong with it?

 

---------------------------

 

Auto-Insult Responder

Players like to vent, so I thought it would be funny if the server vented back:-

 

 

Set limit to evaluate OnAnyChat, set action to None.

 

Set first_check to this Code:

Code:

List bad_words = new List();

bad_words.Add(@".*n+[ -/:-@[-`{-~£]*[3e]+[ -/:-@[-`{-~£]*w+[ -/:-@[-`{-~£]*[bp].*");

bad_words.Add(@".*b+[ -/:-@[-`{-~£]*[o0]{2,}[ -/:-@[-`{-~£]*n.*");

bad_words.Add(@".*n+[ -/:-@[-`{-~£]*[4aiu*]+[ -/:-@[-`{-~£]*b.*");

bad_words.Add(@".*n+[ -/:-@[-`{-~£]*[o0]+[ -/:-@[-`{-~£]*[bp]{2,}.*");

bad_words.Add(@".*n+[ -/:-@[-`{-~£]*[o0u]+[ -/:-@[-`{-~£]*[o0u]+[ -/:-@[-`{-~£]*[bp].*");

bad_words.Add("twat");

bad_words.Add("prick");

bad_words.Add("noob");

 

foreach(String bad_word in bad_words)

if (Regex.Match(player.LastChat, "^"+bad_word+"$", RegexOptions.IgnoreCase).Success)

return true;

 

return false;

Note: Member supermillhouse wrote the above code, I just modified it.

 

Set second_check to this Code:

Code:

/* Version: V0.8/R1-Random */

List shame = new List();

shame.Add("%p_n% you are muppet!");

shame.Add("%p_n% you are 'special'!");

shame.Add("%p_n% that was a pathetic insult, not going to even bother!");

shame.Add("%p_n% not much of an insult eh_!");

shame.Add("%p_n% such a large vocalbury - we are all impressed(!)");

// Add additional messages here with shame.Add("...");

 

//Randomize

Random rand = new Random();

int next = rand.Next(shame.Count); // Choose random index bounded by list count

 

String msg = plugin.R(shame[next]);

 

//Send message

plugin.SendGlobalMessage(msg);

 

return false;

Note: Member PapaCharlie9 wrote the above code, I just modified it.

* Restored post. It could be that the author is no longer active.
Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

Please review our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.