Jethro commented on a Page, Speak English Only  -  Sep 02, 2009

Your script has some drawbacks...if someone say yes or directory it will trigger the German warning...so will other languages if any English words consists of triggers in the regex matching range. I will add a $ symbol at the end to make sure it ends with that certain match, and your script can be combined using one text event, and @ symbol in the text event is an equivalent to if ($me isop #):

on @*:TEXT:*:#: {
  var %spanish = /(hola|como|buenos|estan|buenas|tardes|si|noches)$/iS
  var %portugese = /(ola|Como|vai|você|bom|sim)$/iS
  var %german = /(ja|danke|wie|geht|es|dir|Guten|Morgen|nein|nicht)$/iS
  var %italian = /(Ciao|come|stai|buon|giorno|pomeriggio|notte|salve|sera|sta|grazie|centiamo|bene)$/iS
  if ($nick !isop $chan) {
    if ($regex($1-,%spanish)) { .msg $chan 4 $+ $nick $+ : 4Sólo hablan Inglés. 7[Spanish/Español] }
    if ($regex($1-,%portugese)) { .msg $chan 4 $+ $nick $+ : 4Por favor, fale Inglês. 7[Portugese/Português] }
    if ($regex($1-,%german)) { msg $chan 4 $+ $nick $+ : 4Englisch sprechen, bitte. 7[German/Deutsch] }
    if ($regex($1-,%italian)) { msg $chan 4 $+ $nick $+ : 4Si prega di parlare inglese. 7[Italian/Italiano] }
  }
}

But it's still not 100% foolproof; the script can still get triggered on certain match by accident.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.