All pastes #833228 Raw Edit

crafouineur

public python v1 · immutable
#833228 ·published 2007-12-27 01:20 UTC
rendered paste body
#!/usr/bin/pythonimport socketimport stringimport reNDBot = "B0by"Nbot = "Crafouin"NDChan = "#bot"Server = "irc.worldnet.net"Port = 6667#Pswd = ""pingRegex = re.compile ('^PING :(.*)$', re.IGNORECASE)Sock = socket.socket(socket.AF_INET,socket.SOCK_STREAM)Sock.connect((Server, Port))Sock.send( "NICK " + NDBot + "\n" )Sock.send( "USER " + NDBot + " " + Nbot + " " + Nbot + " " + Nbot + "\n" )Sock.send( "JOIN " + NDChan + "\n" )#Sock.send( "NICKSERV : IDENTIFY " + Pswd + "\n" )while 1:	buffer = Sock.recv(512)	pingOuPas = pingRegex.match (buffer)	if pingOuPas is not None:		Sock.send ("PONG :" + pingOuPas.group(1) + "\n")		print "un PING a ete recu !"