Speak English Only
Platform: mIRC
Published Sep 01, 2009
Updated Sep 10, 2009
This script looks for particular words in other languages and warns the user to speak English in their language.
It only works if they are not an operator, and the holder of this script is an operator.
This is fairly basic because it only looks for common greeting words, and only warns. I'd like to get it to kick on the 2nd offense.
It supports Spanish, Portugese, German, and Italian. Feel free to add more words/languages.
If you're finding you need this script a lot, you might want to include a
!translate function. I am using mountaindew's Google Translator in case the bot does not recognize a word. Said script can be found here:
http://www.hawkee.com/snippet/4103/
Please let me know if you're going to use it! I'd like to get a count if anyone will use.
Changelog
Regular Expressions
Script now uses
Regular Expressions, also known as
Regular Expressions. Allows for higher accuracy, but not fool proof.
Exact Identification
Script now looks for the
exact word, and warns it. It used to say:
Quote
<someone>: Yes please
<bot>: someone: Englisch sprechen, bitte.
Thank You Jethro_ on *:TEXT:*:#: {
var %spanish = /(\bhola\b|\bcomo\b|\bbuenos\b|\bestan\b|\bbuenas\b|\btardes\b|\bsi\b|\bnoches\b)$/iS
var %portugese = /(\bola\b|\bcomo\b|\bvai\b|\bvocê\b|\bbom\b|\bsim\b)$/iS
var %german = /(\bja\b|\bdanke\b|\bwie|\bgeht\b|\bes\b|\bdir\b|\bGuten\b|\bMorgen\b|\bnein\b|\bnicht\b)$/iS
var %italian = /(\bCiao\b|\bcome\b|\bstai\b|\bbuon\b|\bgiorno\b|\bpomeriggio\b|\bnotte\b|\bsalve\b|\bsera\b|\bsta\b|\bgrazie\b|\bcentiamo\b|\bbene\b)$/iS
;if ($nick !isop $chan) && ($me 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] }
}
}