noespanol.py
Posted: Sat Jan 04, 2014 6:50 pm
So this is another script that basically tells the player to speak English and if they speak Spanish it wont show up In the chat.
Adapted from Influx`s ktonolak.py
Adapted from Influx`s ktonolak.py
Code: Select all
Or you can download it here."""
Stops the users that talk in spanish by telling them to talk in english.
Adapted from Influx`s ktonolak.py
By: Matthew0901
v1.1
"""
import string
def apply_script(protocol, connection, config):
class nospanishConnection(connection):
global spanishdict
spanishdict = {
'hola',
'encanta',
'adecuada',
'cuando',
'suspiro'
'este',
'juego',
'hizo',
'adios',
'asi',
'quien',
'edificio',
'dolor',
'aleman',
}
def on_chat(self, value, global_message):
message = string.lower(value)
for punc in string.punctuation:
message = message.replace(punc,"")
if any(spanish in message for spanish in spanishdict):
self.send_chat('Se trata de un servidor de Ingles. Por favor, escriba en Ingles!')
return False
return connection.on_chat(self, value, global_message)
return protocol, nospanishConnection