daily pastebin goal
66%
SHARE
TWEET

Untitled

a guest Mar 8th, 2018 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import sys
  2. import socket
  3. import string
  4.  
  5. HOST="irc.coldfront.net"
  6. PORT=6667
  7. NICK="Math2_Bot"
  8. IDENT="Math2_Bot"
  9. REALNAME="Math2"
  10. readbuffer=""
  11.  
  12. s=socket.socket( )
  13. s.connect((HOST, PORT))
  14. s.send("NICK %s\r\n" % NICK)
  15. s.send("USER %s %s bla :%s\r\n" % (IDENT, HOST, REALNAME))
  16.  
  17. while 1:
  18.     readbuffer=readbuffer+s.recv(1024)
  19.     temp=string.split(readbuffer, "\n")
  20.     readbuffer=temp.pop( )
  21.  
  22.     for line in temp:
  23.         line=string.rstrip(line)
  24.         line=string.split(line)
  25.  
  26.         if(line[0]=="PING"):
  27.             s.send("PONG %s\r\n" % line[1])
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top