import commands import xchat __module_name__ = 'FigX' __module_version__ = '1.0' __module_description__ = 'Runs strings through figlet multiple times' def figx(word, word_eol, userdata): times = int(word[1]) message = ' '.join(word[2:]) lines = message.split('\n') for i in range(0, times): new_lines = [] for j in range(0, len(lines)): out = commands.getoutput('figlet \'' + lines[j] + '\'') for new_line in out.split('\n'): new_lines.append(new_line) lines = new_lines for line in lines: if line.strip(): xchat.command('say ' + line) return xchat.EAT_ALL xchat.hook_command('FIGX', figx) # ----------------------------------------------------- import xchat __module_name__ = 'Flood' __module_version__ = '1.0' __module_description__ = 'Floods with triangles' def flood(word, word_eol, userdata): message = ' '.join(word[1:]) for i in range(1, len(message) + 1): xchat.command('say ' + message[:i]) return xchat.EAT_ALL def figf(word, word_eol, userdata): message = ' '.join(word[1:]) command = '' for i in range(1, len(message) + 1): command += 'figlet ' + message[:i] + '; ' xchat.command('exec -o ' + command) return xchat.EAT_ALL xchat.hook_command('FLOOD', flood) xchat.hook_command('FIGF', figf) # ----------------------------------------------------- import xchat __module_name__ = 'Shapes' __module_version__ = '1.0' __module_description__ = 'Makes shapes' def pyramid(word, word_eol, userdata): step = int(word[1]) message = ' '.join(word[2:]) length = len(message) if (length % 2) == 0: cutout = (length / 2) - 1 else: cutout = (length - 1) / 2 while cutout > 0: line = (' ' * cutout) + message[:(-2 * cutout)] xchat.command('say ' + line) cutout -= step return xchat.EAT_ALL def pent(word, word_eol, userdata): message = ' '.join(word[1:]) length = len(message) if (length % 2) == 0: cutout = (length / 2) - 1 else: cutout = (length - 1) / 2 while cutout > 0: line = (' ' * cutout) + message[:(-2 * cutout)] xchat.command('say ' + line) cutout -= 2 xchat.command('say ' + message) cutout = 1 base = length / 2 letters = length while letters >= base: line = (' ' * cutout) + message[:(-2 * cutout)] xchat.command('say ' + line) cutout += 1 letters -= 2 return xchat.EAT_ALL xchat.hook_command('PYRAMID', pyramid) xchat.hook_command('PENT', pent)