Skip to content

Instantly share code, notes, and snippets.

@lahwran
Forked from anonymous/SenixIRC.py
Created September 4, 2011 00:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lahwran/1192026 to your computer and use it in GitHub Desktop.
Save lahwran/1192026 to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment