Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- import socket
- import string
- HOST="irc.esper.net"
- PORT=6667
- NICK="Senix_BOT"
- IDENT="Senix"
- REALNAME="Senix"
- JOIN=""
- readbuffer=""
- #chat = raw_input("#>")
- sock=socket.socket( )
- sock.connect((HOST, PORT))
- sock.send("NICK %s\r\n" % NICK)
- sock.send("USER %s %s bla :%s\r\n" % (IDENT, HOST, REALNAME))
- sock.send("JOIN #gemu\r\n")
- while 1:
- #readbuffer=readbuffer+sock.recv(1024)
- #temp=string.split(readbuffer, "\n")
- #readbuffer=temp.pop( )
- #for line in temp:
- # line=string.rstrip(line)
- # line=string.split(line)
- # if(line[0]=="PING"):
- # sock.send("PONG %s\r\n" % line[1])
- #print line
- data = sock.recv(4096)
- if data.find('PING') != -1:
- sock.send('PONG ' + '\r\n')
- print data
Add Comment
Please, Sign In to add comment