All pastes #353395 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-02-13 10:25 UTC
rendered paste body
while 1:

        line=s.recv(500) #recieve server messages
        print line #server message is output
        if line.find('Welcome')!=-1:
                s.send("JOIN :%s\r\n" % CHAN)
        if line.find('PRIVMSG')!=-1: #Call a parsing function
                parsemsg(line)
                line=line.rstrip() #remove trailing 'rn'
                line=line.split()
        if(line[0]=='PING'): #If server pings then pong
                s.send('PONG '+line[1]+'n')