Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import socket, string, urllib2, random, time
- #Programa que crea un bot para el IRC
- def formateo(cadena):
- cont = 0
- cadena=cadena+';'
- lista=[]
- while cont!= len(cadena):
- if cadena[cont]=='&':
- while cadena[cont]!=';':
- cont+=1
- else:
- lista.append(cadena[cont])
- cont+=1
- while ';' in lista:
- del lista[lista.index(';')]
- title=string.join(lista)
- socket_bot.send('PRIVMSG '+canal+' :'+'\x0300,10'+title+'\n')
- botnick = "Vaca-mu"
- server = "luna.irc-hispano.org"
- puerto = 6667
- canal = "#redes"
- cont=1
- f = open("log.txt", "w")
- socket_bot = socket.socket()
- socket_bot.connect((server, puerto))
- socket_bot.send('USER bobo bubu bibi :amateur\n')
- socket_bot.send('NICK ' +botnick+'\n')
- def mu():
- socket_bot.send("PRIVMSG "+ canal +" :muuuuuuuuuuuu!\n")
- def mu1():
- socket_bot.send("PRIVMSG "+ canal +" :muuuu... Me encanta la hierba del prado!\n")
- def mu2():
- socket_bot.send("PRIVMSG "+ canal +" :muuuu... Cago pasteladas de kk por el campo!\n")
- def mu3():
- socket_bot.send("PRIVMSG "+ canal +" :muuuu... El Torito me pone a cien!\n")
- def mu4():
- socket_bot.send("PRIVMSG "+ canal +" :muuuu... Cada dia me tocan las tetas para desayunar!\n")
- def mu5():
- socket_bot.send("PRIVMSG "+ canal +" :muuuu... muuuu....Donde esta mi Torito bravo!!!\n")
- def tonto():
- socket_bot.send("PRIVMSG "+ canal +" :mas tonto eres tu que solo piensas en tonterias!\n")
- def bot():
- socket_bot.send("PRIVMSG "+ canal +" :soy un ser mas inteligente que tu!\n")
- def comes():
- socket_bot.send("PRIVMSG "+ canal +" :me paso todo el dia comiendo cesped...soy un rumiante!\n")
- def amor():
- socket_bot.send("PRIVMSG "+ canal +" :Amor es lo que me hace sentir el toro cuando se pone bravo!\n")
- def nolose():
- socket_bot.send("PRIVMSG "+ canal +" :no es que no lo sepas, sino que no buscas el significado del sentido... palabra por palabra!\n")
- def jodas():
- socket_bot.send("PRIVMSG "+ canal +" :yo no jodo a nadie, Solo hago el amor, si te molesta es porque eres tonto!\n")
- def loco():
- socket_bot.send("PRIVMSG "+ canal +" :el que no llega a enteder algo por si mismo suele decir vulgarmente: tu estas loco!\n")
- while True:
- line = socket_bot.recv(4096)
- print line
- if line.find('PING')!=-1:
- socket_bot.send('PONG ' +line.split()[1]+'\r\n')
- socket_bot.send("JOIN " +canal+'\n')
- f.write(line)
- cont=cont+1
- if cont==1000:
- print "se cerrara el archivo"
- f.close()
- socket_bot.close()
- if line.find("amor") != -1:
- time.sleep(2)
- amor()
- if line.find("comes") != -1:
- time.sleep(2)
- comes()
- if line.find("tonta") != -1:
- time.sleep(2)
- tonto()
- if line.find("bot") != -1:
- time.sleep(2)
- bot()
- if line.find("no jodas") != -1:
- time.sleep(2)
- jodas()
- if line.find("loco") != -1:
- time.sleep(2)
- loco()
- if line.find(":mu") != -1:
- num = random.randint(0,5)
- time.sleep(2)
- if num == 0: mu()
- if num == 1: mu1()
- if num == 2: mu2()
- if num == 3: mu3()
- if num == 4: mu4()
- if num == 5: mu5()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement