#!/usr/bin/python #-*- coding: ISO-8859-1 -*- #script escrito por JimmySkull __module_name__ = "Big Letters" __module_version__ = "1.0" __module_description__ = "Criar um texto grande" import commands import time import sys import xchat lists = ['nil', 'nil', 'nil', 'nil', 'nil'] def getword(letra,x,fundo): try: Arq = '/home/jimmy/.xchat2/letters' f = open (Arq, 'r') try: try: S = f.readline()[:-1] while not (S == letra): S = f.readline()[:-1] if S == "eof": raise C = 0 while C < 5: if C == 4: S = f.readline()[:-1] else: S = f.readline()[:-2] lists[C] = lists[C] + S + fundo + ' ' C = C + 1 except: print "Letra \"%s\" não encontrada" % (letra) finally: f.close() except: print "Erro ao carregar \"%s\"" % (Arq) return 0 def DoBig(palavra, texto, fundo): try: #print 'limpando' i = 0 while i < 5: lists[i] = "" i = i + 1 #print 'getwords' PalLen = len(palavra) i = 0 while i < PalLen: getword(palavra[i:i+1],i,fundo) i = i + 1 #print 'send' i = 0 while i < 5: lists[i] = lists[i].replace('b', fundo) # "b" de branco lists[i] = lists[i].replace('p', texto) # "p" de preto lists[i] = lists[i].strip('\n\r') xchat.command("say %s" % (lists[i])) i = i + 1 except IndexError: print "Erro ao criar big letter" return xchat.EAT_ALL return xchat.EAT_ALL def ValidarCor(valor): if valor in ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9'): return True else: return False def Big(word, word_eol, userdata): try: palavra = word[1].lower() except IndexError: print "Nenhuma palavra foi especificada. /big " return xchat.EAT_ALL return DoBig(palavra, '1,1', '0,0') def BigEx(word, word_eol, userdata): try: Cor1 = word[1] Cor2 = word[2] Pal = word[3] if not ValidarCor(Cor1): raise if not ValidarCor(Cor2): raise Cor1 = "%s,%s" % (Cor1,Cor1) Cor2 = "%s,%s" % (Cor2,Cor2) except IndexError: print "Uso correto: /big " return xchat.EAT_ALL return DoBig(Pal, Cor1, Cor2) xchat.hook_command("big", Big, help="/big palavra") xchat.hook_command("bigex", BigEx, help="/bigex ") #------------------------------------------------- exemplo de caracter a b p...b p.b p. p..... p..... p.b p. b p.....b p..b p.. p.....b p..b p.. p.....b c b p..... p..b p..b p..b b p.....