Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- import socket
- import string
- print 'jBot - Version 0.01'
- HOST = "irc.esper.net" # Server jBot will connect to.
- PORT = 6667 # Port of the server.
- NICK = "LLStats" # The bot's nickname.
- IDENT = "jBot" # The bot's username.
- REALNAME = "jBot [version 0.01]" # The bot's real name.
- READBUFFER = "" # Don't worry about this.
- CHANNELS = "#LemmysLand" # Channels to join upon connecting.
- s = socket.socket()
- s.connect((HOST, PORT))
- s.send("NICK %s\r\n" % NICK)
- s.send("USER %s %s bla :%s\r\n" % (IDENT, HOST, REALNAME))
- for CHANNEL in CHANNELS:
- s.send("JOIN "+CHANNEL+"\r\n")
- print ''
- print 'Channels joined successfully.'
- while 1:
- READBUFFER = READBUFFER + s.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"):
- s.send("PONG %s\r\n" % line[1])
- text = s.recv(4096)
- results = open('ll.log', 'w')
- print >>results, text
- results.close()
- #---------------------------------------------------#
- # jBot Version 1.00 #
- #---------------------------------------------------#
- # This is pretty straight-forward. This bot will #
- # log everything it finds in a given channel to a #
- # specified file, great for use with stat programs #
- # such as PISG. #
- # #
- # Special thanks goes to oreilly.com and bytes.com. #
- #---------------------------------------------------#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement