#!/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 ") #---------------------------------------------------------------- 0 b p....b p..b p.. p..b p.. p..b p.. b p....b 1 b p.. p... b p.. b p.. b p.. 2 b p.....b p..b p.. b p..b b p..b b p...... 3 b p.....b p..b p.. b p..b p..b p.. b p.....b 4 p..b p.. p..b p.. p..... b p.. b p.. 5 p..... p..b p....b b p.. p....b 6 p..... p..b p..... p..b p.. p..... 7 p..... b p.. b p... b p.. b p.. 8 b p....b p..b p.. b p....b p..b p.. b p....b 9 b p..... p..b p.. b p..... b p.. b p.. ! p.. p.. p.. b.. p.. ? b p....b p..b p.. b p..b b p..b b p..b 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..... d p....b p..b p..b p..b p.. p..b p..b p....b e p....... p..b p.....b p..b p....... f p...... p..b p..... p..b p..b g b p..... p..b p..b p... p..b p.. b p....b h p..b p.. p..b p.. p...... p..b p.. p..b p.. i p.. b.. p.. p.. p.. j b p.... b p..b b p..b p..b p..b b p...b k p..b p.. p..b p..b p....b p..b p..b p..b p.. l p..b p..b p..b p..b p...... m p..b p... p....b p.... p..b p....b p.. p..b p..b p.. p..b p.. n p..b p.. p....b p.. p..b p.... p..b p... p..b p.. o b p.....b p..b p.. p..b p.. p..b p.. b p....b p p.....b p..b p.. p.....b p..b p..b q p......b p..b p..b p..b p..b p..b p..b p....... r p....b p..b p.. p....b p..b p.. p..b p.. s p..... p..b p..... b p.. p..... t p...... b p..b b p..b b p..b b p..b u p..b p.. p..b p.. p..b p.. p..b p.. b p....b v p..b p.. p..b p.. p..b p.. p..b p.. b p..b w p..b p..b p.. p..b p..b p.. p..b p..b p.. b p..b p..b x p..b p.. b p..b p..b b p...b b p..b p..b p..b p.. y p..b p.. b p....b b p..b b p..b b p..b z p....... b p..b b p..b p....... _ b b b b p....... - b b p....... b b eof #-----------------------------------------