__module_name__ = "reverse" 
__module_version__ = "0.1" 
__module_description__ = "python module for xchat to send reversed strings" 
 
import xchat 


def reverse(word, word_eol, userdata):
    if len(word) < 2:
        print("Gib einen String zum Umkehren an!")
    else:
        text = word_eol[1]
        neu = ""
        i = len(word_eol[1]) -1
        while (i >= 0):
            neu = neu + text[i]
            i = i -1
        xchat.command("say " + neu)
    return xchat.EAT_ALL
	
xchat.hook_command('reverse', reverse)
xchat.prnt('Reverse-Script loaded...')


