Top

Speak English Only


mIRC Code
+ 0 likes
Please Register to submit score.
Bookmark and Share
Average Score  3.5 (of 2 scores)
Date Added  Sep 01, 2009
Last Updated  Sep 10, 2009
Tags  english  french  german  italian  only  spanish  translate  warn 

Introduction

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_

Grab the Code

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] }
  }
}
 

Comments

  (10)  RSS
Jethro_
Comments: 436
 
mIRC Snippet:  Speak English Only
Posted on Sep 2, 2009 12:13 am
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 #):
Code:
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.
Blubble
Comments: 15
 
mIRC Snippet:  Speak English Only
Posted on Sep 4, 2009 4:41 pm
I tried it in my channel. Not once anyone spoke in anything else than english but it warned alot. Good idea, but needs some work.
miniCruzer
Comments: 47
 
mIRC Snippet:  Speak English Only
Posted on Sep 4, 2009 4:47 pm
Can you post some of the instances it warned?
Blubble
Comments: 15
 
mIRC Snippet:  Speak English Only
Posted on Sep 4, 2009 5:30 pm
[22:42:41] <00Big_Boss> ignores opers
[22:42:41] <07&Helios> 4Big_Boss: 4Englisch sprechen, bitte. 7[German/Deutsch]

[22:37:19] <00Stevo127> You stupid bastard
[22:37:20] <07&Helios> 4Stevo127: 4Si prega di parlare inglese. 7[Italian/Italiano]

[22:25:24] <00Stevo127> Old mIRC version
[22:25:25] <07&Helios> 4Stevo127: 4Sólo hablan Inglés. 7[Spanish/Español]

[22:17:06] <00Stevo127> im tryin to get his attension
[22:17:07] <07&Helios> 4Stevo127: 4Sólo hablan Inglés. 7[Spanish/Español]
miniCruzer
Comments: 47
 
mIRC Snippet:  Speak English Only
Posted on Sep 5, 2009 1:12 pm
Anyhow it's basically fixed. There are some things it still picks up in German, and "Hola" does for both Portugese and Spanish.
Jethro_
Comments: 436
 
mIRC Snippet:  Speak English Only
Posted on Sep 5, 2009 2:33 pm
miniCruzer, add \b anchor to every of your regex matches like this:
Code:
/(\bbola\b|\bComo\b|\bvai\b|\bvocê\b|\bbom\b|\bsim\b)/iS
This will greatly minimize the chances of being triggered wrongly if any word or letter said within the matching text. And remove the dollar sign at the end of them.

I think it's rude and arrogant to laugh at people's scripts without giving his or her suggestion for improvement.
Scarecrow
Comments: 3
 
mIRC Snippet:  Speak English Only
Posted on Sep 5, 2009 3:29 pm
Nice.

Code:

var %italian = /(Ciao|come|stai|buon|giorno|pomeriggio|notte|salve|sera|sta|grazie|centiamo|bene)$/iS


"centiamo" isnt italian :D
Blubble
Comments: 15
 
mIRC Snippet:  Speak English Only
Posted on Sep 7, 2009 9:46 am
@ Jethro_: Who laughed at the script?
miniCruzer
Comments: 47
 
mIRC Snippet:  Speak English Only
Posted on Sep 10, 2009 5:57 pm
@ Bubble: I deleted the comments =/ No one "laughed"
Blubble
Comments: 15
 
mIRC Snippet:  Speak English Only
Posted on Sep 11, 2009 6:17 am
o.O

Commenting Options

Register or Login to Hawkee.com or use your Facebook or Twitter account by clicking the corresponding button below.

  
Bottom