[XCHAT] simple substitution script
Dienstag, 09. September 2008שָׁלוֹם
/home/cassmodiah/.xchat/sss.py
/*
* ----------------------------------------------------------------------------
* "THE BEER-WARE LICENSE" (Revision 42):
* <bjoern.hiller@gmail.com> wrote this file. As long as you retain this notice you
* can do whatever you want with this stuff. If we meet some day, and you think
* this stuff is worth it, you can buy me a beer in return Björn Benjamin Hiller
* ----------------------------------------------------------------------------
*/
# -*- encoding: utf-8 -*-
__module_name__ = 'sss'
__module_version__ = '1.0'
__module_description__ = 'simple substitution script'
import re, xchat
own_hook = False
def your_msg_cb(word, word_eol, userdata):
global own_hook
if own_hook:
own_hook = False
return xchat.EAT_NONE
else:
text = word_eol[0].replace('ä', 'ae').replace('Ä', 'Ae')
text = text.replace('ö', 'oe').replace('Ö', 'Oe')
text = text.replace('ü', 'ue').replace('Ü', 'Ue')
text = text.replace('ß', 'sz')
own_hook = True
xchat.command('SAY %s' % text)
return xchat.EAT_XCHAT
xchat.hook_command('', your_msg_cb)
So long
שִׁמְעוֹן



