Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import socket as cow
- NICK = "@"
- USER = "@"
- PASS = "@"
- HOST = "irc.freenode.net"
- PORT = 6667
- IN_CHANNEL = False
- CHANNEL = '##hairybot'
- s = cow.socket()
- s.connect( (HOST, PORT))
- s.sendall('USER %s %s server :%s' % (NICK,HOST,NICK))
- s.sendall('NICK %s\n' % NICK)
- s.sendall('msg NickServ :IDENTIFY @ %s\n' % PASS)
- while not IN_CHANNEL:
- line = s.recv(500);
- if "Welcome to the freenode Internet Relay Chat Network" in line:
- s.sendall('JOIN %s\n' % CHANNEL);
- IN_CHANNEL = True
- while True:
- line = s.recv(500)
- if 'PING' in line:
- line = line.rstrip()
- line = line.split()
- s.send('PONG %s\n' % line[1])
Add Comment
Please, Sign In to add comment