Guest User

Untitled

a guest
Mar 8th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  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])
Add Comment
Please, Sign In to add comment